diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2022-07-24 11:32:21 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2022-07-24 11:32:21 +0200 |
commit | 233ec61118e6dad85c1eb9199f4e74daf65338f2 (patch) | |
tree | 69b57e71020f33eb63a726d0831597b5e7d00499 /src/include/gnunet_pq_lib.h | |
parent | 6f88c10084ec4966410d555cdfc90eb8607031eb (diff) | |
download | gnunet-233ec61118e6dad85c1eb9199f4e74daf65338f2.tar.gz gnunet-233ec61118e6dad85c1eb9199f4e74daf65338f2.zip |
enable non-numbered sql statement execution
Diffstat (limited to 'src/include/gnunet_pq_lib.h')
-rw-r--r-- | src/include/gnunet_pq_lib.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 | */ | ||
932 | enum GNUNET_GenericReturnValue | ||
933 | GNUNET_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, | |||
945 | struct GNUNET_PQ_Context * | 961 | struct GNUNET_PQ_Context * |
946 | GNUNET_PQ_connect2 (const char *config_str, | 962 | GNUNET_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); |