3.3. Connection Infrastructure

3.3.1. dbi_conn_new

dbi_conn dbi_conn_new(const char *name)

Creates a connection instance of the driver specified by "name". This is a shortcut for calling dbi_driver_open() and passing the result to dbi_conn_open().

3.3.2. dbi_conn_open

dbi_conn dbi_conn_open(dbi_driver Driver)

Creates a connection instance of the specified driver. This connection can be used to perform queries and set options.

3.3.3. dbi_conn_get_driver

dbi_driver dbi_conn_get_driver(dbi_conn Conn)

Returns the driver type of the specified connection.

3.3.4. dbi_conn_set_option

int dbi_conn_set_option(dbi_conn Conn, const char *key, char *value)

Sets a specified connection option to a string value.

3.3.5. dbi_conn_set_option_numeric

int dbi_conn_set_option_numeric(dbi_conn Conn, const char *key, int value)

Sets a specified connection option to a numeric value.

3.3.6. dbi_conn_get_option

const char *dbi_conn_get_option(dbi_conn Conn, const char *key)

Retrieves the string value of the specified option set for a connection.

3.3.7. dbi_conn_get_option_numeric

int dbi_conn_get_option_numeric(dbi_conn Conn, const char *key)

Retrieves the integer value of the specified option set for a connection.

3.3.8. dbi_conn_get_option_list

const char *dbi_conn_get_option_list(dbi_conn Conn, const char *current)

Enumerates the list of available options for a connection. If current is NULL, the first available option will be returned. If current is a valid option name, the next available option will be returned.

3.3.9. dbi_conn_clear_option

void dbi_conn_clear_option(dbi_conn Conn, const char *key)

Removes the target option setting from a connection.

3.3.10. dbi_conn_clear_options

void dbi_conn_clear_options(dbi_conn Conn)

Removes all option settings from a connection.

3.3.11. dbi_conn_get_socket

int dbi_conn_get_socket(dbi_conn Conn)

Obtain the file descriptor number for the backend connection socket.

3.3.12. dbi_conn_close

void dbi_conn_close(dbi_conn Conn)

Disconnects the specified connection connection from the database and cleans up the connection session.

3.3.13. Error Handling