diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-12-30 14:41:16 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-12-30 14:41:16 +0100 |
commit | 94fbb1c211a8c3d8d43c76d91f369de1c0a4615f (patch) | |
tree | 7af8c5404ad9df8c112c53b5bc46b6c45d0c34d2 /src/exchangedb/pg_insert_aml_officer.c | |
parent | c002f458ce3d532b633d345427e713a81239e108 (diff) | |
download | exchange-94fbb1c211a8c3d8d43c76d91f369de1c0a4615f.tar.xz |
-basic insert logic of new DB API
Diffstat (limited to 'src/exchangedb/pg_insert_aml_officer.c')
-rw-r--r-- | src/exchangedb/pg_insert_aml_officer.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/exchangedb/pg_insert_aml_officer.c b/src/exchangedb/pg_insert_aml_officer.c index 89b7ffae1..fc2cadef2 100644 --- a/src/exchangedb/pg_insert_aml_officer.c +++ b/src/exchangedb/pg_insert_aml_officer.c @@ -36,6 +36,29 @@ TEH_PG_insert_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_absolute_time (&last_change), + GNUNET_PQ_query_param_end + }; + + PREPARE (pg, + "insert_aml_staff", + "INSERT INTO aml_staff " + "(decider_pub" + ",master_sig" + ",decider_name" + ",is_active" + ",read_only" + ",last_change" + ") VALUES " + "($1, $2, $3, $4, $5, $6);"); + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_aml_staff", + params); } |