aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_insert_aml_decision.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-12-30 14:41:16 +0100
committerChristian Grothoff <christian@grothoff.org>2022-12-30 14:41:16 +0100
commit94fbb1c211a8c3d8d43c76d91f369de1c0a4615f (patch)
tree7af8c5404ad9df8c112c53b5bc46b6c45d0c34d2 /src/exchangedb/pg_insert_aml_decision.c
parentc002f458ce3d532b633d345427e713a81239e108 (diff)
downloadexchange-94fbb1c211a8c3d8d43c76d91f369de1c0a4615f.tar.xz
-basic insert logic of new DB API
Diffstat (limited to 'src/exchangedb/pg_insert_aml_decision.c')
-rw-r--r--src/exchangedb/pg_insert_aml_decision.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/exchangedb/pg_insert_aml_decision.c b/src/exchangedb/pg_insert_aml_decision.c
index 25ad4c56c..94f30275a 100644
--- a/src/exchangedb/pg_insert_aml_decision.c
+++ b/src/exchangedb/pg_insert_aml_decision.c
@@ -37,6 +37,33 @@ TEH_PG_insert_aml_decision (
const struct TALER_AmlOfficerPublicKeyP *decider_pub,
const struct TALER_AmlOfficerSignatureP *decider_sig)
{
- GNUNET_break (0); // FIXME: not implemeted!
- return GNUNET_DB_STATUS_HARD_ERROR;
+ struct PostgresClosure *pg = cls;
+ uint32_t ns = (uint32_t) new_status;
+ struct GNUNET_PQ_QueryParam params[] = {
+ GNUNET_PQ_query_param_auto_from_type (h_payto),
+ TALER_PQ_query_param_amount (new_threshold),
+ GNUNET_PQ_query_param_uint32 (&ns),
+ GNUNET_PQ_query_param_timestamp (&decision_time),
+ GNUNET_PQ_query_param_string (justification),
+ GNUNET_PQ_query_param_auto_from_type (decider_pub),
+ GNUNET_PQ_query_param_auto_from_type (decider_sig),
+ GNUNET_PQ_query_param_end
+ };
+
+ PREPARE (pg,
+ "insert_aml_decision",
+ "INSERT INTO aml_history "
+ "(h_payto"
+ ",new_threshold_val"
+ ",new_threshold_frac"
+ ",new_status"
+ ",decision_time"
+ ",justification"
+ ",decider_pub"
+ ",decider_sig"
+ ") VALUES "
+ "($1, $2, $3, $4, $5, $6, $7, $8);");
+ return GNUNET_PQ_eval_prepared_non_select (pg->conn,
+ "insert_aml_decision",
+ params);
}