]>
Commit | Line | Data |
---|---|---|
e43481af CP |
1 | #ifndef __PQSQL_DB_H |
2 | #define __PQSQL_DB_H | |
3 | ||
4 | #include <libpq-fe.h> | |
5 | ||
67545367 | 6 | #define QH_CREATE 0x01 |
47d8702b | 7 | #define PQ_ERRORMSG_LENGTH 1024 |
67545367 | 8 | |
e43481af CP |
9 | typedef void (*PQQueryHandler)(PGconn *, void *); |
10 | ||
67545367 | 11 | void pqasyncqueryf(PQQueryHandler handler, void *tag, int flags, char *format, ...); |
c5373bb8 | 12 | void pqloadtable(char *tablename, PQQueryHandler init, PQQueryHandler data, PQQueryHandler fini); |
67545367 | 13 | |
87aeb91e CP |
14 | #define pqasyncquery(handler, tag, format, ...) pqasyncqueryf(handler, tag, 0, format , ##__VA_ARGS__) |
15 | #define pqcreatequery(format, ...) pqasyncqueryf(NULL, NULL, QH_CREATE, format , ##__VA_ARGS__) | |
f3a0d096 | 16 | #define pqquery(format, ...) pqasyncqueryf(NULL, NULL, 0, format , ##__VA_ARGS__) |
67545367 | 17 | |
e43481af | 18 | int pqconnected(void); |
47d8702b | 19 | char* pqlasterror(PGconn * pgconn); |
e43481af CP |
20 | |
21 | #endif |