db.h File Reference

#include "common.h"
#include "config.h"
#include <stdarg.h>
#include "collection.h"
#include "hashtable.h"
#include "linked_list.h"
#include "vector.h"
#include "str.h"

Go to the source code of this file.

Data Structures

struct  _cp_timestampz
struct  _cp_db_connection_parameters
struct  _cp_db_connection
struct  _cp_db_statement
struct  _cp_result_set
struct  _cp_db_actions
struct  _cp_dbms_driver_descriptor
struct  _cp_data_source
struct  _cp_db_connection_pool

Typedefs

typedef CPROPS_DLL struct
_cp_timestampz 
cp_timestampz
typedef CPROPS_DLL struct
_cp_db_connection_parameters 
cp_db_connection_parameters
typedef CPROPS_DLL struct
_cp_db_connection 
cp_db_connection
typedef CPROPS_DLL struct
_cp_db_statement 
cp_db_statement
typedef CPROPS_DLL struct
_cp_result_set 
cp_result_set
typedef cp_db_connection *(*) cp_db_open_fn (struct _cp_data_source *)
typedef cp_result_set *(*) cp_db_select_fn (cp_db_connection *conn, char *query)
typedef int(*) cp_db_fetch_metadata_fn (cp_result_set *rs)
typedef int(*) cp_db_fetch_next_fn (cp_result_set *rs)
typedef int(*) cp_db_release_result_set_fn (cp_result_set *rs)
typedef int(*) cp_db_update_fn (cp_db_connection *conn, char *query)
typedef int(*) cp_db_close_fn (cp_db_connection *conn)
typedef char *(*) cp_db_escape_string_fn (cp_db_connection *conn, char *src, size_t len)
typedef char *(*) cp_db_escape_binary_fn (cp_db_connection *conn, char *src, size_t src_len, size_t *res_len)
typedef cp_string *(*) cp_db_unescape_binary_fn (cp_db_connection *conn, char *src)
typedef cp_db_statement *(*) cp_db_prepare_statement_fn (cp_db_connection *conn, int prm_count, cp_field_type *prm_types, char *query)
typedef int(*) cp_db_execute_statement_fn (cp_db_connection *conn, cp_db_statement *stmt, cp_result_set **results, int *lengths, void **prm)
typedef void(*) cp_db_release_statement_fn (cp_db_statement *stmt)
typedef void(*) cp_db_set_autocommit_fn (cp_db_connection *conn, int state)
typedef int(*) cp_db_commit_fn (cp_db_connection *conn)
typedef int(*) cp_db_rollback_fn (cp_db_connection *conn)
typedef CPROPS_DLL struct
_cp_db_actions 
cp_db_actions
typedef _cp_data_source *(*) cp_db_get_data_source_fn (char *host, int port, char *user, char *passwd, char *dbname)
typedef _cp_data_source *(*) cp_db_get_data_source_prm_fn (char *host, int port, char *user, char *passwd, char *dbname, cp_hashtable *prm)
typedef CPROPS_DLL struct
_cp_dbms_driver_descriptor 
cp_dbms_driver_descriptor
typedef CPROPS_DLL struct
_cp_data_source 
cp_data_source
typedef CPROPS_DLL struct
_cp_db_connection_pool 
cp_db_connection_pool

Enumerations

enum  {
  CP_FIELD_TYPE_BOOLEAN, CP_FIELD_TYPE_CHAR, CP_FIELD_TYPE_SHORT, CP_FIELD_TYPE_INT,
  CP_FIELD_TYPE_LONG, CP_FIELD_TYPE_LONG_LONG, CP_FIELD_TYPE_FLOAT, CP_FIELD_TYPE_DOUBLE,
  CP_FIELD_TYPE_VARCHAR, CP_FIELD_TYPE_BLOB, CP_FIELD_TYPE_DATE, CP_FIELD_TYPE_TIME,
  CP_FIELD_TYPE_TIMESTAMP
}

Functions

