aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-07-24 11:32:21 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-07-24 11:32:21 +0200
commit233ec61118e6dad85c1eb9199f4e74daf65338f2 (patch)
tree69b57e71020f33eb63a726d0831597b5e7d00499 /src/include
parent6f88c10084ec4966410d555cdfc90eb8607031eb (diff)
downloadgnunet-233ec61118e6dad85c1eb9199f4e74daf65338f2.tar.gz
gnunet-233ec61118e6dad85c1eb9199f4e74daf65338f2.zip
enable non-numbered sql statement execution
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_configuration_lib.h9
-rw-r--r--src/include/gnunet_pq_lib.h17
2 files changed, 21 insertions, 5 deletions
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index 570546b68..3384c6d45 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -317,11 +317,10 @@ GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
317 * @param iter_cls closure for @a iter 317 * @param iter_cls closure for @a iter
318 */ 318 */
319void 319void
320GNUNET_CONFIGURATION_iterate_sections (const struct 320GNUNET_CONFIGURATION_iterate_sections (
321 GNUNET_CONFIGURATION_Handle *cfg, 321 const struct GNUNET_CONFIGURATION_Handle *cfg,
322 GNUNET_CONFIGURATION_Section_Iterator 322 GNUNET_CONFIGURATION_Section_Iterator iter,
323 iter, 323 void *iter_cls);
324 void *iter_cls);
325 324
326 325
327/** 326/**
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h
index f7bf59212..2263704aa 100644
--- a/src/include/gnunet_pq_lib.h
+++ b/src/include/gnunet_pq_lib.h
@@ -920,6 +920,21 @@ GNUNET_PQ_connect (const char *config_str,
920 920
921 921
922/** 922/**
923 * Execute SQL statements from @a buf against @a db.
924 * The given filename infix in @a buf is prefixed with
925 * the "load_path" and ".sql" is appended to construct
926 * the full filename.
927 *
928 * @param db database context to use
929 * @param buf filename infix (!) with the SQL code to run
930 * @return #GNUNET_OK on success, #GNUNET_NO if patch @a buf does not exist, #GNUNET_SYSERR on error
931 */
932enum GNUNET_GenericReturnValue
933GNUNET_PQ_exec_sql (struct GNUNET_PQ_Context *db,
934 const char *buf);
935
936
937/**
923 * Create a connection to the Postgres database using @a config_str for the 938 * Create a connection to the Postgres database using @a config_str for the
924 * configuration. Initialize logging via GNUnet's log routines and disable 939 * configuration. Initialize logging via GNUnet's log routines and disable
925 * Postgres's logger. Also ensures that the statements in @a load_path and @a 940 * Postgres's logger. Also ensures that the statements in @a load_path and @a
@@ -936,6 +951,7 @@ GNUNET_PQ_connect (const char *config_str,
936 * 951 *
937 * @param config_str configuration to use 952 * @param config_str configuration to use
938 * @param load_path path to directory with SQL transactions to run, can be NULL 953 * @param load_path path to directory with SQL transactions to run, can be NULL
954 * @param auto_suffix infix of SQL series to run on every reconnect; runs multiple (!) files, of the form auto_suffix-XXXX where XXXX is from 0 to 9999 (consequtive).
939 * @param es #GNUNET_PQ_PREPARED_STATEMENT_END-terminated 955 * @param es #GNUNET_PQ_PREPARED_STATEMENT_END-terminated
940 * array of statements to execute upon EACH connection, can be NULL 956 * array of statements to execute upon EACH connection, can be NULL
941 * @param ps array of prepared statements to prepare, can be NULL 957 * @param ps array of prepared statements to prepare, can be NULL
@@ -945,6 +961,7 @@ GNUNET_PQ_connect (const char *config_str,
945struct GNUNET_PQ_Context * 961struct GNUNET_PQ_Context *
946GNUNET_PQ_connect2 (const char *config_str, 962GNUNET_PQ_connect2 (const char *config_str,
947 const char *load_path, 963 const char *load_path,
964 const char *auto_suffix,
948 const struct GNUNET_PQ_ExecuteStatement *es, 965 const struct GNUNET_PQ_ExecuteStatement *es,
949 const struct GNUNET_PQ_PreparedStatement *ps, 966 const struct GNUNET_PQ_PreparedStatement *ps,
950 enum GNUNET_PQ_Options flags); 967 enum GNUNET_PQ_Options flags);