40 unsigned int num_args)
45 .num_arguments = num_args
68 unsigned int olen = 0;
69 unsigned int nlen = 0;
73 while (NULL !=
db->ps[olen].name)
75 while (NULL != ps[nlen].
name)
91 for (
unsigned int i = 0; NULL != ps[i].
name; i++)
97 "Preparing SQL statement `%s' as `%s'\n",
100 ret = PQprepare (
db->conn,
105 if (PGRES_COMMAND_OK != PQresultStatus (
ret))
109 "PQprepare (`%s' as `%s') failed with error: %s\n",
112 PQerrorMessage (
db->conn));
114 ret = PQdescribePrepared (
db->conn,
116 if (PGRES_COMMAND_OK != PQresultStatus (
ret))
123 "Statement `%s' already known. Ignoring the issue in the hope that you are using connection pooling...\n",
static int ret
Return value of the commandline.
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
struct GNUNET_PQ_PreparedStatement GNUNET_PQ_make_prepare(const char *name, const char *sql, unsigned int num_args)
Create a struct GNUNET_PQ_PreparedStatement.
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.
Handle to Postgres database.
Information needed to prepare a list of SQL statements using GNUNET_PQ_prepare_statements().
const char * name
Name of the statement.
const char * sql
Actual SQL statement.