Data Structures | |
| struct | rxv_spin_db_result |
| Database result structure. More... | |
Defines | |
| #define | RXV_SPIN_DB_INFO_DB 0x01 |
| #define | RXV_SPIN_DB_INFO_USER 0x02 |
| #define | RXV_SPIN_DB_INFO_PASS 0x03 |
| #define | RXV_SPIN_DB_INFO_HOST 0x04 |
| #define | RXV_SPIN_DB_INFO_PORT 0x05 |
| #define | RXV_SPIN_DB_INFO_TTY 0x06 |
| #define | RXV_SPIN_DB_INFO_OPTIONS 0x07 |
| #define | RXV_SPIN_DB_INFO_ERROR 0x08 |
| #define | rxv_spin_db_db(conn) rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_DB) |
| #define | rxv_spin_db_user(conn) rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_USER) |
| #define | rxv_spin_db_pass(conn) rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_PASS) |
| #define | rxv_spin_db_host(conn) rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_HOST) |
| #define | rxv_spin_db_port(conn) rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_PORT) |
| #define | rxv_spin_db_tty(conn) rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_TTY) |
| #define | rxv_spin_db_options(conn) rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_OPTIONS) |
| #define | rxv_spin_db_error(conn) rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_ERROR) |
Typedefs | |
| typedef rxv_spin_db_result | rxv_spin_db_result_t |
Functions | |
| rxv_spin_conn_t * | rxv_spin_db_connect (apr_pool_t *pool, rxv_spin_cpool_t *cpool, const char *conninfo, unsigned char type) |
| rxv_spin_db_result_t * | rxv_spin_db_exec (apr_pool_t *pool, rxv_spin_conn_t *conn, const char *query) |
| char * | rxv_spin_db_info (rxv_spin_conn_t *conn, unsigned char what) |
| apr_status_t | rxv_spin_db_status (rxv_spin_conn_t *conn) |
| char * | rxv_spin_db_escape (apr_pool_t *pool, rxv_spin_conn_t *conn, const char *str) |
| apr_status_t | rxv_spin_db_reset (rxv_spin_conn_t *conn) |
| #define RXV_SPIN_DB_INFO_DB 0x01 |
database name
| #define RXV_SPIN_DB_INFO_USER 0x02 |
database user
| #define RXV_SPIN_DB_INFO_PASS 0x03 |
database password
| #define RXV_SPIN_DB_INFO_HOST 0x04 |
database host
| #define RXV_SPIN_DB_INFO_PORT 0x05 |
database port
| #define RXV_SPIN_DB_INFO_TTY 0x06 |
database tty
| #define RXV_SPIN_DB_INFO_OPTIONS 0x07 |
database options
| #define RXV_SPIN_DB_INFO_ERROR 0x08 |
database error
| #define rxv_spin_db_db | ( | conn | ) | rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_DB) |
get name
| #define rxv_spin_db_user | ( | conn | ) | rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_USER) |
get user
| #define rxv_spin_db_pass | ( | conn | ) | rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_PASS) |
get password
| #define rxv_spin_db_host | ( | conn | ) | rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_HOST) |
get host
| #define rxv_spin_db_port | ( | conn | ) | rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_PORT) |
get port
| #define rxv_spin_db_tty | ( | conn | ) | rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_TTY) |
get tty
| #define rxv_spin_db_options | ( | conn | ) | rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_OPTIONS) |
get options
| #define rxv_spin_db_error | ( | conn | ) | rxv_spin_db_info((conn),RXV_SPIN_DB_INFO_ERROR) |
get error
| typedef struct rxv_spin_db_result rxv_spin_db_result_t |
database query result type
| rxv_spin_conn_t* rxv_spin_db_connect | ( | apr_pool_t * | pool, | |
| rxv_spin_cpool_t * | cpool, | |||
| const char * | conninfo, | |||
| unsigned char | type | |||
| ) |
Connect to a database and optionally pool the connection.
| pool | Memory pool used for memory allocations | |
| cpool | Connection pool | |
| conninfo | Connection string | |
| type | Database type |
rxv_spin_db_connect(ctx->pool,NULL,"dbname=spintest",RXV_SPIN_DB_PGSQL);
rxv_spin_db_connect(ctx->pool,ctx->cpool,"dbname=spintest",RXV_SPIN_DB_MYSQL);
| rxv_spin_db_result_t* rxv_spin_db_exec | ( | apr_pool_t * | pool, | |
| rxv_spin_conn_t * | conn, | |||
| const char * | query | |||
| ) |
Execute a database query of any type.
| pool | Pool used for memory allocation | |
| conn | Database connection | |
| query | SQL query to be performed |
result=rxv_spin_db_exec(ctx->pool,conn,"select * from spintest");
| char* rxv_spin_db_info | ( | rxv_spin_conn_t * | conn, | |
| unsigned char | what | |||
| ) |
Get various info about the database connection.
| conn | Database connection | |
| what | The type of information to get |
rxv_spin_db_info(conn);
| apr_status_t rxv_spin_db_status | ( | rxv_spin_conn_t * | conn | ) |
Get the status of the connection.
| conn | Database connection |
rxv_spin_db_status(conn);
| char* rxv_spin_db_escape | ( | apr_pool_t * | pool, | |
| rxv_spin_conn_t * | conn, | |||
| const char * | str | |||
| ) |
Escape a string for use within an SQL query.
| pool | Pool used for memory allocation | |
| conn | Database connection | |
| str | string to be escaped |
escstr=rxv_spin_db_escape(ctx->pool,conn,"'A string to escape'");
| apr_status_t rxv_spin_db_reset | ( | rxv_spin_conn_t * | conn | ) |
Reset a database connection (i.e. attempt to reconnect).
| conn | Database connection to reset |
rxv_spin_db_reset(conn);
1.5.2