From 033a5dc93b032a1f1fe6ab1e7d1227b69f0f0c69 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 30 Jul 2022 10:29:24 +0200 Subject: implement taler-auditor-sync support for profit_drains table (#4960) --- src/exchangedb/irbt_callbacks.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/exchangedb/irbt_callbacks.c') diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c index 250b167ef..bff71cf42 100644 --- a/src/exchangedb/irbt_callbacks.c +++ b/src/exchangedb/irbt_callbacks.c @@ -1131,4 +1131,37 @@ irbt_cb_table_wads_in_entries (struct PostgresClosure *pg, } +/** + * Function called with profit_drains records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_profit_drains (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_auto_from_type ( + &td->details.profit_drains.wtid), + GNUNET_PQ_query_param_string ( + td->details.profit_drains.account_section), + GNUNET_PQ_query_param_string ( + td->details.profit_drains.payto_uri), + GNUNET_PQ_query_param_timestamp ( + &td->details.profit_drains.trigger_date), + TALER_PQ_query_param_amount ( + &td->details.profit_drains.amount), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.profit_drains.master_sig), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_profit_drains", + params); +} + + /* end of irbt_callbacks.c */ -- cgit v1.2.3