Database Independent Abstraction Layer for C: libdbi Programmer's Guide | ||
---|---|---|
Prev | Chapter 7. libdbi API Reference | Next |
Connects to the database using the options (host, username, password, port, (etc.) set with dbi_conn_set_option and related functions. See the documentation for each specific database driver for the options it recognizes and requires.
Conn: The target connection.
0 (zero) on success, less than zero on failure. In the latter case, the error number may be DBI_ERROR_NOMEM, DBI_ERROR_NOCONN, or one of the driver-specific values.
Queries the list of available databases on the server.
Conn: The target connection.
pattern: A string pattern (SQL regular expression) that each name must match, or NULL to show all available databases.
A query result object, which will contain database names in the first field (for use with the by-index field functions). In case of an error, the function returns NULL and sets the error number to a database engine-specific nonzero value.
Queries the list of available tables in a particular database.
Conn: The target connection.
db: The target database name.
pattern: A string pattern (SQL regular expression) that each name must match, or NULL to show all available tables.
A query result object, which will contain table names in the first field (for use with the by-index field functions). In case of an error, the function returns NULL and sets the error number to a database engine-specific nonzero value.
Switches to a different database on the server.
Conn: The target connection.
db: The target database name.
-1 on failure, zero on success. In case of an error, the error number may be DBI_ERROR_UNSUPPORTED or a database engine-specific nonzero value.