46 for (
unsigned int i = 0; NULL !=
ps[i].name; i++)
52 "Preparing SQL statement `%s' as `%s' on %p\n",
56 ret = PQprepare (
db->conn,
61 if (PGRES_COMMAND_OK != PQresultStatus (
ret))
65 "PQprepare (`%s' as `%s') failed with error: %s\n",
68 PQerrorMessage (
db->conn));
70 ret = PQdescribePrepared (
db->conn,
72 if (PGRES_COMMAND_OK != PQresultStatus (
ret))
79 "Statement `%s' already known. Ignoring the issue in the hope that you are using connection pooling...\n",
96 "Preparing SQL: %s\n",
103 if (PGRES_COMMAND_OK != PQresultStatus (
ret))
107 "PQprepare (`%s') failed with error: %s\n",
109 PQerrorMessage (pg->
conn));
125 unsigned int nlen = 0;
129 while (NULL !=
ps[nlen].
name)
131 xlen = nlen +
db->ps_off;
132 if (xlen >
db->ps_len)
145 memcpy (&
db->ps[
db->ps_off],
static int ret
Final status code.
static struct GNUNET_PEERSTORE_Handle * ps
Handle to the PEERSTORE service.
static char * name
Name (label) of the records to list.
static struct GNUNET_FS_DirectoryBuilder * db
#define GNUNET_log_from(kind, comp,...)
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
#define GNUNET_new_array(n, type)
Allocate a size n array with structs or unions of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
shared internal data structures of libgnunetpq
enum GNUNET_GenericReturnValue GNUNET_PQ_prepare_once(struct GNUNET_PQ_Context *db, const struct GNUNET_PQ_PreparedStatement *ps)
Request creation of prepared statements ps from Postgres, but do not automatically re-prepare the sta...
enum GNUNET_GenericReturnValue GNUNET_PQ_prepare_anon(struct GNUNET_PQ_Context *pg, const char *sql)
Prepares SQL statement sql under no name ("") for connection pg.
enum GNUNET_GenericReturnValue GNUNET_PQ_prepare_statements(struct GNUNET_PQ_Context *db, const struct GNUNET_PQ_PreparedStatement *ps)
Request creation of prepared statements ps from Postgres.
struct GNUNET_PQ_PreparedStatement GNUNET_PQ_make_prepare(const char *name, const char *sql)
Create a struct GNUNET_PQ_PreparedStatement.
Handle to Postgres database.
PGconn * conn
Actual connection.
Information needed to prepare a list of SQL statements using GNUNET_PQ_prepare_statements().
const char * sql
Actual SQL statement.