diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-11-02 17:51:42 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-11-02 17:51:42 +0100 |
commit | a51517f64c83c23545ebd8a935baa311f0de635a (patch) | |
tree | 8431dcad0c9aa743468b551828be021a1378f4a6 /src/auditordb/pg_insert_purse_info.c | |
parent | 5c0b8e32406a7e000396003e9428a1cf9af3e919 (diff) | |
download | exchange-a51517f64c83c23545ebd8a935baa311f0de635a.tar.xz |
-implement missing functions
Diffstat (limited to 'src/auditordb/pg_insert_purse_info.c')
-rw-r--r-- | src/auditordb/pg_insert_purse_info.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/auditordb/pg_insert_purse_info.c b/src/auditordb/pg_insert_purse_info.c index bec57c851..f82f9e1de 100644 --- a/src/auditordb/pg_insert_purse_info.c +++ b/src/auditordb/pg_insert_purse_info.c @@ -25,6 +25,7 @@ #include "pg_insert_purse_info.h" #include "pg_helper.h" + enum GNUNET_DB_QueryStatus TAH_PG_insert_purse_info ( void *cls, @@ -33,4 +34,25 @@ TAH_PG_insert_purse_info ( const struct TALER_Amount *balance, struct GNUNET_TIME_Timestamp expiration_date) { + struct PostgresClosure *pg = cls; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_auto_from_type (purse_pub), + GNUNET_PQ_query_param_auto_from_type (master_pub), + TALER_PQ_query_param_amount (balance), + GNUNET_PQ_query_param_timestamp (&expiration_date), + GNUNET_PQ_query_param_end + }; + + PREPARE (pg, + "auditor_purses_insert", + "INSERT INTO auditor_purses " + "(purse_pub" + ",master_pub" + ",target_val" + ",target_frac" + ",expiration_date" + ") VALUES ($1,$2,$3,$4,$5);"); + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "auditor_purses_insert", + params); } |