Qore Programming Language Reference Manual  0.8.8
 All Classes Namespaces Functions Variables Groups Pages
QC_Datasource.dox.h
1 namespace Qore::SQL {
4 
75 
76 public:
78 
92 nothing beginTransaction();
93 
94 public:
96 
105 nothing close();
106 
107 public:
109 
118 nothing commit();
119 
120 public:
122 
140  constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash options);
141 
142 public:
144 
157  constructor(string desc);
158 
159 public:
161 
180  constructor(hash opts);
181 
182 public:
184 
189  copy();
190 
191 public:
193 
208 
209 public:
211 
218  destructor();
219 
220 public:
222 
238 any exec(string sql, ...);
239 
240 public:
242 
260 any execRaw(string sql);
261 
262 public:
264 
274 bool getAutoCommit();
275 
276 public:
278 
290 int getCapabilities();
291 
292 public:
294 
307 
308 public:
310 
319 any getClientVersion();
320 
321 public:
323 
336 
337 public:
339 
351 string getConfigString();
352 
353 public:
355 
367 string getDBCharset();
368 
369 public:
371 
383 string getDBEncoding();
384 
385 public:
387 
397 *string getDBName();
398 
399 public:
401 
411 string getDriverName();
412 
413 public:
415 
425 *string getHostName();
426 
427 public:
429 
441 string getOSCharset();
442 
443 public:
445 
455 *string getOSEncoding();
456 
457 public:
459 
471 any getOption(string opt);
472 
473 public:
475 
490 
491 public:
493 
503 *string getPassword();
504 
505 public:
507 
517 *int getPort();
518 
519 public:
521 
532 any getServerVersion();
533 
534 public:
536 
547 
548 public:
550 
560 *string getUserName();
561 
562 public:
564 
574 bool inTransaction();
575 
576 public:
578 
589 nothing open();
590 
591 public:
593 
602 nothing reset();
603 
604 public:
606 
615 nothing rollback();
616 
617 public:
619 
650 any select(string sql, ...);
651 
652 public:
654 
675 any selectRow(string sql, ...);
676 
677 public:
679 
705 any selectRows(string sql, ...);
706 
707 public:
709 
715 nothing setAutoCommit(bool ac = True);
716 
717 public:
719 
730 nothing setDBCharset(string encoding);
731 
732 public:
734 
743 nothing setDBEncoding(string encoding);
744 
745 public:
747 
756 nothing setDBName(string db);
757 
758 public:
760 
769 nothing setHostName(string host);
770 
771 public:
773 
783  setOption(string opt, any val);
784 
785 public:
787 
796 nothing setPassword(string pass);
797 
798 public:
800 
809 nothing setPort(softint port = 0);
810 
811 public:
813 
820 nothing setTransactionLockTimeout(timeout timeout_ms = 0);
821 
822 public:
824 
833 nothing setUserName(string user);
834 
835 public:
837 
854 int transactionTid();
855 
856 public:
858 
876 any vexec(string sql, *softlist vargs);
877 
878 public:
880 
908 any vselect(string sql, *softlist vargs);
909 
910 public:
912 
934 any vselectRow(string sql, *softlist vargs);
935 
936 public:
938 
966 any vselectRows(string sql, *softlist vargs);
967 };
972 
974  const DSDB2 = "db2";
976  const DSFreeTDS = "freetds";
978  const DSMSSQL = "freetds";
980  const DSMySQL = "mysql";
982  const DSOracle = "oracle";
984  const DSPGSQL = "pgsql";
986  const DSSQLite3 = "sqlite3";
988  const DSSybase = "sybase";
990 
994 
1022 };
string getConfigString()
Returns a string giving the configuration of the current object in a format that can be parsed by par...
any selectRow(string sql,...)
Executes an SQL select statement on the server and returns the first row as a hash (the column values...
any execRaw(string sql)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
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:1004
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:976
int transactionTid()
Returns the TID of the thread holding the transaction lock or -1 if it's not currently held...
nothing setDBCharset(string encoding)
Sets the database-specific character encoding name for the next connection to the server...
const DBI_CAP_HAS_EXECRAW
Indicates that the DBI driver supports the Datasource::execRaw() and DatasourcePool::execRaw() method...
Definition: QC_Datasource.dox.h:1002
*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:1010
const DSMSSQL
another constant for the "freetds" driver
Definition: QC_Datasource.dox.h:978
*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:1012
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:984
bool getAutoCommit()
Returns the autocommit status for the object.
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:986
constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash options)
Creates the Datasource object; attempts to load a DBI driver if the driver is not already present in ...
const DBI_CAP_HAS_OPTION_SUPPORT
Indicates that the DBI driver supports the new driver option API.
Definition: QC_Datasource.dox.h:1006
*string getHostName()
Returns the hostname parameter as a string or NOTHING if none is set.
nothing beginTransaction()
Manually grabs the transaction lock.
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:998
const DBI_CAP_TIME_ZONE_SUPPORT
Indicates that the DBI driver supports time zones in times.
Definition: QC_Datasource.dox.h:1018
const DSSybase
for the "sybase" driver
Definition: QC_Datasource.dox.h:988
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:996
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:1016
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:974
any getOption(string opt)
Returns the current value for the given option.
any 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_TRANSACTION_MANAGEMENT
Indicates that the DBI driver supports transaction management.
Definition: QC_Datasource.dox.h:1020
destructor()
Closes the datasource if it's open (if any operations are in progress, will block until the operation...
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:1014
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:980
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:1008
const DBI_CAP_CHARSET_SUPPORT
Indicates that the DBI driver supports proper character encoding conversions.
Definition: QC_Datasource.dox.h:1000
This class provides the Qore interface to databases.
Definition: QC_Datasource.dox.h:74
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.
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:982
string getDriverName()
Returns the name of the driver used for the object.