Go to the source code of this file.
Classes | |
class | qore_dbi_method_list |
this is the data structure Qore DBI drivers will use to pass the supported DBI methods More... | |
class | DBIDriver |
this class provides the internal link to the database driver for Qore's DBI layer More... | |
class | DBIDriverList |
this class is used to register and find DBI drivers loaded in qore More... | |
Typedefs | |
typedef int(* | q_dbi_open_t )(Datasource *ds, ExceptionSink *xsink) |
signature for the DBI "open" method - must be defined in each DBI driver | |
typedef int(* | q_dbi_close_t )(Datasource *ds) |
signature for the DBI "close" method - must be defined in each DBI driver | |
typedef AbstractQoreNode *(* | q_dbi_select_t )(Datasource *ds, const QoreString *str, const QoreListNode *args, ExceptionSink *xsink) |
signature for the DBI "select" method - must be defined in each DBI driver | |
typedef AbstractQoreNode *(* | q_dbi_select_rows_t )(Datasource *ds, const QoreString *str, const QoreListNode *args, ExceptionSink *xsink) |
signature for the DBI "selectRows" method - must be defined in each DBI driver | |
typedef AbstractQoreNode *(* | q_dbi_exec_t )(Datasource *ds, const QoreString *str, const QoreListNode *args, ExceptionSink *xsink) |
signature for the DBI "execSQL" method - must be defined in each DBI driver | |
typedef AbstractQoreNode *(* | q_dbi_execraw_t )(Datasource *ds, const QoreString *str, ExceptionSink *xsink) |
signature for the DBI "execRawSQL" method - must be defined in each DBI driver | |
typedef int(* | q_dbi_commit_t )(Datasource *ds, ExceptionSink *xsink) |
signature for the DBI "commit" method - must be defined in each DBI driver | |
typedef int(* | q_dbi_rollback_t )(Datasource *ds, ExceptionSink *xsink) |
signature for the DBI "rollback" method - must be defined in each DBI driver | |
typedef int(* | q_dbi_begin_transaction_t )(Datasource *ds, ExceptionSink *xsink) |
signature for the DBI "begin_transaction" method, should only be defined for drivers needing this to explicitly start a transaction | |
typedef int(* | q_dbi_abort_transaction_start_t )(Datasource *ds, ExceptionSink *xsink) |
signature for the rollback method to be executed when the first statement in an explicit transaction started implicitly with the DBI "begin_transaction" method fails | |
typedef AbstractQoreNode *(* | q_dbi_get_server_version_t )(Datasource *ds, ExceptionSink *xsink) |
signature for the "get_server_version" method | |
typedef AbstractQoreNode *(* | q_dbi_get_client_version_t )(const Datasource *ds, ExceptionSink *xsink) |
signature for the "get_client_version" method | |
Functions | |
DLLEXPORT QoreHashNode * | parseDatasource (const char *ds, ExceptionSink *xsink) |
parses a datasource string and returns a hash of the component parts | |
DLLEXPORT void | DBI_concat_numeric (QoreString *str, const AbstractQoreNode *v) |
concatenates a numeric value to the QoreString from the QoreNode | |
DLLEXPORT int | DBI_concat_string (QoreString *str, const AbstractQoreNode *v, ExceptionSink *xsink) |
concatenates a string value to the QoreString from the AbstractQoreNode | |
Variables | |
DLLEXPORT DBIDriverList | DBI |
list of DBI drivers currently reigsted by the Qore library |
described Qore's DBI interface for writing database drivers
typedef int(* q_dbi_abort_transaction_start_t)(Datasource *ds, ExceptionSink *xsink) |
signature for the rollback method to be executed when the first statement in an explicit transaction started implicitly with the DBI "begin_transaction" method fails
this should just be a pointer to the rollback method for those drivers that need it (ex: pgsql)
ds | the Datasource for the connection | |
xsink | if any errors occur, error information should be added to this object |
typedef int(* q_dbi_begin_transaction_t)(Datasource *ds, ExceptionSink *xsink) |
signature for the DBI "begin_transaction" method, should only be defined for drivers needing this to explicitly start a transaction
ds | the Datasource for the connection | |
xsink | if any errors occur, error information should be added to this object |
typedef int(* q_dbi_close_t)(Datasource *ds) |
signature for the DBI "close" method - must be defined in each DBI driver
this function cannot throw an exception and currently any return error code is ignored
ds | the Datasource for the connection to close |
typedef int(* q_dbi_commit_t)(Datasource *ds, ExceptionSink *xsink) |
signature for the DBI "commit" method - must be defined in each DBI driver
ds | the Datasource for the connection | |
xsink | if any errors occur, error information should be added to this object |
typedef AbstractQoreNode*(* q_dbi_exec_t)(Datasource *ds, const QoreString *str, const QoreListNode *args, ExceptionSink *xsink) |
signature for the DBI "execSQL" method - must be defined in each DBI driver
ds | the Datasource for the connection | |
str | the SQL string to execute, may not be in the encoding of the Datasource | |
args | arguments for placeholders or DBI formatting codes in the SQL string | |
xsink | if any errors occur, error information should be added to this object |
typedef AbstractQoreNode*(* q_dbi_execraw_t)(Datasource *ds, const QoreString *str, ExceptionSink *xsink) |
signature for the DBI "execRawSQL" method - must be defined in each DBI driver
ds | the Datasource for the connection | |
str | the SQL string to execute, may not be in the encoding of the Datasource | |
xsink | if any errors occur, error information should be added to this object |
typedef AbstractQoreNode*(* q_dbi_get_client_version_t)(const Datasource *ds, ExceptionSink *xsink) |
signature for the "get_client_version" method
ds | the Datasource for the connection | |
xsink | if any errors occur, error information should be added to this object |
typedef AbstractQoreNode*(* q_dbi_get_server_version_t)(Datasource *ds, ExceptionSink *xsink) |
signature for the "get_server_version" method
ds | the Datasource for the connection | |
xsink | if any errors occur, error information should be added to this object |
typedef int(* q_dbi_open_t)(Datasource *ds, ExceptionSink *xsink) |
signature for the DBI "open" method - must be defined in each DBI driver
ds | the Datasource for the connection | |
xsink | if any errors occur, error information should be added to this object |
typedef int(* q_dbi_rollback_t)(Datasource *ds, ExceptionSink *xsink) |
signature for the DBI "rollback" method - must be defined in each DBI driver
ds | the Datasource for the connection | |
xsink | if any errors occur, error information should be added to this object |
typedef AbstractQoreNode*(* q_dbi_select_rows_t)(Datasource *ds, const QoreString *str, const QoreListNode *args, ExceptionSink *xsink) |
signature for the DBI "selectRows" method - must be defined in each DBI driver
ds | the Datasource for the connection | |
str | the SQL string to execute, may not be in the encoding of the Datasource | |
args | arguments for placeholders or DBI formatting codes in the SQL string | |
xsink | if any errors occur, error information should be added to this object |
typedef AbstractQoreNode*(* q_dbi_select_t)(Datasource *ds, const QoreString *str, const QoreListNode *args, ExceptionSink *xsink) |
signature for the DBI "select" method - must be defined in each DBI driver
ds | the Datasource for the connection | |
str | the SQL string to execute, may not be in the encoding of the Datasource | |
args | arguments for placeholders or DBI formatting codes in the SQL string | |
xsink | if any errors occur, error information should be added to this object |
DLLEXPORT int DBI_concat_string | ( | QoreString * | str, | |
const AbstractQoreNode * | v, | |||
ExceptionSink * | xsink | |||
) |
concatenates a string value to the QoreString from the AbstractQoreNode
NOTE: no escaping is done here this function is most useful for table prefixes, etc in queries