Qore Programming Language Reference Manual  1.0.2
QC_Datasource.dox.h
1 namespace Qore {
4 namespace SQL {
6 
107 
108 public:
110 
125 
126 public:
128 
130 nothing clearEventQueue();
131 
132 public:
134 
143 nothing close();
144 
145 public:
147 
156 nothing commit();
157 
158 public:
160 
180  constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash<auto> options, *Qore::Thread::Queue queue, auto arg);
181 
182 public:
184 
199  constructor(string desc, *Qore::Thread::Queue queue, auto arg);
200 
201 public:
203 
224  constructor(hash<auto> opts, *Qore::Thread::Queue queue, auto arg);
225 
226 public:
228 
233  copy();
234 
235 public:
237 
252 
253 public:
255 
280 *hash<auto> describe(string sql, ...);
281 
282 public:
284 
292 
293 public:
295 
311 auto exec(string sql, ...);
312 
313 public:
315 
333 auto execRaw(string sql);
334 
335 public:
337 
348 
349 public:
351 
364 
365 public:
367 
379 list<auto> getCapabilityList();
380 
381 public:
383 
393 
394 public:
396 
411 hash<auto> getConfigHash();
412 
413 public:
415 
431 
432 public:
434 
446 *string getDBCharset();
447 
448 public:
450 
462 *string getDBEncoding();
463 
464 public:
466 
476 *string getDBName();
477 
478 public:
480 
490 string getDriverName();
491 
492 public:
494 
504 *string getHostName();
505 
506 public:
508 
520 string getOSCharset();
521 
522 public:
524 
534 *string getOSEncoding();
535 
536 public:
538 
550 auto getOption(string opt);
551 
552 public:
554 
568 hash<auto> getOptionHash();
569 
570 public:
572 
582 *string getPassword();
583 
584 public:
586 
596 *int getPort();
597 
598 public:
600 
610 
611 public:
613 
625 
626 public:
628 
639 
640 public:
642 
652 *string getUserName();
653 
654 public:
656 
667 
668 public:
670 
681 nothing open();
682 
683 public:
685 
694 nothing reset();
695 
696 public:
698 
707 nothing rollback();
708 
709 public:
711 
744 auto select(string sql, ...);
745 
746 public:
748 
769 *hash<auto> selectRow(string sql, ...);
770 
771 public:
773 
799 auto selectRows(string sql, ...);
800 
801 public:
803 
809 nothing setAutoCommit(bool ac = True);
810 
811 public:
813 
824 nothing setDBCharset(string encoding);
825 
826 public:
828 
837 nothing setDBEncoding(string encoding);
838 
839 public:
841 
850 nothing setDBName(string db);
851 
852 public:
854 
861 nothing setEventQueue(Qore::Thread::Queue queue, auto arg);
862 
863 public:
865 
874 nothing setHostName(string host);
875 
876 public:
878 
889  setOption(string opt, auto val);
890 
891 public:
893 
902 nothing setPassword(string pass);
903 
904 public:
906 
915 nothing setPort(softint port = 0);
916 
917 public:
919 
926 nothing setTransactionLockTimeout(timeout timeout_ms = 0);
927 
928 public:
930 
939 nothing setUserName(string user);
940 
941 public:
943 
961 
962 public:
964 
982 auto vexec(string sql, *softlist<auto> vargs);
983 
984 public:
986 
1016 auto vselect(string sql, *softlist<auto> vargs);
1017 
1018 public:
1020 
1042 *hash<auto> vselectRow(string sql, *softlist<auto> vargs);
1043 
1044 public:
1046 
1074 auto vselectRows(string sql, *softlist<auto> vargs);
1075 };
1079 
1082  const DSDB2 = "db2";
1084  const DSFreeTDS = "freetds";
1086  const DSMSSQL = "freetds";
1088  const DSMySQL = "mysql";
1090  const DSOracle = "oracle";
1092  const DSPGSQL = "pgsql";
1094  const DSSQLite3 = "sqlite3";
1096  const DSSybase = "sybase";
1101 
1124 
1142 }
1143 }
This class defines an abstract interface for database access, inherited by both the Datasource and Da...
Definition: QC_AbstractDatasource.dox.h:10
This class defines an abstract interface for the SQLStatement class.
Definition: QC_AbstractSQLStatement.dox.h:11
This class provides the Qore interface to databases.
Definition: QC_Datasource.dox.h:106
auto getClientVersion()
Retrieves the driver-specific client library version information; this method may not be implemented ...
auto select(string sql,...)
Executes an SQL select statement on the server and returns the result as a hash (column names) of lis...
*string getUserName()
Returns the username parameter as a string or NOTHING if none is set.
*string getHostName()
Returns the hostname parameter as a string or NOTHING if none is set.
*hash< auto > selectRow(string sql,...)
Executes an SQL select statement on the server and returns the first row as a hash (the column values...
copy()
Creates a new Datasource object with the same driver as the original and copies of all the connection...
nothing setPassword(string pass)
Sets the password parameter for the time a connection to the server is established.
auto exec(string sql,...)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
nothing setHostName(string host)
Sets the hostname to use for the next connection to the server.
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 ...
*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...
auto getOption(string opt)
Returns the current value for the given option.
auto getServerVersion()
Returns the driver-specific server version data for the current connection.
AbstractSQLStatement getSQLStatement()
Returns an AbstractSQLStatement object based on the current database connection object.
nothing beginTransaction()
Manually grabs the transaction lock.
auto selectRows(string sql,...)
Executes an SQL select statement on the server and returns the result as a list (rows) of hashes (the...
destructor()
Closes the datasource if it's open (if any operations are in progress, will block until the operation...
bool getAutoCommit()
Returns the autocommit status for the object.
nothing reset()
Closes and reopens the Datasource.
auto execRaw(string sql)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
nothing close()
Closes the connection to the database; if any actions are in progress on the database,...
bool currentThreadInTransaction()
Returns True if the current thread is in a transaction (i.e. holds the transaction lock),...
nothing setAutoCommit(bool ac=True)
Turns autocommit on or off for this object.
constructor(hash< auto > opts, *Qore::Thread::Queue queue, auto arg)
Creates a Datasource object from a hash argument giving parameters for the constructor.
nothing setDBEncoding(string encoding)
Sets the database-specific character encoding name for the next connection to the server.
string getConfigString()
Returns a string giving the configuration of the current object in a format that can be parsed by par...
hash< auto > getConfigHash()
Returns a datasource hash describing the configuration of the current object.
string getOSCharset()
Returns the Qore character encoding name for the current connection as a string or "(unknown)" if non...
nothing setUserName(string user)
Sets the username parameter for the time a connection to the server is established.
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 ...
nothing setPort(softint port=0)
Sets the port number to use for the connection.
*string getDBName()
Returns the database name parameter as a string or NOTHING if none is set.
nothing open()
Opens a connection to the datasouce, using the connection parameters already set; an exception is thr...
nothing setDBCharset(string encoding)
Sets the database-specific character encoding name for the next connection to the server.
int getTransactionLockTimeout()
Retrieves the transaction lock timeout value as an integer in milliseconds.
*string getOSEncoding()
Returns the Qore character encoding name for the current connection as a string or NOTHING if none is...
nothing setDBName(string db)
Sets the database name parameter for the time a connection to the server is established.
nothing commit()
Commits the current transaction and releases the transaction lock.
hash< auto > getOptionHash()
returns the valid options for the driver associated with the Datasource with descriptions and current...
*hash< auto > describe(string sql,...)
Executes an SQL select statement on the server and returns a description of the result set as a hash.
nothing clearEventQueue()
Clears the queue object for DBI events on the datasource.
nothing rollback()
Rolls the current transaction back and releases the transaction lock.
*string getDBCharset()
Retrieves the database-specific charset set encoding for the current connection.
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 (...
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...
nothing setEventQueue(Qore::Thread::Queue queue, auto arg)
Sets a queue object for DBI events on the datasource.
setOption(string opt, auto val)
sets an option for the datasource
*int getPort()
Gets the port number that will be used for the next connection to the server.
int getCapabilities()
Returns an integer bitfield of DBI driver capabilities.
*string getPassword()
Returns the password parameter as a string or NOTHING if none is set.
auto vexec(string sql, *softlist< auto > vargs)
Grabs the transaction lock (if autocommit is disabled) and executes SQL code on the DB connection,...
nothing setTransactionLockTimeout(timeout timeout_ms=0)
Sets the transaction lock timeout value in milliseconds; set to 0 for no timeout.
list< auto > getCapabilityList()
Returns a list of strings giving the capabilities of the current DBI driver.
bool inTransaction()
Returns True if a transaction is currently in progress, False if not.
*string getDBEncoding()
Retrieves the database-specific charset set encoding for the current connection.
int transactionTid()
Returns the TID of the thread holding the transaction lock or -1 if it's not currently held.
string getDriverName()
Returns the name of the driver used for the object.
The Serializable class can be used to mark a class as being serializable.
Definition: QC_Serializable.dox.h:96
Queue objects provide a blocking, thread-safe message-passing object to Qore programs
Definition: QC_Queue.dox.h:22
const True
logical True
Definition: qc_qore.dox.h:98
const DSMySQL
for the "mysql" driver
Definition: QC_Datasource.dox.h:1088
const DSDB2
for the "db2" driver
Definition: QC_Datasource.dox.h:1082
const DSSQLite3
for the "sqlite3" driver
Definition: QC_Datasource.dox.h:1094
const DSSybase
for the "sybase" driver
Definition: QC_Datasource.dox.h:1096
const DSFreeTDS
for the "freetds" driver
Definition: QC_Datasource.dox.h:1084
const DSMSSQL
another constant for the "freetds" driver
Definition: QC_Datasource.dox.h:1086
const DSPGSQL
for the "pgsql" driver
Definition: QC_Datasource.dox.h:1092
const DSOracle
for the "oracle" driver
Definition: QC_Datasource.dox.h:1090
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:1108
const DBI_CAP_CHARSET_SUPPORT
Indicates that the DBI driver supports proper character encoding conversions.
Definition: QC_Datasource.dox.h:1110
const DBI_CAP_LOB_SUPPORT
Indicates that the DBI driver supports LOB columns (BLOBs and CLOBs, for example)
Definition: QC_Datasource.dox.h:1132
const DBI_CAP_HAS_OPTION_SUPPORT
Indicates that the DBI driver supports the new driver option API.
Definition: QC_Datasource.dox.h:1122
const DBI_CAP_HAS_STATEMENT
Indicates that the DBI driver supports the prepared statement interface (the SQLStatement class)
Definition: QC_Datasource.dox.h:1130
const DBI_CAP_TRANSACTION_MANAGEMENT
Indicates that the DBI driver supports transaction management.
Definition: QC_Datasource.dox.h:1140
const DBI_CAP_HAS_DESCRIBE
Indicates that the DBI driver supports the describe method.
Definition: QC_Datasource.dox.h:1116
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:1120
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:1114
const DBI_CAP_HAS_SELECT_ROW
Indicates that the DBI driver supports a native selectRow() method implementation.
Definition: QC_Datasource.dox.h:1128
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:1126
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:1134
const DBI_CAP_TIME_ZONE_SUPPORT
Indicates that the DBI driver supports time zones in times.
Definition: QC_Datasource.dox.h:1138
const DBI_CAP_STORED_PROCEDURES
Indicates that the DBI driver supports stored procedure execution.
Definition: QC_Datasource.dox.h:1136
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:1106
const DBI_CAP_HAS_EXECRAW
Indicates that the DBI driver supports the Datasource::execRaw() and DatasourcePool::execRaw() method...
Definition: QC_Datasource.dox.h:1118
const DBI_CAP_EVENTS
Indicates that the DBI driver supports the event API.
Definition: QC_Datasource.dox.h:1112
const DBI_CAP_AUTORECONNECT
Indicates that the DBI driver supports automatically/transparently reconnecting to the server if the ...
Definition: QC_Datasource.dox.h:1104
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3