From bc55152b0a60b9fa68e00971d07ee91bc7a63856 Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Thu, 5 Mar 2015 16:05:06 +0100 Subject: Move table creation logic to DB layer. Also support temporary schema creation for the sake of testing --- src/mint/mint_db.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/mint/mint_db.h') diff --git a/src/mint/mint_db.h b/src/mint/mint_db.h index a32cbd77..b6bc46e3 100644 --- a/src/mint/mint_db.h +++ b/src/mint/mint_db.h @@ -42,12 +42,32 @@ TALER_MINT_DB_init (const char *connection_cfg); * Get the thread-local database-handle. * Connect to the db if the connection does not exist yet. * + * @param temporary #GNUNET_YES to use a temporary schema; #GNUNET_NO to use the + * database default one * @param the database connection, or NULL on error */ PGconn * -TALER_MINT_DB_get_connection (void); +TALER_MINT_DB_get_connection (int temporary); +/** + * Drop the temporary taler schema. This is only useful for testcases + * + * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure + */ +int +TALER_MINT_DB_drop_temporary (PGconn *db); + + +/** + * Create the necessary tables if they are not present + * + * @param temporary should we use a temporary schema + * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure + */ +int +TALER_MINT_DB_create_tables (int temporary); + /** * Setup prepared statements. FIXME: should this be part of the API, * or just internal to "TALER_MINT_DB_get_connection()"? -- cgit v1.2.3