diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-01-19 10:40:11 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-01-19 10:40:11 +0100 |
commit | fbf87011b5129a44e2494758effc7bd6716d6d3b (patch) | |
tree | 0cd208dbe833d4eee7b2babea394fe9b84318706 /src/stasis | |
parent | 1ccd17d515d43b524dc06e3a4d206f19f873d0dd (diff) | |
download | anastasis-fbf87011b5129a44e2494758effc7bd6716d6d3b.tar.gz anastasis-fbf87011b5129a44e2494758effc7bd6716d6d3b.tar.bz2 anastasis-fbf87011b5129a44e2494758effc7bd6716d6d3b.zip |
-first rough implementation of meta handler
Diffstat (limited to 'src/stasis')
-rw-r--r-- | src/stasis/plugin_anastasis_postgres.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c index 801552d..ef13c6c 100644 --- a/src/stasis/plugin_anastasis_postgres.c +++ b/src/stasis/plugin_anastasis_postgres.c @@ -343,8 +343,18 @@ prepare_statements (void *cls) ",encrypted_truth" ",truth_mime" " FROM anastasis_truth" - " WHERE truth_uuid =$1;", + " WHERE truth_uuid=$1;", 1), + GNUNET_PQ_make_prepare ("recoverydocument_select_meta", + "SELECT " + " version" + ",recovery_meta_data" + " FROM anastasis_recoverydocument" + " WHERE user_id=$1" + " AND version < $2" + " ORDER BY version DESC" + " LIMIT 1000;", + 2), GNUNET_PQ_make_prepare ("latest_recoverydocument_select", "SELECT " " version" @@ -352,7 +362,7 @@ prepare_statements (void *cls) ",recovery_data_hash" ",recovery_data" " FROM anastasis_recoverydocument" - " WHERE user_id =$1 " + " WHERE user_id=$1" " ORDER BY version DESC" " LIMIT 1;", 1), @@ -384,12 +394,12 @@ prepare_statements (void *cls) " AND payment_identifier=$2;", 2), GNUNET_PQ_make_prepare ("postcounter_update", - "UPDATE " - "anastasis_recdoc_payment " - "SET " - "post_counter=$1 " - "WHERE user_id =$2 " - "AND payment_identifier=$3;", + "UPDATE" + " anastasis_recdoc_payment" + " SET" + " post_counter=$1" + " WHERE user_id =$2" + " AND payment_identifier=$3;", 3), GNUNET_PQ_make_prepare ("key_share_select", "SELECT " |