46 for (
unsigned int i = 0; NULL !=
ps[i].name; i++)
52 "Preparing SQL statement `%s' as `%s'\n",
55 ret = PQprepare (
db->conn,
60 if (PGRES_COMMAND_OK != PQresultStatus (
ret))
64 "PQprepare (`%s' as `%s') failed with error: %s\n",
67 PQerrorMessage (
db->conn));
69 ret = PQdescribePrepared (
db->conn,
71 if (PGRES_COMMAND_OK != PQresultStatus (
ret))
78 "Statement `%s' already known. Ignoring the issue in the hope that you are using connection pooling...\n",
94 unsigned int nlen = 0;
98 while (NULL !=
ps[nlen].
name)
100 xlen = nlen +
db->ps_off;
101 if (xlen >
db->ps_len)
114 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_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#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_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.
Information needed to prepare a list of SQL statements using GNUNET_PQ_prepare_statements().
const char * sql
Actual SQL statement.