Qore Programming Language Reference Manual  0.9.4.3
QC_Datasource.dox.h
1 namespace Qore {
4 namespace SQL {
6 
106 
107 public:
109 
123 nothing beginTransaction();
124 
125 public:
127 
129 nothing clearEventQueue();
130 
131 public:
133 
142 nothing close();
143 
144 public:
146 
155 nothing commit();
156 
157 public:
159 
179  constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash<auto> options, *Qore::Thread::Queue queue, auto arg);
180 
181 public:
183 
198  constructor(string desc, *Qore::Thread::Queue queue, auto arg);
199 
200 public:
202 
223  constructor(hash<auto> opts, *Qore::Thread::Queue queue, auto arg);
224 
225 public:
227 
232  copy();
233 
234 public:
236 
251 
252 public:
254 
279 *hash<auto> describe(string sql, ...);
280 
281 public:
283 
290  destructor();
291 
292 public:
294 
310 auto exec(string sql, ...);
311 
312 public:
314 
332 auto execRaw(string sql);
333 
334 public:
336 
346 bool getAutoCommit();
347 
348 public:
350 
362 int getCapabilities();
363 
364 public:
366 
378 list<auto> getCapabilityList();
379 
380 public:
382 
391 auto getClientVersion();
392 
393 public:
395 
410 hash<auto> getConfigHash();
411 
412 public:
414 
429 string getConfigString();
430 
431 public:
433 
445 *string getDBCharset();
446 
447 public:
449 
461 *string getDBEncoding();
462 
463 public:
465 
475 *string getDBName();
476 
477 public:
479 
489 string getDriverName();
490 
491 public:
493 
503 *string getHostName();
504 
505 public:
507 
519 string getOSCharset();
520 
521 public:
523 
533 *string getOSEncoding();
534 
535 public:
537 
549 auto getOption(string opt);
550 
551 public:
553 
567 hash<auto> getOptionHash();
568 
569 public:
571 
581 *string getPassword();
582 
583 public:
585 
595 *int getPort();
596 
597 public:
599 
609 
610 public:
612 
623 auto getServerVersion();
624 
625 public:
627 
638 
639 public:
641 
651 *string getUserName();
652 
653 public:
655 
665 bool inTransaction();
666 
667 public:
669 
680 nothing open();
681 
682 public:
684 
693 nothing reset();
694 
695 public:
697 
706 nothing rollback();
707 
708 public:
710 
743 auto select(string sql, ...);
744 
745 public:
747 
768 *hash<auto> selectRow(string sql, ...);
769 
770 public:
772 
798 auto selectRows(string sql, ...);
799 
800 public:
802 
808 nothing setAutoCommit(bool ac = True);
809 
810 public:
812 
823 nothing setDBCharset(string encoding);
824 
825 public:
827 
836 nothing setDBEncoding(string encoding);
837 
838 public:
840 
849 nothing setDBName(string db);
850 
851 public:
853 
860 nothing setEventQueue(Qore::Thread::Queue queue, auto arg);
861 
862 public:
864 
873 nothing setHostName(string host);
874 
875 public:
877 
888  setOption(string opt, auto val);
889 
890 public:
892 
901 nothing setPassword(string pass);
902 
903 public:
905 
914 nothing setPort(softint port = 0);
915 
916 public:
918 
925 nothing setTransactionLockTimeout(timeout timeout_ms = 0);
926 
927 public:
929 
938 nothing setUserName(string user);
939 
940 public:
942 
959 int transactionTid();
960 
961 public:
963 
981 auto vexec(string sql, *softlist<auto> vargs);
982 
983 public:
985 
1015 auto vselect(string sql, *softlist<auto> vargs);
1016 
1017 public:
1019 
1041 *hash<auto> vselectRow(string sql, *softlist<auto> vargs);
1042 
1043 public:
1045 
1073 auto vselectRows(string sql, *softlist<auto> vargs);
1074 };
1080  const DSDB2 = "db2";
1083  const DSFreeTDS = "freetds";
1085  const DSMSSQL = "freetds";
1087  const DSMySQL = "mysql";
1089  const DSOracle = "oracle";
1091  const DSPGSQL = "pgsql";
1093  const DSSQLite3 = "sqlite3";
1095  const DSSybase = "sybase";
1123 
1141 }
1142 }
Qore::SQL::Datasource::getHostName
*string getHostName()
Returns the hostname parameter as a string or NOTHING if none is set.
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:1135
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::setAutoCommit
nothing setAutoCommit(bool ac=True)
Turns autocommit on or off for this object.
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:1125
Qore::Serializable
The Serializable class can be used to mark a class as being serializable.
Definition: QC_Serializable.dox.h:96
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:1121
Qore::SQL::Datasource::getPassword
*string getPassword()
Returns the password parameter as a string or NOTHING if none is set.
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::getDBEncoding
*string getDBEncoding()
Retrieves the database-specific charset set encoding for the current connection.
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:1109
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::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::getCapabilityList
list< auto > getCapabilityList()
Returns a list of strings giving the capabilities of the current DBI driver.
Qore::SQL::DSSQLite3
const DSSQLite3
for the "sqlite3" driver
Definition: QC_Datasource.dox.h:1093
Qore::SQL::Datasource::getDBName
*string getDBName()
Returns the database name parameter as a string or NOTHING if none is set.
Qore::SQL::DBI_CAP_EVENTS
const DBI_CAP_EVENTS
Indicates that the DBI driver supports the event API.
Definition: QC_Datasource.dox.h:1111
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:1127
Qore::SQL::Datasource::getOSCharset
string getOSCharset()
Returns the Qore character encoding name for the current connection as a string or "(unknown)" if non...
Qore::Serializable::constructor
constructor()
The constructor does not perform any action; this class is just used to mark a class as serializable ...
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:1133
Qore::True
const True
logical True
Definition: qc_qore.dox.h:98
Qore::SQL::DBI_CAP_TRANSACTION_MANAGEMENT
const DBI_CAP_TRANSACTION_MANAGEMENT
Indicates that the DBI driver supports transaction management.
Definition: QC_Datasource.dox.h:1139
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::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:1113
Qore::SQL::DSMSSQL
const DSMSSQL
another constant for the "freetds" driver
Definition: QC_Datasource.dox.h:1085
Qore::SQL::Datasource::copy
copy()
Creates a new Datasource object with the same driver as the original and copies of all the connection...
Qore::Thread::Queue
Queue objects provide a blocking, thread-safe message-passing object to Qore programs
Definition: QC_Queue.dox.h:17
Qore::SQL::DSPGSQL
const DSPGSQL
for the "pgsql" driver
Definition: QC_Datasource.dox.h:1091
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::getDBCharset
*string getDBCharset()
Retrieves the database-specific charset set encoding for the current connection.
Qore::SQL::Datasource::inTransaction
bool inTransaction()
Returns True if a transaction is currently in progress, False if not.
Qore::SQL::Datasource::currentThreadInTransaction
bool currentThreadInTransaction()
Returns True if the current thread is in a transaction (i.e. holds the transaction lock),...
Qore::SQL::DSMySQL
const DSMySQL
for the "mysql" driver
Definition: QC_Datasource.dox.h:1087
Qore::SQL::Datasource::beginTransaction
nothing beginTransaction()
Manually grabs the transaction lock.
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:1119
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::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::Datasource
This class provides the Qore interface to databases.
Definition: QC_Datasource.dox.h:105
Qore::SQL::Datasource::getConfigHash
hash< auto > getConfigHash()
Returns a datasource hash describing the configuration of the current object.
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::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::setEventQueue
nothing setEventQueue(Qore::Thread::Queue queue, auto arg)
Sets a queue object for DBI events on the datasource.
Qore::SQL::Datasource::reset
nothing reset()
Closes and reopens the Datasource.
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::getOption
auto getOption(string opt)
Returns the current value for the given option.
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::close
nothing close()
Closes the connection to the database; if any actions are in progress on the database,...
Qore::SQL::DSFreeTDS
const DSFreeTDS
for the "freetds" driver
Definition: QC_Datasource.dox.h:1083
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:1129
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:1103
Qore::SQL::Datasource::getClientVersion
auto getClientVersion()
Retrieves the driver-specific client library version information; this method may not be implemented ...
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::getAutoCommit
bool getAutoCommit()
Returns the autocommit status for the object.
Qore::SQL::Datasource::commit
nothing commit()
Commits the current transaction and releases the transaction lock.
Qore::SQL::Datasource::getCapabilities
int getCapabilities()
Returns an integer bitfield of DBI driver capabilities.
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:1117
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::getServerVersion
auto getServerVersion()
Returns the driver-specific server version data for the current connection.
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:1131
Qore::SQL::Datasource::setDBCharset
nothing setDBCharset(string encoding)
Sets the database-specific character encoding name for the next connection to the server.
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:1137
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:1115
Qore::SQL::Datasource::setPort
nothing setPort(softint port=0)
Sets the port number to use for the connection.
Qore::SQL::Datasource::getPort
*int getPort()
Gets the port number that will be used for the next connection to the server.
Qore::SQL::Datasource::getSQLStatement
AbstractSQLStatement getSQLStatement()
Returns an AbstractSQLStatement object based on the current database connection object.
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::DSOracle
const DSOracle
for the "oracle" driver
Definition: QC_Datasource.dox.h:1089
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::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::rollback
nothing rollback()
Rolls the current transaction back and releases the transaction lock.
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::setHostName
nothing setHostName(string host)
Sets the hostname to use for the next connection to the server.
Qore::SQL::AbstractSQLStatement
This class defines an abstract interface for the SQLStatement class.
Definition: QC_AbstractSQLStatement.dox.h:11
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::clearEventQueue
nothing clearEventQueue()
Clears the queue object for DBI events on the datasource.
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::setPassword
nothing setPassword(string pass)
Sets the password parameter for the time a connection to the server is established.
Qore::SQL::Datasource::getTransactionLockTimeout
int getTransactionLockTimeout()
Retrieves the transaction lock timeout value as an integer in milliseconds.
Qore::SQL::Datasource::setOption
setOption(string opt, auto val)
sets an option for the datasource
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::getUserName
*string getUserName()
Returns the username parameter as a string or NOTHING if none is set.
Qore::SQL::DSDB2
const DSDB2
for the "db2" driver
Definition: QC_Datasource.dox.h:1081
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
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:1107
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:1105
Qore::SQL::DSSybase
const DSSybase
for the "sybase" driver
Definition: QC_Datasource.dox.h:1095
Qore::SQL::Datasource::getDriverName
string getDriverName()
Returns the name of the driver used for the object.