Database Independent Abstraction Layer for C: libdbi Driver Author's Guide (OUTDATED SEE README!) | ||
---|---|---|
Prev | Chapter 2. Driver Functions | Next |
dbi_result_t *_dbd_result_create(dbi_conn_t *conn, void *handle, unsigned int numrows_matched, unsigned int numrows_affected) |
Allocates a new dbi_result_t, filling the number of rows matched and affected, storing the database-specific result handle, and allocating room for rows to be stored.
conn: The target connection.
handle: The database-specific result handle used internally by the driver.
numrows_matched: The number of rows matched by the query.
numrows_affected: The number of rows affected by the query.
A new DBI result object.
void _dbd_result_set_numfields(dbi_result_t *result, unsigned int numfields) |
Sets a result's number of fields and allocates room for field information to be stored.
result: The target result.
numfields: The number of fields in the result set.
void _dbd_result_add_field(dbi_result_t *result, unsigned int idx, char *name, unsigned short type, unsigned int attribs) |
Stores information about the target field into the result set.
result: The target result.
idx: The numeric field index.
name: The name of the field.
type: The datatype of the field.
attribs: The attributes of the field.
dbi_row_t *_dbd_row_allocate(unsigned int numfields) |
Allocates a new row, ready to be filled with data.
numfields: The number of fields in the result set.
A new DBI row, or NULL on error.
void _dbd_row_finalize(dbi_result_t *result, dbi_row_t *row, unsigned int idx) |
Associates and stores the row with the result set, once the row's data has been filled.
result: The target result set.
row: The target row object.
idx: The index of the row.
void _dbd_internal_error_handler(dbi_conn_t *conn, const char *errmsg, const int errno) |
Saves error message information generated by libdbi (rather than by the database or its API). If an old error message string exists, it will be freed.
conn: The target connection.
errmsg: The error message to store. This will be stdup'd by libdbi so it has its own copy.
errno: The error number to store.