Database Independent Abstraction Layer for C: libdbi Driver Author's Guide (OUTDATED SEE README!) | ||
---|---|---|
Prev | Chapter 2. Driver Functions | Next |
int dbd_fetch_row(dbi_result_t *result, unsigned int rownum) |
Fetches the target row, retrieving one-time field information if necessary. Also see the _dbd_row_allocate and _dbd_row_finalize helper functions.
result: The target result object.
rownum: The row number to fetch.
0 on error, 1 on successful fetch.
int dbd_free_query(dbi_result_t *result) |
Frees the target result handle.
result: The target result handle.
0 on success (this should be changed)
int dbd_goto_row(dbi_result_t *result, unsigned int row) |
Jumps to the specifed row in the result set.
result: The target result handle.
row: The target row number.
1 on success, 0 on error.
dbi_result_t *dbd_list_dbs(dbi_conn_t *conn) |
Performs a query that retrieves the list of databases, with the database name as the first column in the result set.
conn: The target connection.
A DBI result object.
dbi_result_t *dbd_list_tables(dbi_conn_t *conn, const char *db) |
Performs a query that retrieves the list of tables in the specified database, with the table name as the first column in the result set.
conn: The target connection.
db: The name of the database where tables should be looked for.
A DBI result object.
dbi_result_t *dbd_query(dbi_conn_t *conn, const char *statement) |
Performs a query and keeps track of meta-information about the query. Also see the _dbd_result_create helper function.
conn: The target connection.
statement: The query string to execute.
A DBI result object, or NULL on error.
char *dbd_select_db(dbi_conn_t *conn, const char *db) |
Selects a new database on the server.
conn: The target connection.
db: The name of the database to switch to.
The database name on success, "" on error, or NULL if the operation is not supported by the database server.