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_kyc_attributes.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/exchangedb/pg_update_kyc_attributes.c') diff --git a/src/exchangedb/pg_update_kyc_attributes.c b/src/exchangedb/pg_update_kyc_attributes.c index 8f0c6fd3..f77eb2bf 100644 --- a/src/exchangedb/pg_update_kyc_attributes.c +++ b/src/exchangedb/pg_update_kyc_attributes.c @@ -38,6 +38,31 @@ TEH_PG_update_kyc_attributes ( size_t enc_attributes_size, const void *enc_attributes) { - 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 (h_payto), + GNUNET_PQ_query_param_auto_from_type (kyc_prox), + GNUNET_PQ_query_param_string (provider_section), + (NULL == birthdate) + ? GNUNET_PQ_query_param_null () + : GNUNET_PQ_query_param_string (birthdate), + GNUNET_PQ_query_param_timestamp (&collection_time), + GNUNET_PQ_query_param_timestamp (&expiration_time), + GNUNET_PQ_query_param_fixed_size (enc_attributes, + enc_attributes_size), + GNUNET_PQ_query_param_end + }; + + PREPARE (pg, + "update_kyc_attributes", + "UPDATE kyc_attributes SET " + " kyc_prox=$2" + ",birthdate=$4" + ",collection_time=$5" + ",expiration_time=$6" + ",encrypted_attributes=$7" + " WHERE h_payto=$1 AND provider_section=$3;"); + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "update_kyc_attributes", + params); } -- cgit v1.2.3