Loading...
Searching...
No Matches
apr_dbd.h
Go to the documentation of this file.
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Overview of what this is and does:
* http://www.apache.org/~niq/dbd.html
*/
#ifndef APR_DBD_H
#define APR_DBD_H
#include "apu.h"
#include "apr_pools.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
APR_DBD_TYPE_NONE,
APR_DBD_TYPE_TINY,
APR_DBD_TYPE_UTINY,
APR_DBD_TYPE_SHORT,
APR_DBD_TYPE_USHORT,
APR_DBD_TYPE_INT,
APR_DBD_TYPE_UINT,
APR_DBD_TYPE_LONG,
APR_DBD_TYPE_ULONG,
APR_DBD_TYPE_LONGLONG,
APR_DBD_TYPE_ULONGLONG,
APR_DBD_TYPE_FLOAT,
APR_DBD_TYPE_DOUBLE,
APR_DBD_TYPE_STRING,
APR_DBD_TYPE_TEXT,
APR_DBD_TYPE_TIME,
APR_DBD_TYPE_DATE,
APR_DBD_TYPE_DATETIME,
APR_DBD_TYPE_TIMESTAMP,
APR_DBD_TYPE_ZTIMESTAMP,
APR_DBD_TYPE_BLOB,
APR_DBD_TYPE_CLOB,
APR_DBD_TYPE_NULL
} apr_dbd_type_e;
/* These are opaque structs. Instantiation is up to each backend */
typedef struct apr_dbd_driver_t apr_dbd_driver_t;
typedef struct apr_dbd_t apr_dbd_t;
typedef struct apr_dbd_transaction_t apr_dbd_transaction_t;
typedef struct apr_dbd_results_t apr_dbd_results_t;
typedef struct apr_dbd_row_t apr_dbd_row_t;
typedef struct apr_dbd_prepared_t apr_dbd_prepared_t;
APU_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool);
APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name,
const apr_dbd_driver_t **driver);
APU_DECLARE(apr_status_t) apr_dbd_open_ex(const apr_dbd_driver_t *driver,
apr_pool_t *pool, const char *params,
apr_dbd_t **handle,
const char **error);
APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver,
apr_pool_t *pool, const char *params,
apr_dbd_t **handle);
APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver,
apr_dbd_t *handle);
/* apr-function-shaped versions of things */
APU_DECLARE(const char*) apr_dbd_name(const apr_dbd_driver_t *driver);
APU_DECLARE(void*) apr_dbd_native_handle(const apr_dbd_driver_t *driver,
apr_dbd_t *handle);
APU_DECLARE(int) apr_dbd_check_conn(const apr_dbd_driver_t *driver, apr_pool_t *pool,
apr_dbd_t *handle);
APU_DECLARE(int) apr_dbd_set_dbname(const apr_dbd_driver_t *driver, apr_pool_t *pool,
apr_dbd_t *handle, const char *name);
APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver,
apr_pool_t *pool,
apr_dbd_t *handle,
apr_dbd_transaction_t **trans);
APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver,
apr_pool_t *pool,
apr_dbd_transaction_t *trans);
#define APR_DBD_TRANSACTION_COMMIT 0x00
#define APR_DBD_TRANSACTION_ROLLBACK 0x01
#define APR_DBD_TRANSACTION_IGNORE_ERRORS 0x02
APU_DECLARE(int) apr_dbd_transaction_mode_get(const apr_dbd_driver_t *driver,
apr_dbd_transaction_t *trans);
APU_DECLARE(int) apr_dbd_transaction_mode_set(const apr_dbd_driver_t *driver,
apr_dbd_transaction_t *trans,
int mode);
APU_DECLARE(int) apr_dbd_query(const apr_dbd_driver_t *driver, apr_dbd_t *handle,
int *nrows, const char *statement);
APU_DECLARE(int) apr_dbd_select(const apr_dbd_driver_t *driver, apr_pool_t *pool,
apr_dbd_t *handle, apr_dbd_results_t **res,
const char *statement, int random);
APU_DECLARE(int) apr_dbd_num_cols(const apr_dbd_driver_t *driver,
apr_dbd_results_t *res);
APU_DECLARE(int) apr_dbd_num_tuples(const apr_dbd_driver_t *driver,
apr_dbd_results_t *res);
APU_DECLARE(int) apr_dbd_get_row(const apr_dbd_driver_t *driver, apr_pool_t *pool,
apr_dbd_results_t *res, apr_dbd_row_t **row,
int rownum);
APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver,
apr_dbd_row_t *row, int col);
APU_DECLARE(const char*) apr_dbd_get_name(const apr_dbd_driver_t *driver,
apr_dbd_results_t *res, int col);
APU_DECLARE(const char*) apr_dbd_error(const apr_dbd_driver_t *driver,
apr_dbd_t *handle, int errnum);
APU_DECLARE(const char*) apr_dbd_escape(const apr_dbd_driver_t *driver,
apr_pool_t *pool, const char *string,
apr_dbd_t *handle);
APU_DECLARE(int) apr_dbd_prepare(const apr_dbd_driver_t *driver, apr_pool_t *pool,
apr_dbd_t *handle, const char *query,
const char *label,
apr_dbd_prepared_t **statement);
APU_DECLARE(int) apr_dbd_pquery(const apr_dbd_driver_t *driver, apr_pool_t *pool,
apr_dbd_t *handle, int *nrows,
apr_dbd_prepared_t *statement, int nargs,
const char **args);
APU_DECLARE(int) apr_dbd_pselect(const apr_dbd_driver_t *driver, apr_pool_t *pool,
apr_dbd_t *handle, apr_dbd_results_t **res,
apr_dbd_prepared_t *statement, int random,
int nargs, const char **args);
APU_DECLARE_NONSTD(int) apr_dbd_pvquery(const apr_dbd_driver_t *driver,
apr_pool_t *pool,
apr_dbd_t *handle, int *nrows,
apr_dbd_prepared_t *statement, ...);
APU_DECLARE_NONSTD(int) apr_dbd_pvselect(const apr_dbd_driver_t *driver,
apr_pool_t *pool, apr_dbd_t *handle,
apr_dbd_results_t **res,
apr_dbd_prepared_t *statement,
int random, ...);
APU_DECLARE(int) apr_dbd_pbquery(const apr_dbd_driver_t *driver,
apr_pool_t *pool, apr_dbd_t *handle,
int *nrows, apr_dbd_prepared_t *statement,
const void **args);
APU_DECLARE(int) apr_dbd_pbselect(const apr_dbd_driver_t *driver,
apr_pool_t *pool,
apr_dbd_t *handle, apr_dbd_results_t **res,
apr_dbd_prepared_t *statement, int random,
const void **args);
APU_DECLARE_NONSTD(int) apr_dbd_pvbquery(const apr_dbd_driver_t *driver,
apr_pool_t *pool,
apr_dbd_t *handle, int *nrows,
apr_dbd_prepared_t *statement, ...);
APU_DECLARE_NONSTD(int) apr_dbd_pvbselect(const apr_dbd_driver_t *driver,
apr_pool_t *pool, apr_dbd_t *handle,
apr_dbd_results_t **res,
apr_dbd_prepared_t *statement,
int random, ...);
APU_DECLARE(apr_status_t) apr_dbd_datum_get(const apr_dbd_driver_t *driver,
apr_dbd_row_t *row, int col,
apr_dbd_type_e type, void *data);
#ifdef __cplusplus
}
#endif
#endif
apr_dbd_select
int apr_dbd_select(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, const char *statement, int random)
apr_dbd_type_e
apr_dbd_type_e
Definition apr_dbd.h:55
apr_dbd_pbselect
int apr_dbd_pbselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, const void **args)
apr_dbd_transaction_start
int apr_dbd_transaction_start(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_transaction_t **trans)
apr_dbd_pquery
int apr_dbd_pquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, int nargs, const char **args)
apr_dbd_pvbquery
int apr_dbd_pvbquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement,...)
apr_dbd_transaction_mode_get
int apr_dbd_transaction_mode_get(const apr_dbd_driver_t *driver, apr_dbd_transaction_t *trans)
apr_dbd_num_tuples
int apr_dbd_num_tuples(const apr_dbd_driver_t *driver, apr_dbd_results_t *res)
apr_dbd_error
const char * apr_dbd_error(const apr_dbd_driver_t *driver, apr_dbd_t *handle, int errnum)
apr_dbd_query
int apr_dbd_query(const apr_dbd_driver_t *driver, apr_dbd_t *handle, int *nrows, const char *statement)
apr_dbd_close
apr_status_t apr_dbd_close(const apr_dbd_driver_t *driver, apr_dbd_t *handle)
apr_dbd_pvquery
int apr_dbd_pvquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement,...)
apr_dbd_name
const char * apr_dbd_name(const apr_dbd_driver_t *driver)
apr_dbd_datum_get
apr_status_t apr_dbd_datum_get(const apr_dbd_driver_t *driver, apr_dbd_row_t *row, int col, apr_dbd_type_e type, void *data)
apr_dbd_transaction_end
int apr_dbd_transaction_end(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_transaction_t *trans)
apr_dbd_num_cols
int apr_dbd_num_cols(const apr_dbd_driver_t *driver, apr_dbd_results_t *res)
apr_dbd_pbquery
int apr_dbd_pbquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, const void **args)
apr_dbd_init
apr_status_t apr_dbd_init(apr_pool_t *pool)
apr_dbd_get_driver
apr_status_t apr_dbd_get_driver(apr_pool_t *pool, const char *name, const apr_dbd_driver_t **driver)
apr_dbd_pselect
int apr_dbd_pselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, int nargs, const char **args)
apr_dbd_transaction_mode_set
int apr_dbd_transaction_mode_set(const apr_dbd_driver_t *driver, apr_dbd_transaction_t *trans, int mode)
apr_dbd_get_entry
const char * apr_dbd_get_entry(const apr_dbd_driver_t *driver, apr_dbd_row_t *row, int col)
apr_dbd_open_ex
apr_status_t apr_dbd_open_ex(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *params, apr_dbd_t **handle, const char **error)
apr_dbd_get_name
const char * apr_dbd_get_name(const apr_dbd_driver_t *driver, apr_dbd_results_t *res, int col)
apr_dbd_escape
const char * apr_dbd_escape(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *string, apr_dbd_t *handle)
apr_dbd_prepare
int apr_dbd_prepare(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, const char *query, const char *label, apr_dbd_prepared_t **statement)
apr_dbd_pvbselect
int apr_dbd_pvbselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random,...)
apr_dbd_get_row
int apr_dbd_get_row(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_results_t *res, apr_dbd_row_t **row, int rownum)
apr_dbd_native_handle
void * apr_dbd_native_handle(const apr_dbd_driver_t *driver, apr_dbd_t *handle)
apr_dbd_check_conn
int apr_dbd_check_conn(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle)
apr_dbd_open
apr_status_t apr_dbd_open(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *params, apr_dbd_t **handle)
apr_dbd_pvselect
int apr_dbd_pvselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random,...)
apr_dbd_set_dbname
int apr_dbd_set_dbname(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, const char *name)
APR_DBD_TYPE_SHORT
@ APR_DBD_TYPE_SHORT
Definition apr_dbd.h:59
APR_DBD_TYPE_FLOAT
@ APR_DBD_TYPE_FLOAT
Definition apr_dbd.h:67
APR_DBD_TYPE_TIME
@ APR_DBD_TYPE_TIME
Definition apr_dbd.h:71
APR_DBD_TYPE_ULONG
@ APR_DBD_TYPE_ULONG
Definition apr_dbd.h:64
APR_DBD_TYPE_STRING
@ APR_DBD_TYPE_STRING
Definition apr_dbd.h:69
APR_DBD_TYPE_INT
@ APR_DBD_TYPE_INT
Definition apr_dbd.h:61
APR_DBD_TYPE_UINT
@ APR_DBD_TYPE_UINT
Definition apr_dbd.h:62
APR_DBD_TYPE_TIMESTAMP
@ APR_DBD_TYPE_TIMESTAMP
Definition apr_dbd.h:74
APR_DBD_TYPE_BLOB
@ APR_DBD_TYPE_BLOB
Definition apr_dbd.h:76
APR_DBD_TYPE_NULL
@ APR_DBD_TYPE_NULL
Definition apr_dbd.h:78
APR_DBD_TYPE_DATETIME
@ APR_DBD_TYPE_DATETIME
Definition apr_dbd.h:73
APR_DBD_TYPE_DOUBLE
@ APR_DBD_TYPE_DOUBLE
Definition apr_dbd.h:68
APR_DBD_TYPE_LONGLONG
@ APR_DBD_TYPE_LONGLONG
Definition apr_dbd.h:65
APR_DBD_TYPE_UTINY
@ APR_DBD_TYPE_UTINY
Definition apr_dbd.h:58
APR_DBD_TYPE_DATE
@ APR_DBD_TYPE_DATE
Definition apr_dbd.h:72
APR_DBD_TYPE_TINY
@ APR_DBD_TYPE_TINY
Definition apr_dbd.h:57
APR_DBD_TYPE_ULONGLONG
@ APR_DBD_TYPE_ULONGLONG
Definition apr_dbd.h:66
APR_DBD_TYPE_LONG
@ APR_DBD_TYPE_LONG
Definition apr_dbd.h:63
APR_DBD_TYPE_CLOB
@ APR_DBD_TYPE_CLOB
Definition apr_dbd.h:77
APR_DBD_TYPE_TEXT
@ APR_DBD_TYPE_TEXT
Definition apr_dbd.h:70
APR_DBD_TYPE_ZTIMESTAMP
@ APR_DBD_TYPE_ZTIMESTAMP
Definition apr_dbd.h:75
APR_DBD_TYPE_USHORT
@ APR_DBD_TYPE_USHORT
Definition apr_dbd.h:60
apr_dbd_driver_t
Definition apr_dbd_internal.h:43