challenger_database_lib.h (1767B)
1 /* 2 This file is part of Challenger 3 Copyright (C) 2023 Taler Systems SA 4 5 Challenger is free software; you can redistribute it and/or modify it under the 6 terms of the GNU General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 Challenger is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 Challenger; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file include/challenger_database_lib.h 18 * @brief database helper functions for postgres used by challenger 19 * @author Christian Grothoff 20 */ 21 #ifndef CHALLENGER_DB_LIB_H 22 #define CHALLENGER_DB_LIB_H 23 24 #include <taler/taler_util.h> 25 26 struct CHALLENGERDB_PostgresContext; 27 28 /** 29 * Connect to the challenger database. 30 * 31 * @param cfg configuration to use 32 * @return NULL on failure 33 */ 34 struct CHALLENGERDB_PostgresContext * 35 CHALLENGERDB_connect ( 36 const struct GNUNET_CONFIGURATION_Handle *cfg); 37 38 39 /** 40 * Connect to the challenger database for administration. 41 * Disables the check that the database schema is current. 42 * 43 * @param cfg configuration to use 44 * @return NULL on failure 45 */ 46 struct CHALLENGERDB_PostgresContext * 47 CHALLENGERDB_connect_admin ( 48 const struct GNUNET_CONFIGURATION_Handle *cfg); 49 50 51 /** 52 * Disconnect from the challenger database. 53 * 54 * @param[in] pg context to disconnect and free 55 */ 56 void 57 CHALLENGERDB_disconnect (struct CHALLENGERDB_PostgresContext *pg); 58 59 60 #endif /* CHALLENGER_DB_LIB_H */ 61 62 /* end of challenger_database_lib.h */