| Qore Programming Language Reference Manual 2.2.0

Loading...
Searching...
No Matches
QC_Datasource.dox.h
1
2 namespace Qore {
4 namespace SQL {
6
106 class Datasource : public AbstractDatasource, public Serializable {
107
108 public:
110
124nothing beginTransaction();
125
126 public:
128
130nothing clearEventQueue();
131
132 public:
134
143nothing close();
144
145 public:
147
156nothing commit();
157
158 public:
160
192 constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash<auto> options, *Qore::Thread::Queue queue, auto arg);
193
194 public:
196
213 constructor(string desc, *Qore::Thread::Queue queue, auto arg);
214
215 public:
217
254 constructor(hash<auto> opts, *Qore::Thread::Queue queue, auto arg);
255
256 public:
258
263 copy();
264
265 public:
267
281 bool currentThreadInTransaction();
282
283 public:
285
310*hash<auto> describe(string sql, ...);
311
312 public:
314
322 destructor();
323
324 public:
326
347 auto exec(string sql, ...);
348
349 public:
351
376 auto execRaw(string sql);
377
378 public:
380
390 bool getAutoCommit();
391
392 public:
394
406 int getCapabilities();
407
408 public:
410
422 list<auto> getCapabilityList();
423
424 public:
426
435 auto getClientVersion();
436
437 public:
439
454 hash<auto> getConfigHash();
455
456 public:
458
473 string getConfigString();
474
475 public:
477
489*string getDBCharset();
490
491 public:
493
505*string getDBEncoding();
506
507 public:
509
519*string getDBName();
520
521 public:
523
535 string getDriverName();
536
537 public:
539
556 string getDriverRealName();
557
558 public:
560
570*string getHostName();
571
572 public:
574
586 string getOSCharset();
587
588 public:
590
600*string getOSEncoding();
601
602 public:
604
616 auto getOption(string opt);
617
618 public:
620
634 hash<auto> getOptionHash();
635
636 public:
638
648*string getPassword();
649
650 public:
652
662*int getPort();
663
664 public:
666
675 AbstractSQLStatement getSQLStatement();
676
677 public:
679
690 auto getServerVersion();
691
692 public:
694
704 int getTransactionLockTimeout();
705
706 public:
708
718*string getUserName();
719
720 public:
722
732 bool inTransaction();
733
734 public:
736
747nothing open();
748
749 public:
751
760nothing reset();
761
762 public:
764
773nothing rollback();
774
775 public:
777
810 auto select(string sql, ...);
811
812 public:
814
835*hash<auto> selectRow(string sql, ...);
836
837 public:
839
865 auto selectRows(string sql, ...);
866
867 public:
869
876nothing setAutoCommit(bool ac = True);
877
878 public:
880
891nothing setDBCharset(string encoding);
892
893 public:
895
904nothing setDBEncoding(string encoding);
905
906 public:
908
917nothing setDBName(string db);
918
919 public:
921
928nothing setEventQueue(Qore::Thread::Queue queue, auto arg);
929
930 public:
932
941nothing setHostName(string host);
942
943 public:
945
956 setOption(string opt, auto val);
957
958 public:
960
969nothing setPassword(string pass);
970
971 public:
973
982nothing setPort(softint port = 0);
983
984 public:
986
993nothing setTransactionLockTimeout(timeout timeout_ms = 0);
994
995 public:
997
1006nothing setUserName(string user);
1007
1008 public:
1010
1027 int transactionTid();
1028
1029 public:
1031
1054 auto vexec(string sql, *softlist<auto> vargs);
1055
1056 public:
1058
1088 auto vselect(string sql, *softlist<auto> vargs);
1089
1090 public:
1092
1114*hash<auto> vselectRow(string sql, *softlist<auto> vargs);
1115
1116 public:
1118
1146 auto vselectRows(string sql, *softlist<auto> vargs);
1147};
1148
1152
1154 const DSDB2 = "db2";
1156 const DSFreeTDS = "freetds";
1158 const DSJDBC = "jdbc";
1160 const DSMSSQL = "freetds";
1162 const DSMySQL = "mysql";
1164 const DSOracle = "oracle";
1166 const DSPGSQL = "pgsql";
1168 const DSSQLite3 = "sqlite3";
1170 const DSSybase = "sybase";
1172
1177
1179 const DBI_CAP_AUTORECONNECT = DBI_CAP_AUTORECONNECT;
1181 const DBI_CAP_BIND_BY_PLACEHOLDER = DBI_CAP_BIND_BY_PLACEHOLDER;
1183 const DBI_CAP_BIND_BY_VALUE = DBI_CAP_BIND_BY_VALUE;
1185 const DBI_CAP_CHARSET_SUPPORT = DBI_CAP_CHARSET_SUPPORT;
1187 const DBI_CAP_EVENTS = DBI_CAP_EVENTS;
1189 const DBI_CAP_HAS_ARRAY_BIND = DBI_CAP_HAS_ARRAY_BIND;
1191 const DBI_CAP_HAS_DESCRIBE = DBI_CAP_HAS_DESCRIBE;
1193 const DBI_CAP_HAS_EXECRAW = DBI_CAP_HAS_EXECRAW;
1195 const DBI_CAP_HAS_NUMBER_SUPPORT = DBI_CAP_HAS_NUMBER_SUPPORT;
1197 const DBI_CAP_HAS_OPTION_SUPPORT = DBI_CAP_HAS_OPTION_SUPPORT;
1199
1201 const DBI_CAP_HAS_RESULTSET_OUTPUT = DBI_CAP_HAS_RESULTSET_OUTPUT;
1203 const DBI_CAP_HAS_SELECT_ROW = DBI_CAP_HAS_SELECT_ROW;
1205 const DBI_CAP_HAS_STATEMENT = DBI_CAP_HAS_STATEMENT;
1207 const DBI_CAP_LOB_SUPPORT = DBI_CAP_LOB_SUPPORT;
1209 const DBI_CAP_SERVER_TIME_ZONE = DBI_CAP_SERVER_TIME_ZONE;
1211 const DBI_CAP_STORED_PROCEDURES = DBI_CAP_STORED_PROCEDURES;
1213 const DBI_CAP_TIME_ZONE_SUPPORT = DBI_CAP_TIME_ZONE_SUPPORT;
1215 const DBI_CAP_TRANSACTION_MANAGEMENT = DBI_CAP_TRANSACTION_MANAGEMENT;
1217}
1218}
Qore::SQL::AbstractDatasource
This class defines an abstract interface for database access, inherited by both the Datasource and Da...
Definition QC_AbstractDatasource.dox.h:10
Qore::SQL::AbstractSQLStatement
This class defines an abstract interface for the SQLStatement class.
Definition QC_AbstractSQLStatement.dox.h:11
Qore::SQL::Datasource
This class provides the Qore interface to databases.
Definition QC_Datasource.dox.h:106
Qore::SQL::Datasource::getClientVersion
auto getClientVersion()
Retrieves the driver-specific client library version information; this method may not be implemented ...
Qore::SQL::Datasource::select
auto select(string sql,...)
Executes an SQL select statement on the server and returns the result as a hash (column names) of lis...
Qore::SQL::Datasource::getUserName
*string getUserName()
Returns the username parameter as a string or NOTHING if none is set.
Qore::SQL::Datasource::selectRow
*hash< auto > selectRow(string sql,...)
Executes an SQL select statement on the server and returns the first row as a hash (the column values...
Qore::SQL::Datasource::getHostName
*string getHostName()
Returns the hostname parameter as a string or NOTHING if none is set.
Qore::SQL::Datasource::getDriverRealName
string getDriverRealName()
Returns the real DB driver name if supported by the driver, otherwise the Qore driver name.
Qore::SQL::Datasource::copy
copy()
Creates a new Datasource object with the same driver as the original and copies of all the connection...
Qore::SQL::Datasource::setPassword
nothing setPassword(string pass)
Sets the password parameter for the time a connection to the server is established.
Qore::SQL::Datasource::exec
auto exec(string sql,...)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
Qore::SQL::Datasource::getConfigHash
hash< auto > getConfigHash()
Returns a datasource hash describing the configuration of the current object.
Qore::SQL::Datasource::setHostName
nothing setHostName(string host)
Sets the hostname to use for the next connection to the server.
Qore::SQL::Datasource::constructor
constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash< auto > options, *Qore::Thread::Queue queue, auto arg)
Creates the Datasource object; attempts to load a DBI driver if the driver is not already present in ...
Qore::SQL::Datasource::getOption
auto getOption(string opt)
Returns the current value for the given option.
Qore::SQL::Datasource::getServerVersion
auto getServerVersion()
Returns the driver-specific server version data for the current connection.
Qore::SQL::Datasource::getSQLStatement
AbstractSQLStatement getSQLStatement()
Returns an AbstractSQLStatement object based on the current database connection object.
Qore::SQL::Datasource::beginTransaction
nothing beginTransaction()
Manually grabs the transaction lock.
Qore::SQL::Datasource::selectRows
auto selectRows(string sql,...)
Executes an SQL select statement on the server and returns the result as a list (rows) of hashes (the...
Qore::SQL::Datasource::destructor
destructor()
Closes the datasource if it's open (if any operations are in progress, will block until the operation...
Qore::SQL::Datasource::getAutoCommit
bool getAutoCommit()
Returns the autocommit status for the object.
Qore::SQL::Datasource::reset
nothing reset()
Closes and reopens the Datasource.
Qore::SQL::Datasource::execRaw
auto execRaw(string sql)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
Qore::SQL::Datasource::close
nothing close()
Closes the connection to the database; if any actions are in progress on the database,...
Qore::SQL::Datasource::currentThreadInTransaction
bool currentThreadInTransaction()
Returns True if the current thread is in a transaction (i.e. holds the transaction lock),...
Qore::SQL::Datasource::setAutoCommit
nothing setAutoCommit(bool ac=True)
Turns autocommit on or off for this object.
Qore::SQL::Datasource::constructor
constructor(hash< auto > opts, *Qore::Thread::Queue queue, auto arg)
Creates a Datasource object from a hash argument giving parameters for the constructor.
Qore::SQL::Datasource::setDBEncoding
nothing setDBEncoding(string encoding)
Sets the database-specific character encoding name for the next connection to the server.
Qore::SQL::Datasource::getConfigString
string getConfigString()
Returns a string giving the configuration of the current object in a format that can be parsed by par...
Qore::SQL::Datasource::getOSCharset
string getOSCharset()
Returns the Qore character encoding name for the current connection as a string or "(unknown)" if non...
Qore::SQL::Datasource::setUserName
nothing setUserName(string user)
Sets the username parameter for the time a connection to the server is established.
Qore::SQL::Datasource::getCapabilityList
list< auto > getCapabilityList()
Returns a list of strings giving the capabilities of the current DBI driver.
Qore::SQL::Datasource::vselectRows
auto vselectRows(string sql, *softlist< auto > vargs)
Executes a select statement on the server and returns the results in a list (rows) of hashes (column ...
Qore::SQL::Datasource::setPort
nothing setPort(softint port=0)
Sets the port number to use for the connection.
Qore::SQL::Datasource::getDBName
*string getDBName()
Returns the database name parameter as a string or NOTHING if none is set.
Qore::SQL::Datasource::open
nothing open()
Opens a connection to the datasouce, using the connection parameters already set; an exception is thr...
Qore::SQL::Datasource::setDBCharset
nothing setDBCharset(string encoding)
Sets the database-specific character encoding name for the next connection to the server.
Qore::SQL::Datasource::getTransactionLockTimeout
int getTransactionLockTimeout()
Retrieves the transaction lock timeout value as an integer in milliseconds.
Qore::SQL::Datasource::getOSEncoding
*string getOSEncoding()
Returns the Qore character encoding name for the current connection as a string or NOTHING if none is...
Qore::SQL::Datasource::setDBName
nothing setDBName(string db)
Sets the database name parameter for the time a connection to the server is established.
Qore::SQL::Datasource::vselectRow
*hash< auto > vselectRow(string sql, *softlist< auto > vargs)
Executes a select statement on the server and returns the first row as a hash (column names and value...
Qore::SQL::Datasource::commit
nothing commit()
Commits the current transaction and releases the transaction lock.
Qore::SQL::Datasource::clearEventQueue
nothing clearEventQueue()
Clears the queue object for DBI events on the datasource.
Qore::SQL::Datasource::rollback
nothing rollback()
Rolls the current transaction back and releases the transaction lock.
Qore::SQL::Datasource::getDBCharset
*string getDBCharset()
Retrieves the database-specific charset set encoding for the current connection.
Qore::SQL::Datasource::vselect
auto vselect(string sql, *softlist< auto > vargs)
Executes a select statement on the server and returns the results in a hash (column names) of lists (...
Qore::SQL::Datasource::constructor
constructor(string desc, *Qore::Thread::Queue queue, auto arg)
Creates a Datasource object from a single string giving all parameters that can be parsed by parse_da...
Qore::SQL::Datasource::setEventQueue
nothing setEventQueue(Qore::Thread::Queue queue, auto arg)
Sets a queue object for DBI events on the datasource.
Qore::SQL::Datasource::setOption
setOption(string opt, auto val)
sets an option for the datasource
Qore::SQL::Datasource::getPort
*int getPort()
Gets the port number that will be used for the next connection to the server.
Qore::SQL::Datasource::describe
*hash< auto > describe(string sql,...)
Executes an SQL select statement on the server and returns a description of the result set as a hash.
Qore::SQL::Datasource::getCapabilities
int getCapabilities()
Returns an integer bitfield of DBI driver capabilities.
Qore::SQL::Datasource::getPassword
*string getPassword()
Returns the password parameter as a string or NOTHING if none is set.
Qore::SQL::Datasource::vexec
auto vexec(string sql, *softlist< auto > vargs)
Grabs the transaction lock (if autocommit is disabled) and executes SQL code on the DB connection,...
Qore::SQL::Datasource::setTransactionLockTimeout
nothing setTransactionLockTimeout(timeout timeout_ms=0)
Sets the transaction lock timeout value in milliseconds; set to 0 for no timeout.
Qore::SQL::Datasource::getOptionHash
hash< auto > getOptionHash()
returns the valid options for the driver associated with the Datasource with descriptions and current...
Qore::SQL::Datasource::inTransaction
bool inTransaction()
Returns True if a transaction is currently in progress, False if not.
Qore::SQL::Datasource::getDBEncoding
*string getDBEncoding()
Retrieves the database-specific charset set encoding for the current connection.
Qore::SQL::Datasource::transactionTid
int transactionTid()
Returns the TID of the thread holding the transaction lock or -1 if it's not currently held.
Qore::SQL::Datasource::getDriverName
string getDriverName()
Returns the name of the driver used for the object.
Qore::Serializable
The Serializable class can be used to mark a class as being serializable.
Definition QC_Serializable.dox.h:100
Qore::Thread::Queue
Queue objects provide a blocking, thread-safe message-passing object to Qore programs
Definition QC_Queue.dox.h:22
Qore::True
const True
logical True
Definition qc_qore.dox.h:98
Qore::SQL::DSMySQL
const DSMySQL
for the "mysql" driver
Definition QC_Datasource.dox.h:1162
Qore::SQL::DSDB2
const DSDB2
for the "db2" driver
Definition QC_Datasource.dox.h:1154
Qore::SQL::DSJDBC
const DSJDBC
for the "jdbc" driver
Definition QC_Datasource.dox.h:1158
Qore::SQL::DSSQLite3
const DSSQLite3
for the "sqlite3" driver
Definition QC_Datasource.dox.h:1168
Qore::SQL::DSSybase
const DSSybase
for the "sybase" driver
Definition QC_Datasource.dox.h:1170
Qore::SQL::DSFreeTDS
const DSFreeTDS
for the "freetds" driver
Definition QC_Datasource.dox.h:1156
Qore::SQL::DSMSSQL
const DSMSSQL
another constant for the "freetds" driver
Definition QC_Datasource.dox.h:1160
Qore::SQL::DSPGSQL
const DSPGSQL
for the "pgsql" driver
Definition QC_Datasource.dox.h:1166
Qore::SQL::DSOracle
const DSOracle
for the "oracle" driver
Definition QC_Datasource.dox.h:1164
Qore::SQL::DBI_CAP_BIND_BY_VALUE
const DBI_CAP_BIND_BY_VALUE
Indicates that the DBI driver supports directly binding qore values into queries using the %v placeho...
Definition QC_Datasource.dox.h:1183
Qore::SQL::DBI_CAP_CHARSET_SUPPORT
const DBI_CAP_CHARSET_SUPPORT
Indicates that the DBI driver supports proper character encoding conversions.
Definition QC_Datasource.dox.h:1185
Qore::SQL::DBI_CAP_LOB_SUPPORT
const DBI_CAP_LOB_SUPPORT
Indicates that the DBI driver supports LOB columns (BLOBs and CLOBs, for example)
Definition QC_Datasource.dox.h:1207
Qore::SQL::DBI_CAP_HAS_OPTION_SUPPORT
const DBI_CAP_HAS_OPTION_SUPPORT
Indicates that the DBI driver supports the new driver option API.
Definition QC_Datasource.dox.h:1197
Qore::SQL::DBI_CAP_HAS_STATEMENT
const DBI_CAP_HAS_STATEMENT
Indicates that the DBI driver supports the prepared statement interface (the SQLStatement class)
Definition QC_Datasource.dox.h:1205
Qore::SQL::DBI_CAP_TRANSACTION_MANAGEMENT
const DBI_CAP_TRANSACTION_MANAGEMENT
Indicates that the DBI driver supports transaction management.
Definition QC_Datasource.dox.h:1215
Qore::SQL::DBI_CAP_HAS_DESCRIBE
const DBI_CAP_HAS_DESCRIBE
Indicates that the DBI driver supports the describe method.
Definition QC_Datasource.dox.h:1191
Qore::SQL::DBI_CAP_HAS_NUMBER_SUPPORT
const DBI_CAP_HAS_NUMBER_SUPPORT
Indicates that the DBI driver supports arbitrary-precision numeric support for binding and retrieving...
Definition QC_Datasource.dox.h:1195
Qore::SQL::DBI_CAP_HAS_ARRAY_BIND
const DBI_CAP_HAS_ARRAY_BIND
Indicates that the DBI driver supports binding arrays by value for bulk DML operations.
Definition QC_Datasource.dox.h:1189
Qore::SQL::DBI_CAP_HAS_SELECT_ROW
const DBI_CAP_HAS_SELECT_ROW
Indicates that the DBI driver supports a native selectRow() method implementation.
Definition QC_Datasource.dox.h:1203
Qore::SQL::DBI_CAP_HAS_RESULTSET_OUTPUT
const DBI_CAP_HAS_RESULTSET_OUTPUT
Indicates that the DBI driver supports result set output binding with a SQLStatement output variable.
Definition QC_Datasource.dox.h:1201
Qore::SQL::DBI_CAP_SERVER_TIME_ZONE
const DBI_CAP_SERVER_TIME_ZONE
Indicates that the DBI driver supports automatically converting date/time values to the server's pres...
Definition QC_Datasource.dox.h:1209
Qore::SQL::DBI_CAP_TIME_ZONE_SUPPORT
const DBI_CAP_TIME_ZONE_SUPPORT
Indicates that the DBI driver supports time zones in times.
Definition QC_Datasource.dox.h:1213
Qore::SQL::DBI_CAP_STORED_PROCEDURES
const DBI_CAP_STORED_PROCEDURES
Indicates that the DBI driver supports stored procedure execution.
Definition QC_Datasource.dox.h:1211
Qore::SQL::DBI_CAP_BIND_BY_PLACEHOLDER
const DBI_CAP_BIND_BY_PLACEHOLDER
Indicates that the DBI driver supports binding placeholder buffers when executing SQL to retrieve dat...
Definition QC_Datasource.dox.h:1181
Qore::SQL::DBI_CAP_HAS_EXECRAW
const DBI_CAP_HAS_EXECRAW
Indicates that the DBI driver supports the Datasource::execRaw() and DatasourcePool::execRaw() method...
Definition QC_Datasource.dox.h:1193
Qore::SQL::DBI_CAP_EVENTS
const DBI_CAP_EVENTS
Indicates that the DBI driver supports the event API.
Definition QC_Datasource.dox.h:1187
Qore::SQL::DBI_CAP_AUTORECONNECT
const DBI_CAP_AUTORECONNECT
Indicates that the DBI driver supports automatically/transparently reconnecting to the server if the ...
Definition QC_Datasource.dox.h:1179
Qore::hash
hash< auto > hash(object obj)
Returns a hash of an object's members.
Qore::list
list< auto > list(...)
Returns a list of the arguments passed at the top level.
Qore::SQL
SQL namespace.
Definition QC_AbstractDatasource.dox.h:4
Qore
main Qore-language namespace
Definition Pseudo_QC_All.dox.h:3