From 8a906bf96c9c418dbd58727284eb5cfdd6fdff24 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Sat, 5 Mar 2022 13:36:50 +0100 Subject: sync tables "extensions" and "extension_details" with auditor --- src/exchangedb/irbt_callbacks.c | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'src/exchangedb/irbt_callbacks.c') diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c index 012f8df26..deab3cfca 100644 --- a/src/exchangedb/irbt_callbacks.c +++ b/src/exchangedb/irbt_callbacks.c @@ -702,4 +702,55 @@ irbt_cb_table_recoup_refresh (struct PostgresClosure *pg, } +/** + * Function called with extensions records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_extensions (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_string (td->details.extensions.name), + NULL == td->details.extensions.config ? + GNUNET_PQ_query_param_null () : + GNUNET_PQ_query_param_string (td->details.extensions.config), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_extensions", + params); +} + + +/** + * Function called with extension_details records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_extension_details (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + NULL == + td->details.extension_details.extension_options ? + GNUNET_PQ_query_param_null () : + GNUNET_PQ_query_param_string ( + td->details.extension_details.extension_options), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_extension_details", + params); +} + + /* end of irbt_callbacks.c */ -- cgit v1.2.3