Qore Programming Language Reference Manual  0.8.12.2
 All Classes Namespaces Functions Variables Groups Pages
QC_Datasource.dox.h
1 namespace Qore::SQL {
4 
73 
74 public:
76 
90 nothing beginTransaction();
91 
92 public:
94 
96 nothing clearEventQueue();
97 
98 public:
100 
109 nothing close();
110 
111 public:
113 
122 nothing commit();
123 
124 public:
126 
146  constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash options, *Qore::Thread::Queue queue, any arg);
147 
148 public:
150 
165  constructor(string desc, *Qore::Thread::Queue queue, any arg);
166 
167 public:
169 
190  constructor(hash opts, *Qore::Thread::Queue queue, any arg);
191 
192 public:
194 
199  copy();
200 
201 public:
203 
218 
219 public:
221 
246 *hash describe(string sql, ...);
247 
248 public:
250 
257  destructor();
258 
259 public:
261 
277 any exec(string sql, ...);
278 
279 public:
281 
299 any execRaw(string sql);
300 
301 public:
303 
313 bool getAutoCommit();
314 
315 public:
317 
329 int getCapabilities();
330 
331 public:
333 
346 
347 public:
349 
358 any getClientVersion();
359 
360 public:
362 
375 
376 public:
378 
390 string getConfigString();
391 
392 public:
394 
406 string getDBCharset();
407 
408 public:
410 
422 string getDBEncoding();
423 
424 public:
426 
436 *string getDBName();
437 
438 public:
440 
450 string getDriverName();
451 
452 public:
454 
464 *string getHostName();
465 
466 public:
468 
480 string getOSCharset();
481 
482 public:
484 
494 *string getOSEncoding();
495 
496 public:
498 
510 any getOption(string opt);
511 
512 public:
514 
529 
530 public:
532 
542 *string getPassword();
543 
544 public:
546 
556 *int getPort();
557 
558 public:
560 
571 any getServerVersion();
572 
573 public:
575 
586 
587 public:
589 
599 *string getUserName();
600 
601 public:
603 
613 bool inTransaction();
614 
615 public:
617 
628 nothing open();
629 
630 public:
632 
641 nothing reset();
642 
643 public:
645 
654 nothing rollback();
655 
656 public:
658 
689 any select(string sql, ...);
690 
691 public:
693 
714 *hash selectRow(string sql, ...);
715 
716 public:
718 
744 any selectRows(string sql, ...);
745 
746 public:
748 
754 nothing setAutoCommit(bool ac = True);
755 
756 public:
758 
769 nothing setDBCharset(string encoding);
770 
771 public:
773 
782 nothing setDBEncoding(string encoding);
783 
784 public:
786 
795 nothing setDBName(string db);
796 
797 public:
799 
806 nothing setEventQueue(Qore::Thread::Queue queue, any arg);
807 
808 public:
810 
819 nothing setHostName(string host);
820 
821 public:
823 
833  setOption(string opt, any val);
834 
835 public:
837 
846 nothing setPassword(string pass);
847 
848 public:
850 
859 nothing setPort(softint port = 0);
860 
861 public:
863 
870 nothing setTransactionLockTimeout(timeout timeout_ms = 0);
871 
872 public:
874 
883 nothing setUserName(string user);
884 
885 public:
887 
904 int transactionTid();
905 
906 public:
908 
926 any vexec(string sql, *softlist vargs);
927 
928 public:
930 
958 any vselect(string sql, *softlist vargs);
959 
960 public:
962 
984 *hash vselectRow(string sql, *softlist vargs);
985 
986 public:
988 
1016 any vselectRows(string sql, *softlist vargs);
1017 };
1022 
1024  const DSDB2 = "db2";
1026  const DSFreeTDS = "freetds";
1028  const DSMSSQL = "freetds";
1030  const DSMySQL = "mysql";
1032  const DSOracle = "oracle";
1034  const DSPGSQL = "pgsql";
1036  const DSSQLite3 = "sqlite3";
1038  const DSSybase = "sybase";
1040 
1044 
1080 };
string getConfigString()
Returns a string giving the configuration of the current object in a format that can be parsed by par...
any execRaw(string sql)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
*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...
constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash options, *Qore::Thread::Queue queue, any arg)
Creates the Datasource object; attempts to load a DBI driver if the driver is not already present in ...
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:1062
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:1026
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:1046
nothing setEventQueue(Qore::Thread::Queue queue, any arg)
Sets a queue object for DBI events on the datasource.
const DBI_CAP_HAS_EXECRAW
Indicates that the DBI driver supports the Datasource::execRaw() and DatasourcePool::execRaw() method...
Definition: QC_Datasource.dox.h:1060
*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:1068
const DSMSSQL
another constant for the "freetds" driver
Definition: QC_Datasource.dox.h:1028
*string getOSEncoding()
Returns the Qore character encoding name for the current connection as a string or NOTHING if none is...
any vselectRows(string sql, *softlist vargs)
Executes a select statement on the server and returns the results in a list (rows) of hashes (column ...
const DBI_CAP_LOB_SUPPORT
Indicates that the DBI driver supports LOB columns (BLOBs and CLOBs, for example) ...
Definition: QC_Datasource.dox.h:1070
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.
const DSPGSQL
for the "pgsql" driver
Definition: QC_Datasource.dox.h:1034
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:1058
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 a 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.
setOption(string opt, any val)
sets an option for the datasource
const DSSQLite3
for the "sqlite3" driver
Definition: QC_Datasource.dox.h:1036
const DBI_CAP_HAS_OPTION_SUPPORT
Indicates that the DBI driver supports the new driver option API.
Definition: QC_Datasource.dox.h:1064
*string getHostName()
Returns the hostname parameter as a string or NOTHING if none is set.
nothing beginTransaction()
Manually grabs the transaction lock.
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:1050
const DBI_CAP_TIME_ZONE_SUPPORT
Indicates that the DBI driver supports time zones in times.
Definition: QC_Datasource.dox.h:1076
const DSSybase
for the "sybase" driver
Definition: QC_Datasource.dox.h:1038
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.
any select(string sql,...)
Executes an SQL select statement on the server and returns the result as a hash (column names) of lis...
bool currentThreadInTransaction()
Returns True if the current thread is in a transaction (i.e. holds the transaction lock)...
any selectRows(string sql,...)
Executes an SQL select statement on the server and returns the result as a list (rows) of hashes (the...
nothing open()
Opens a connection to the datasouce, using the connection parameters already set; an exception is thr...
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:1048
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:1074
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.
nothing commit()
Commits the current transaction and releases the transaction lock.
const DSDB2
for the "db2" driver
Definition: QC_Datasource.dox.h:1024
Queue objects provide a blocking, thread-safe message-passing object to Qore programs ...
Definition: QC_Queue.dox.h:15
any getOption(string opt)
Returns the current value for the given option.
const DBI_CAP_TRANSACTION_MANAGEMENT
Indicates that the DBI driver supports transaction management.
Definition: QC_Datasource.dox.h:1078
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:1056
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:1072
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.
any getClientVersion()
Retrieves the driver-specific client library version information; this method may not be implemented ...
*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:1030
*hash describe(string sql,...)
Executes an SQL select statement on the server and returns a description of the result set as a hash...
any vexec(string sql, *softlist vargs)
Grabs the transaction lock (if autocommit is disabled) and executes SQL code on the DB connection...
const DBI_CAP_HAS_SELECT_ROW
Indicates that the DBI driver supports a native selectRow() method implementation.
Definition: QC_Datasource.dox.h:1066
const DBI_CAP_CHARSET_SUPPORT
Indicates that the DBI driver supports proper character encoding conversions.
Definition: QC_Datasource.dox.h:1052
This class provides the Qore interface to databases.
Definition: QC_Datasource.dox.h:72
any getServerVersion()
Returns the driver-specific server version data for the current connection.
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:1054
copy()
Creates a new Datasource object with the same driver as the original and copies of all the connection...
any exec(string sql,...)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
any vselect(string sql, *softlist vargs)
Executes a select statement on the server and returns the results in a hash (column names) of lists (...
const DSOracle
for the "oracle" driver
Definition: QC_Datasource.dox.h:1032
string getDriverName()
Returns the name of the driver used for the object.