From 94fbb1c211a8c3d8d43c76d91f369de1c0a4615f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 30 Dec 2022 14:41:16 +0100 Subject: -basic insert logic of new DB API --- src/exchangedb/pg_update_aml_officer.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/exchangedb/pg_update_aml_officer.c') diff --git a/src/exchangedb/pg_update_aml_officer.c b/src/exchangedb/pg_update_aml_officer.c index aca58f0c..f756e6e2 100644 --- a/src/exchangedb/pg_update_aml_officer.c +++ b/src/exchangedb/pg_update_aml_officer.c @@ -36,6 +36,27 @@ TEH_PG_update_aml_officer ( bool read_only, struct GNUNET_TIME_Absolute last_change) { - GNUNET_break (0); // FIXME: not implemeted! - return GNUNET_DB_STATUS_HARD_ERROR; + struct PostgresClosure *pg = cls; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_auto_from_type (decider_pub), + GNUNET_PQ_query_param_auto_from_type (master_sig), + GNUNET_PQ_query_param_string (decider_name), + GNUNET_PQ_query_param_bool (is_active), + GNUNET_PQ_query_param_bool (read_only), + GNUNET_PQ_query_param_timestamp (&last_change), + GNUNET_PQ_query_param_end + }; + + PREPARE (pg, + "update_aml_staff", + "UPDATE aml_staff SET " + " master_sig=$2" + ",decider_name=$3" + ",is_active=$4" + ",read_only=$5" + ",last_change=$6" + " WHERE decider_pub=$1 AND last_change < $6;"); + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "update_aml_staff", + params); } -- cgit v1.2.3