#define DB_NULLIDENTIFIER 0
#define DB_CREATE 1
+#define DB_CALL 2
#ifdef DBAPI_OVERRIDE
#undef USE_DBAPI_PGSQL
#define dbloadtable_tag(tablename, init, data, fini, tag) pqloadtable(tablename, init, data, fini, tag);
#define dbasyncqueryf(id, handler, tag, flags, format, ...) pqasyncqueryf(id, handler, tag, flags, format , ##__VA_ARGS__)
-#define dbasyncqueryfv(id, handler, tag, flags, format, ap) pqasyncqueryfv(id, handler, tag, flags, format, ap)
#define dbquerysuccessful(x) pqquerysuccessful(x)
#define dbgetresult(conn) pqgetresult(conn)
#define dbnumfields(x) PQnfields(x->result)
+#define dbnumaffected(c, x) strtoul(PQcmdTuples(x->result), NULL, 10)
#define dbfetchrow(result) pqfetchrow(result)
#define dbgetvalue(result, column) pqgetvalue(result, column)
#define dbclear(result) pqclear(result)
+#define dbcall(id, handler, tag, function, ...) pqasyncqueryf(id, handler, tag, (handler) == NULL ? DB_CALL : 0, "SELECT %s(%s)", function , ##__VA_ARGS__)
#endif /* DBAPI_PGSQL */
#define dbloadtable_tag(tablename, init, data, fini, tag) sqliteloadtable(tablename, init, data, fini, tag);
#define dbasyncqueryf(id, handler, tag, flags, format, ...) sqliteasyncqueryf(id, handler, tag, flags, format , ##__VA_ARGS__)
-#define dbasyncqueryfv(id, handler, tag, flags, format, ap) sqliteasyncqueryfv(id, handler, tag, flags, format, ap)
#define dbquerysuccessful(x) sqlitequerysuccessful(x)
#define dbgetresult(conn) sqlitegetresult(conn)
#define dbnumfields(x) sqlite3_column_count(x->r)
+#define dbnumaffected(c, x) sqlite3_changes(sqlitegetconn())
#define dbfetchrow(result) sqlitefetchrow(result)
#define dbgetvalue(result, column) sqlitegetvalue(result, column)
#define dbclear(result) sqliteclear(result)
+#define dbcall(...) abort() /* HA */
+
#endif /* DBAPI_SQLITE */
#endif /* BUILDING_DBAPI */