apr_dbd_init: perform once-only initialisation. Call once only.
- Parameters:
-
| pool | - pool to register any shutdown cleanups, etc |
apr_dbd_get_driver: get the driver struct for a name
- Parameters:
-
| pool | - (process) pool to register cleanup |
| name | - driver name |
| driver | - pointer to driver struct. |
- Returns:
- APR_SUCCESS for success
-
APR_ENOTIMPL for no driver (when DSO not enabled)
-
APR_EDSOOPEN if DSO driver file can't be opened
-
APR_ESYMNOTFOUND if the driver file doesn't contain a driver
apr_dbd_open_ex: open a connection to a backend
- Parameters:
-
| pool | - working pool |
| params | - arguments to driver (implementation-dependent) |
| handle | - pointer to handle to return |
| driver | - driver struct. |
| error | - descriptive error. |
- Returns:
- APR_SUCCESS for success
-
APR_EGENERAL if driver exists but connection failed
apr_dbd_open: open a connection to a backend
- Parameters:
-
| pool | - working pool |
| params | - arguments to driver (implementation-dependent) |
| handle | - pointer to handle to return |
| driver | - driver struct. |
- Returns:
- APR_SUCCESS for success
-
APR_EGENERAL if driver exists but connection failed
- See also:
- apr_dbd_open_ex
apr_dbd_close: close a connection to a backend
- Parameters:
-
| handle | - handle to close |
| driver | - driver struct. |
- Returns:
- APR_SUCCESS for success or error status
check_conn: check status of a database connection
- Parameters:
-
| driver | - the driver |
| pool | - working pool |
| handle | - the connection to check |
- Returns:
- APR_SUCCESS or error
apr_dbd_set_dbname: select database name. May be a no-op if not supported.
- Parameters:
-
| driver | - the driver |
| pool | - working pool |
| handle | - the connection |
| name | - the database to select |
- Returns:
- 0 for success or error code
apr_dbd_transaction_start: start a transaction. May be a no-op.
- Parameters:
-
| driver | - the driver |
| pool | - a pool to use for error messages (if any). |
| handle | - the db connection |
| trans | - ptr to a transaction. May be null on entry |
- Returns:
- 0 for success or error code
apr_dbd_transaction_end: end a transaction (commit on success, rollback on error). May be a no-op.
- Parameters:
-
| driver | - the driver |
| handle | - the db connection |
| trans | - the transaction. |
- Returns:
- 0 for success or error code
apr_dbd_transaction_mode_get: get the mode of transaction
- Parameters:
-
| driver | - the driver |
| trans | - the transaction |
- Returns:
- mode of transaction
apr_dbd_transaction_mode_set: set the mode of transaction
- Parameters:
-
| driver | - the driver |
| trans | - the transaction |
| mode | - new mode of the transaction |
- Returns:
- the mode of transaction in force after the call
apr_dbd_query: execute an SQL query that doesn't return a result set
- Parameters:
-
| driver | - the driver |
| handle | - the connection |
| nrows | - number of rows affected. |
| statement | - the SQL statement to execute |
- Returns:
- 0 for success or error code
apr_dbd_select: execute an SQL query that returns a result set
- Parameters:
-
| driver | - the driver |
| pool | - pool to allocate the result set |
| handle | - the connection |
| res | - pointer to result set pointer. May point to NULL on entry |
| statement | - the SQL statement to execute |
| random | - 1 to support random access to results (seek any row); 0 to support only looping through results in order (async access - faster) |
- Returns:
- 0 for success or error code
apr_dbd_num_cols: get the number of columns in a results set
- Parameters:
-
| driver | - the driver |
| res | - result set. |
- Returns:
- number of columns
apr_dbd_num_tuples: get the number of rows in a results set of a synchronous select
- Parameters:
-
| driver | - the driver |
| res | - result set. |
- Returns:
- number of rows, or -1 if the results are asynchronous
apr_dbd_get_row: get a row from a result set
- Parameters:
-
| driver | - the driver |
| pool | - pool to allocate the row |
| res | - result set pointer |
| row | - pointer to row pointer. May point to NULL on entry |
| rownum | - row number (counting from 1), or -1 for "next row". Ignored if random access is not supported. |
- Returns:
- 0 for success, -1 for rownum out of range or data finished
apr_dbd_prepare: prepare a statement
- Parameters:
-
| driver | - the driver |
| pool | - pool to alloc the result from |
| handle | - the connection |
| query | - the SQL query |
| label | - A label for the prepared statement. use NULL for temporary prepared statements (eg within a Request in httpd) |
| statement | - statement to prepare. May point to null on entry. |
- Returns:
- 0 for success or error code
apr_dbd_pquery: query using a prepared statement + args
- Parameters:
-
| driver | - the driver |
| pool | - working pool |
| handle | - the connection |
| nrows | - number of rows affected. |
| statement | - the prepared statement to execute |
| nargs | - ignored (for backward compatibility only) |
| args | - args to prepared statement |
- Returns:
- 0 for success or error code
apr_dbd_pselect: select using a prepared statement + args
- Parameters:
-
| driver | - the driver |
| pool | - working pool |
| handle | - the connection |
| res | - pointer to query results. May point to NULL on entry |
| statement | - the prepared statement to execute |
| random | - Whether to support random-access to results |
| nargs | - ignored (for backward compatibility only) |
| args | - args to prepared statement |
- Returns:
- 0 for success or error code
apr_dbd_pbquery: query using a prepared statement + binary args
- Parameters:
-
| driver | - the driver |
| pool | - working pool |
| handle | - the connection |
| nrows | - number of rows affected. |
| statement | - the prepared statement to execute |
| args | - binary args to prepared statement |
- Returns:
- 0 for success or error code
apr_dbd_pbselect: select using a prepared statement + binary args
- Parameters:
-
| driver | - the driver |
| pool | - working pool |
| handle | - the connection |
| res | - pointer to query results. May point to NULL on entry |
| statement | - the prepared statement to execute |
| random | - Whether to support random-access to results |
| args | - binary args to prepared statement |
- Returns:
- 0 for success or error code
apr_dbd_datum_get: get a binary entry from a row
- Parameters:
-
| driver | - the driver |
| row | - row pointer |
| col | - entry number |
| type | - type of data to get |
| data | - pointer to data, allocated by the caller |
- Returns:
- APR_SUCCESS on success, APR_ENOENT if data is NULL or APR_EGENERAL