sql-api.h revision 6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0
#ifndef __SQL_API_H
#define __SQL_API_H
/* This SQL API is designed to work asynchronously. The underlying drivers
however may not. */
struct sql_db;
struct sql_result;
/* Initialize database connections. db_driver is the database driver name,
eg. "mysql" or "pgsql". connect_string is driver-specific. */
/* Execute SQL query without waiting for results. */
/* Execute SQL query and return result in callback. */
/* Go to next row, returns 1 if ok, 0 if this was the last row or -1 if error
occured. This needs to be the first call for result. */
/* Return number of fields in result. */
/* Return name of the given field index. */
unsigned int idx);
/* Return field index for given name, or -1 if not found. */
/* Returns value of given field as string. */
unsigned int idx);
const char *field_name);
/* Return all values of current row. */
/* Return last error message in result. */
#endif