diff options
Diffstat (limited to 'src/include/taler_pq_lib.h')
-rw-r--r-- | src/include/taler_pq_lib.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h index 43561703b..051962b2b 100644 --- a/src/include/taler_pq_lib.h +++ b/src/include/taler_pq_lib.h @@ -19,16 +19,43 @@ * @author Sree Harsha Totakura <sreeharsha@totakura.in> * @author Florian Dold * @author Christian Grothoff + * @author Özgür Kesim */ #ifndef TALER_PQ_LIB_H_ #define TALER_PQ_LIB_H_ #include <libpq-fe.h> #include <jansson.h> +#include <gnunet/gnunet_common.h> #include <gnunet/gnunet_pq_lib.h> #include "taler_util.h" /** + * Enumerates the composite types that Taler defines in Postgres. + * The corresponding OIDs (which are assigned by postgres at time of + * declaration) are stored in TALER_PQ_CompositeOIDs. + */ +enum TALER_PQ_CompositeType +{ + TALER_PQ_CompositeAmount, + TALER_PQ_CompositeMAX /* MUST be last */ +}; + +/** + * The correspondence of the Composite types and their OID in Postgres + */ +extern Oid TALER_PQ_CompositeOIDs[TALER_PQ_CompositeMAX]; + +/** + * Initialize the list of OIDs in TALER_PQ_CompositeOIDs. MUST be called + * before any composite type is used in arrays-specs/-params. + * + * @return GNUNET_SYSERR on failure + */ +enum GNUNET_GenericReturnValue +TALER_PQ_load_oids_for_composite_types (struct GNUNET_PQ_Context *db); + +/** * Generate query parameter for a currency, consisting of the three * components "value", "fraction" and "currency" in this order. The * types must be a 64-bit integer, 32-bit integer and a |