diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-01-17 02:26:21 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-01-17 02:26:21 +0100 |
commit | 4353432b97bdc03ce31f11dfd1ff3e30cf0106af (patch) | |
tree | f6d92c64b324e30065051259b73e23e12f4c533f /src/include | |
parent | 1126181ab98fd7e9e6cca0786939020b161fcb94 (diff) | |
download | gnunet-4353432b97bdc03ce31f11dfd1ff3e30cf0106af.tar.gz gnunet-4353432b97bdc03ce31f11dfd1ff3e30cf0106af.zip |
DB load API change
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_disk_lib.h | 1 | ||||
-rw-r--r-- | src/include/gnunet_os_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_pq_lib.h | 22 |
3 files changed, 16 insertions, 9 deletions
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index 9376a1059..b79be5f70 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -413,7 +413,6 @@ GNUNET_DISK_pipe (int blocking_read, | |||
413 | * @param blocking_read creates an asynchronous pipe for reading if set to #GNUNET_NO | 413 | * @param blocking_read creates an asynchronous pipe for reading if set to #GNUNET_NO |
414 | * @param blocking_write creates an asynchronous pipe for writing if set to #GNUNET_NO | 414 | * @param blocking_write creates an asynchronous pipe for writing if set to #GNUNET_NO |
415 | * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes | 415 | * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes |
416 | * | ||
417 | * @return handle to the new pipe, NULL on error | 416 | * @return handle to the new pipe, NULL on error |
418 | */ | 417 | */ |
419 | struct GNUNET_DISK_PipeHandle * | 418 | struct GNUNET_DISK_PipeHandle * |
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index 50e9a4c92..a6188c1ca 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -597,7 +597,7 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, | |||
597 | 597 | ||
598 | 598 | ||
599 | /** | 599 | /** |
600 | * Retrieve the status of a process, waiting on it if dead. | 600 | * Retrieve the status of a process. |
601 | * Nonblocking version. | 601 | * Nonblocking version. |
602 | * | 602 | * |
603 | * @param proc pointer to process structure | 603 | * @param proc pointer to process structure |
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h index 2aea77b7f..8b32a9265 100644 --- a/src/include/gnunet_pq_lib.h +++ b/src/include/gnunet_pq_lib.h | |||
@@ -708,15 +708,22 @@ GNUNET_PQ_exec_statements (struct GNUNET_PQ_Context *db, | |||
708 | 708 | ||
709 | 709 | ||
710 | /** | 710 | /** |
711 | * Create a connection to the Postgres database using @a config_str | 711 | * Create a connection to the Postgres database using @a config_str for the |
712 | * for the configuration. Initialize logging via GNUnet's log | 712 | * configuration. Initialize logging via GNUnet's log routines and disable |
713 | * routines and disable Postgres's logger. Also ensures that the | 713 | * Postgres's logger. Also ensures that the statements in @a load_path and @a |
714 | * statements in @a es are executed whenever we (re)connect to the | 714 | * es are executed whenever we (re)connect to the database, and that the |
715 | * database, and that the prepared statements in @a ps are "ready". | 715 | * prepared statements in @a ps are "ready". If statements in @es fail that |
716 | * If statements in @es fail that were created with | 716 | * were created with #GNUNET_PQ_make_execute(), then the entire operation |
717 | * #GNUNET_PQ_make_execute(), then the entire operation fails. | 717 | * fails. |
718 | * | ||
719 | * In @a load_path, a list of "$XXXX.sql" files is expected where $XXXX | ||
720 | * must be a sequence of contiguous integer values starting at 0000. | ||
721 | * These files are then loaded in sequence using "psql $config_str" before | ||
722 | * running statements from @e es. The directory is inspected again on | ||
723 | * reconnect. | ||
718 | * | 724 | * |
719 | * @param config_str configuration to use | 725 | * @param config_str configuration to use |
726 | * @param load_path path to directory with SQL transactions to run, can be NULL | ||
720 | * @param es #GNUNET_PQ_PREPARED_STATEMENT_END-terminated | 727 | * @param es #GNUNET_PQ_PREPARED_STATEMENT_END-terminated |
721 | * array of statements to execute upon EACH connection, can be NULL | 728 | * array of statements to execute upon EACH connection, can be NULL |
722 | * @param ps array of prepared statements to prepare, can be NULL | 729 | * @param ps array of prepared statements to prepare, can be NULL |
@@ -724,6 +731,7 @@ GNUNET_PQ_exec_statements (struct GNUNET_PQ_Context *db, | |||
724 | */ | 731 | */ |
725 | struct GNUNET_PQ_Context * | 732 | struct GNUNET_PQ_Context * |
726 | GNUNET_PQ_connect (const char *config_str, | 733 | GNUNET_PQ_connect (const char *config_str, |
734 | const char *load_path, | ||
727 | const struct GNUNET_PQ_ExecuteStatement *es, | 735 | const struct GNUNET_PQ_ExecuteStatement *es, |
728 | const struct GNUNET_PQ_PreparedStatement *ps); | 736 | const struct GNUNET_PQ_PreparedStatement *ps); |
729 | 737 | ||