CPROPS_DLL int cp_db_init ()
CPROPS_DLL int cp_db_register_dbms (char *dbms_name, void(*shutdown_call)())
CPROPS_DLL int cp_db_shutdown ()
CPROPS_DLL cp_timestampz * cp_timestampz_create (struct timeval *tm, int minuteswest)
CPROPS_DLL cp_timestampz * cp_timestampz_create_prm (int sec_since_epoch, int microsec, int minwest)
CPROPS_DLL void cp_timestampz_destroy (cp_timestampz *tm)
CPROPS_DLL struct tm * cp_timestampz_localtime (cp_timestampz *tm, struct tm *res)
CPROPS_DLL void cp_db_connection_parameters_destroy (cp_db_connection_parameters *prm)
CPROPS_DLL cp_db_statement * cp_db_statement_instantiate (cp_db_connection *connection, int prm_count, cp_field_type *types, void *source)
CPROPS_DLL void cp_db_statement_set_binary (cp_db_statement *stmt, int binary)
CPROPS_DLL void cp_db_statement_destroy (cp_db_statement *statement)
CPROPS_DLL cp_vector * cp_result_set_get_headers (cp_result_set *result_set)
CPROPS_DLL cp_vector * cp_result_set_get_field_types (cp_result_set *result_set)
CPROPS_DLL int cp_result_set_field_count (cp_result_set *result_set)
CPROPS_DLL int cp_result_set_row_count (cp_result_set *result_set)
CPROPS_DLL char * cp_result_set_get_header (cp_result_set *result_set, int column)
CPROPS_DLL cp_field_type cp_result_set_get_field_type (cp_result_set *rs, int column)
CPROPS_DLL void cp_result_set_autodispose (cp_result_set *rs, int mode)
CPROPS_DLL cp_vector * cp_result_set_next (cp_result_set *result_set)
CPROPS_DLL void cp_result_set_destroy (cp_result_set *result_set)
CPROPS_DLL void cp_result_set_release_row (cp_result_set *result_set, cp_vector *row)
CPROPS_DLL int cp_result_set_is_binary (cp_result_set *result_set)
CPROPS_DLL cp_result_setcp_db_connection_select (cp_db_connection *connection, char *query)
CPROPS_DLL int cp_db_connection_update (cp_db_connection *connection, char *query)
CPROPS_DLL int cp_db_connection_close (cp_db_connection *connection)
CPROPS_DLL void cp_db_connection_destroy (cp_db_connection *connection)
CPROPS_DLL void cp_db_connection_set_fetch_metadata (cp_db_connection *connection, int mode)
CPROPS_DLL void cp_db_connection_set_read_result_set_at_once (cp_db_connection *connection, int mode)
CPROPS_DLL void cp_db_connection_set_fetch_size (cp_db_connection *connection, int fetch_size)
CPROPS_DLL char * cp_db_connection_escape_string (cp_db_connection *connection, char *src, size_t len)
CPROPS_DLL char * cp_db_connection_escape_binary (cp_db_connection *connection, char *src, size_t src_len, size_t *res_len)
CPROPS_DLL cp_stringcp_db_connection_unescape_binary (cp_db_connection *connection, char *src)
CPROPS_DLL cp_db_statement * cp_db_connection_prepare_statement (cp_db_connection *connection, int prm_count, cp_field_type *prm_types, char *query)
CPROPS_DLL int cp_db_connection_execute_statement (cp_db_connection *connection, cp_db_statement *statement, cp_vector *prm, cp_result_set **results)
CPROPS_DLL int cp_db_connection_execute_statement_args (cp_db_connection *connection, cp_db_statement *statement, cp_result_set **results,...)
CPROPS_DLL void cp_db_connection_close_statement (cp_db_connection *connection, cp_db_statement *statement)
CPROPS_DLL void cp_db_connection_set_autocommit (cp_db_connection *conn, int state)
CPROPS_DLL int cp_db_connection_commit (cp_db_connection *conn)
CPROPS_DLL int cp_db_connection_rollback (cp_db_connection *conn)
CPROPS_DLL cp_db_actionscp_db_actions_create (int dbms, char *dbms_lit, cp_db_open_fn open, cp_db_select_fn select, cp_db_fetch_metadata_fn fetch_metadata, cp_db_fetch_next_fn fetch_next, cp_db_release_result_set_fn release_result_set, cp_db_update_fn update, cp_db_close_fn close, cp_db_escape_string_fn escape_string, cp_db_escape_binary_fn escape_binary, cp_db_unescape_binary_fn unescape_binary, cp_db_prepare_statement_fn prepare_statement, cp_db_execute_statement_fn execute_statement, cp_db_release_statement_fn release_statement, cp_db_set_autocommit_fn set_autocommit, cp_db_commit_fn commit, cp_db_rollback_fn rollback)
CPROPS_DLL void cp_db_actions_destroy (cp_db_actions *actions)
CPROPS_DLL cp_data_sourcecp_dbms_get_data_source (char *driver, char *host, int port, char *user, char *passwd, char *dbname)
CPROPS_DLL cp_data_sourcecp_dbms_get_data_source_prm (char *driver, char *host, int port, char *user, char *passwd, char *dbname, cp_hashtable *prm)
CPROPS_DLL void cp_data_source_destroy (cp_data_source *data_source)
CPROPS_DLL cp_db_connectioncp_data_source_get_connection (cp_data_source *data_source)
CPROPS_DLL cp_db_connection_poolcp_db_connection_pool_create (cp_data_source *data_source, int min_size, int max_size, int initial_size)
CPROPS_DLL int cp_db_connection_pool_shutdown (cp_db_connection_pool *pool)
CPROPS_DLL void cp_db_connection_pool_destroy (cp_db_connection_pool *pool)
CPROPS_DLL void cp_db_connection_pool_set_blocking (cp_db_connection_pool *pool, int block)
CPROPS_DLL cp_db_connectioncp_db_connection_pool_get_connection (cp_db_connection_pool *pool)
CPROPS_DLL void cp_db_connection_pool_release_connection (cp_db_connection_pool *pool, cp_db_connection *connection)

Variables

__BEGIN_DECLS typedef CPROPS_DLL
enum { ... }  
cp_field_type


Detailed Description

definitions for dbms abstraction api

Definition in file db.h.


Generated on Mon Dec 5 23:00:22 2011 for cprops by  doxygen 1.4.7