Qore Programming Language Reference Manual  0.8.13.2
QC_Datasource.dox.h
1 namespace Qore::SQL {
4 
97 
98 public:
100 
114 nothing beginTransaction();
115 
116 public:
118 
120 nothing clearEventQueue();
121 
122 public:
124 
133 nothing close();
134 
135 public:
137 
146 nothing commit();
147 
148 public:
150 
170  constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash options, *Qore::Thread::Queue queue, auto arg);
171 
172 public:
174 
189  constructor(string desc, *Qore::Thread::Queue queue, auto arg);
190 
191 public:
193 
214  constructor(hash opts, *Qore::Thread::Queue queue, auto arg);
215 
216 public:
218 
223  copy();
224 
225 public:
227 
242 
243 public:
245 
270 *hash describe(string sql, ...);
271 
272 public:
274 
281  destructor();
282 
283 public:
285 
301 auto exec(string sql, ...);
302 
303 public:
305 
323 auto execRaw(string sql);
324 
325 public:
327 
337 bool getAutoCommit();
338 
339 public:
341 
353 int getCapabilities();
354 
355 public:
357 
370 
371 public:
373 
382 auto getClientVersion();
383 
384 public:
386 
399 
400 public:
402 
414 string getConfigString();
415 
416 public:
418 
430 string getDBCharset();
431 
432 public:
434 
446 string getDBEncoding();
447 
448 public:
450 
460 *string getDBName();
461 
462 public:
464 
474 string getDriverName();
475 
476 public:
478 
488 *string getHostName();
489 
490 public:
492 
504 string getOSCharset();
505 
506 public:
508 
518 *string getOSEncoding();
519 
520 public:
522 
534 auto getOption(string opt);
535 
536 public:
538 
553 
554 public:
556 
566 *string getPassword();
567 
568 public:
570 
580 *int getPort();
581 
582 public:
584 
595 auto getServerVersion();
596 
597 public:
599 
610 
611 public:
613 
623 *string getUserName();
624 
625 public:
627 
637 bool inTransaction();
638 
639 public:
641 
652 nothing open();
653 
654 public:
656 
665 nothing reset();
666 
667 public:
669 
678 nothing rollback();
679 
680 public:
682 
715 auto select(string sql, ...);
716 
717 public:
719 
740 *hash selectRow(string sql, ...);
741 
742 public:
744 
770 auto selectRows(string sql, ...);
771 
772 public:
774 
780 nothing setAutoCommit(bool ac = True);
781 
782 public:
784 
795 nothing setDBCharset(string encoding);
796 
797 public:
799 
808 nothing setDBEncoding(string encoding);
809 
810 public:
812 
821 nothing setDBName(string db);
822 
823 public:
825 
832 nothing setEventQueue(Qore::Thread::Queue queue, auto arg);
833 
834 public:
836 
845 nothing setHostName(string host);
846 
847 public:
849 
859  setOption(string opt, auto val);
860 
861 public:
863 
872 nothing setPassword(string pass);
873 
874 public:
876 
885 nothing setPort(softint port = 0);
886 
887 public:
889 
896 nothing setTransactionLockTimeout(timeout timeout_ms = 0);
897 
898 public:
900 
909 nothing setUserName(string user);
910 
911 public:
913 
930 int transactionTid();
931 
932 public:
934 
952 auto vexec(string sql, *softlist vargs);
953 
954 public:
956 
986 auto vselect(string sql, *softlist vargs);
987 
988 public:
990 
1012 *hash vselectRow(string sql, *softlist vargs);
1013 
1014 public:
1016 
1044 auto vselectRows(string sql, *softlist vargs);
1045 };
1050 
1052  const DSDB2 = "db2";
1054  const DSFreeTDS = "freetds";
1056  const DSMSSQL = "freetds";
1058  const DSMySQL = "mysql";
1060  const DSOracle = "oracle";
1062  const DSPGSQL = "pgsql";
1064  const DSSQLite3 = "sqlite3";
1066  const DSSybase = "sybase";
1068 
1072 
1094 
1112 };
string getConfigString()
Returns a string giving the configuration of the current object in a format that can be parsed by par...
auto select(string sql,...)
Executes an SQL select statement on the server and returns the result as a hash (column names) of lis...
auto vselectRows(string sql, *softlist vargs)
Executes a select statement on the server and returns the results in a list (rows) of hashes (column ...
auto selectRows(string sql,...)
Executes an SQL select statement on the server and returns the result as a list (rows) of hashes (the...
*hash vselectRow(string sql, *softlist vargs)
Executes a select statement on the server and returns the first row as a hash (column names and value...
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:1090
constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash 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 ...
nothing setPort(softint port=0)
Sets the port number to use for the connection.
const DSFreeTDS
for the "freetds" driver
Definition: QC_Datasource.dox.h:1054
int transactionTid()
Returns the TID of the thread holding the transaction lock or -1 if it's not currently held...
*hash selectRow(string sql,...)
Executes an SQL select statement on the server and returns the first row as a hash (the column values...
nothing setDBCharset(string encoding)
Sets the database-specific character encoding name for the next connection to the server...
const DBI_CAP_AUTORECONNECT
Indicates that the DBI driver supports automatically/transparently reconnecting to the server if the ...
Definition: QC_Datasource.dox.h:1074
const DBI_CAP_HAS_EXECRAW
Indicates that the DBI driver supports the Datasource::execRaw() and DatasourcePool::execRaw() method...
Definition: QC_Datasource.dox.h:1088
*string getPassword()
Returns the password parameter as a string or NOTHING if none is set.
const DBI_CAP_HAS_STATEMENT
Indicates that the DBI driver supports the prepared statement interface (the SQLStatement class) ...
Definition: QC_Datasource.dox.h:1100
const DSMSSQL
another constant for the "freetds" driver
Definition: QC_Datasource.dox.h:1056
*string getOSEncoding()
Returns the Qore character encoding name for the current connection as a string or NOTHING if none is...
auto execRaw(string sql)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
const DBI_CAP_LOB_SUPPORT
Indicates that the DBI driver supports LOB columns (BLOBs and CLOBs, for example) ...
Definition: QC_Datasource.dox.h:1102
nothing rollback()
Rolls the current transaction back and releases the transaction lock.
const True
logical True
Definition: qc_qore.dox.h:94
nothing setHostName(string host)
Sets the hostname to use for the next connection to the server.
int getCapabilities()
Returns an integer bitfield of DBI driver capabilities.
Qore::SQL namespace.
Definition: QC_AbstractDatasource.dox.h:2
const DSPGSQL
for the "pgsql" driver
Definition: QC_Datasource.dox.h:1062
bool getAutoCommit()
Returns the autocommit status for the object.
const DBI_CAP_HAS_DESCRIBE
Indicates that the DBI driver supports the describe method.
Definition: QC_Datasource.dox.h:1086
string getDBCharset()
Retrieves the database-specific charset set encoding for the current connection.
hash getConfigHash()
Returns a datasource hash describing the configuration of the current object.
This class defines an abstract interface for database access, inherited by both the Datasource and Da...
Definition: QC_AbstractDatasource.dox.h:8
list list(...)
Returns an untyped list of the arguments passed at the top level.
hash getOptionHash()
returns the valid options for the driver associated with the Datasource with descriptions and current...
*int getPort()
Gets the port number that will be used for the next connection to the server.
const DSSQLite3
for the "sqlite3" driver
Definition: QC_Datasource.dox.h:1064
const DBI_CAP_HAS_OPTION_SUPPORT
Indicates that the DBI driver supports the new driver option API.
Definition: QC_Datasource.dox.h:1092
*string getHostName()
Returns the hostname parameter as a string or NOTHING if none is set.
nothing beginTransaction()
Manually grabs the transaction lock.
auto exec(string sql,...)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
nothing clearEventQueue()
Clears the queue object for DBI events on the datasource.
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:1078
const DBI_CAP_TIME_ZONE_SUPPORT
Indicates that the DBI driver supports time zones in times.
Definition: QC_Datasource.dox.h:1108
const DSSybase
for the "sybase" driver
Definition: QC_Datasource.dox.h:1066
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:1096
list getCapabilityList()
Returns a list of strings giving the capabilities of the current DBI driver.
nothing setPassword(string pass)
Sets the password parameter for the time a connection to the server is established.
setOption(string opt, auto val)
sets an option for the datasource
bool currentThreadInTransaction()
Returns True if the current thread is in a transaction (i.e. holds the transaction lock)...
nothing open()
Opens a connection to the datasouce, using the connection parameters already set; an exception is thr...
nothing setEventQueue(Qore::Thread::Queue queue, auto arg)
Sets a queue object for DBI events on the datasource.
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:1076
nothing reset()
Closes and reopens the Datasource.
nothing setDBEncoding(string encoding)
Sets the database-specific character encoding name for the next connection to the server...
nothing close()
Closes the connection to the database; if any actions are in progress on the database, the close call will block until the actions complete. If any errors are encountered, an exception is raised.
const DBI_CAP_STORED_PROCEDURES
Indicates that the DBI driver supports stored procedure execution.
Definition: QC_Datasource.dox.h:1106
auto getClientVersion()
Retrieves the driver-specific client library version information; this method may not be implemented ...
string getOSCharset()
Returns the Qore character encoding name for the current connection as a string or "(unknown)" if non...
nothing setAutoCommit(bool ac=True)
Turns autocommit on or off for this object.
auto vselect(string sql, *softlist vargs)
Executes a select statement on the server and returns the results in a hash (column names) of lists (...
auto vexec(string sql, *softlist vargs)
Grabs the transaction lock (if autocommit is disabled) and executes SQL code on the DB connection...
nothing commit()
Commits the current transaction and releases the transaction lock.
const DSDB2
for the "db2" driver
Definition: QC_Datasource.dox.h:1052
Queue objects provide a blocking, thread-safe message-passing object to Qore programs ...
Definition: QC_Queue.dox.h:15
auto getServerVersion()
Returns the driver-specific server version data for the current connection.
const DBI_CAP_TRANSACTION_MANAGEMENT
Indicates that the DBI driver supports transaction management.
Definition: QC_Datasource.dox.h:1110
destructor()
Closes the datasource if it's open (if any operations are in progress, will block until the operation...
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:1084
bool inTransaction()
Returns True if a transaction is currently in progress, False if not.
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:1104
nothing setTransactionLockTimeout(timeout timeout_ms=0)
Sets the transaction lock timeout value in milliseconds; set to 0 for no timeout. ...
*string getDBName()
Returns the database name parameter as a string or NOTHING if none is set.
nothing setDBName(string db)
Sets the database name parameter for the time a connection to the server is established.
int getTransactionLockTimeout()
Retrieves the transaction lock timeout value as an integer in milliseconds.
*string getUserName()
Returns the username parameter as a string or NOTHING if none is set.
nothing setUserName(string user)
Sets the username parameter for the time a connection to the server is established.
hash hash(object obj)
Returns a hash of an object's members.
const DSMySQL
for the "mysql" driver
Definition: QC_Datasource.dox.h:1058
*hash describe(string sql,...)
Executes an SQL select statement on the server and returns a description of the result set as a hash...
const DBI_CAP_HAS_SELECT_ROW
Indicates that the DBI driver supports a native selectRow() method implementation.
Definition: QC_Datasource.dox.h:1098
const DBI_CAP_CHARSET_SUPPORT
Indicates that the DBI driver supports proper character encoding conversions.
Definition: QC_Datasource.dox.h:1080
This class provides the Qore interface to databases.
Definition: QC_Datasource.dox.h:96
string getDBEncoding()
Retrieves the database-specific charset set encoding for the current connection.
const DBI_CAP_EVENTS
Indicates that the DBI driver supports the event API.
Definition: QC_Datasource.dox.h:1082
copy()
Creates a new Datasource object with the same driver as the original and copies of all the connection...
const DSOracle
for the "oracle" driver
Definition: QC_Datasource.dox.h:1060
string getDriverName()
Returns the name of the driver used for the object.
auto getOption(string opt)
Returns the current value for the given option.