diff options
Diffstat (limited to 'src/stasis/plugin_anastasis_postgres.c')
-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 " |