From dc81d01304e3cf93c4ae86ab8c11fa778aff583f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 30 Jul 2023 17:20:20 +0200 Subject: add missing prepared statements --- src/exchangedb/pg_add_policy_fulfillment_proof.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/exchangedb') diff --git a/src/exchangedb/pg_add_policy_fulfillment_proof.c b/src/exchangedb/pg_add_policy_fulfillment_proof.c index 2e83b5742..0fd6b1c92 100644 --- a/src/exchangedb/pg_add_policy_fulfillment_proof.c +++ b/src/exchangedb/pg_add_policy_fulfillment_proof.c @@ -94,7 +94,15 @@ TEH_PG_add_policy_fulfillment_proof ( GNUNET_PQ_result_spec_end }; - // FIXME: where do we prepare this statement!?? + PREPARE (pg, + "insert_proof_into_policy_fulfillments", + "INSERT INTO policy_fulfillments" + "(fulfillment_timestamp" + ",fulfillment_proof" + ",h_fulfillment_proof" + ",policy_hash_codes" + ") VALUES ($1, $2, $3, $4)" + " ON CONFLICT DO NOTHING;"); qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn, "insert_proof_into_policy_fulfillments", params, @@ -124,7 +132,17 @@ TEH_PG_add_policy_fulfillment_proof ( GNUNET_PQ_query_param_end }; - // FIXME: where do we prepare this statement!?? + // FIXME-Oec: review if this is the intended logic here! + PREPARE (pg, + "update_policy_details", + "UPDATE policy_details SET" + " deadline=$2" + ",commitment=$3" + ",accumulated_total=$4" + ",fee=$5" + ",transferable=$6" + ",fulfillment_state=$7" + " WHERE policy_hash_code=$1;"); qs = GNUNET_PQ_eval_prepared_non_select (pg->conn, "update_policy_details", params); -- cgit v1.2.3