Qore Programming Language Reference Manual 0.8.10

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

All Classes Namespaces Functions Variables Groups Pages
QC_Datasource.dox.h
1 namespace Qore::SQL {
4
74 class Datasource : public AbstractDatasource {
75
76 public:
78
92 nothing beginTransaction();
93
94 public:
96
98 nothing clearEventQueue();
99
100 public:
102
111 nothing close();
112
113 public:
115
124 nothing commit();
125
126 public:
128
148 constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, *softint port, *hash options, *Qore::Thread::Queue queue, any arg);
149
150 public:
152
167 constructor(string desc, *Qore::Thread::Queue queue, any arg);
168
169 public:
171
192 constructor(hash opts, *Qore::Thread::Queue queue, any arg);
193
194 public:
196
201 copy();
202
203 public:
205
219 bool currentThreadInTransaction();
220
221 public:
223
248 *hash describe(string sql, ...);
249
250 public:
252
259 destructor();
260
261 public:
263
279 any exec(string sql, ...);
280
281 public:
283
301 any execRaw(string sql);
302
303 public:
305
315 bool getAutoCommit();
316
317 public:
319
331 int getCapabilities();
332
333 public:
335
347 list getCapabilityList();
348
349 public:
351
360 any getClientVersion();
361
362 public:
364
376 hash getConfigHash();
377
378 public:
380
392 string getConfigString();
393
394 public:
396
408 string getDBCharset();
409
410 public:
412
424 string getDBEncoding();
425
426 public:
428
438 *string getDBName();
439
440 public:
442
452 string getDriverName();
453
454 public:
456
466 *string getHostName();
467
468 public:
470
482 string getOSCharset();
483
484 public:
486
496 *string getOSEncoding();
497
498 public:
500
512 any getOption(string opt);
513
514 public:
516
530 hash getOptionHash();
531
532 public:
534
544 *string getPassword();
545
546 public:
548
558 *int getPort();
559
560 public:
562
573 any getServerVersion();
574
575 public:
577
587 int getTransactionLockTimeout();
588
589 public:
591
601 *string getUserName();
602
603 public:
605
615 bool inTransaction();
616
617 public:
619
630 nothing open();
631
632 public:
634
643 nothing reset();
644
645 public:
647
656 nothing rollback();
657
658 public:
660
691 any select(string sql, ...);
692
693 public:
695
716 *hash selectRow(string sql, ...);
717
718 public:
720
746 any selectRows(string sql, ...);
747
748 public:
750
756 nothing setAutoCommit(bool ac = True);
757
758 public:
760
771 nothing setDBCharset(string encoding);
772
773 public:
775
784 nothing setDBEncoding(string encoding);
785
786 public:
788
797 nothing setDBName(string db);
798
799 public:
801
808 nothing setEventQueue(Qore::Thread::Queue queue, any arg);
809
810 public:
812
821 nothing setHostName(string host);
822
823 public:
825
835 setOption(string opt, any val);
836
837 public:
839
848 nothing setPassword(string pass);
849
850 public:
852
861 nothing setPort(softint port = 0);
862
863 public:
865
872 nothing setTransactionLockTimeout(timeout timeout_ms = 0);
873
874 public:
876
885 nothing setUserName(string user);
886
887 public:
889
906 int transactionTid();
907
908 public:
910
928 any vexec(string sql, *softlist vargs);
929
930 public:
932
960 any vselect(string sql, *softlist vargs);
961
962 public:
964
986 *hash vselectRow(string sql, *softlist vargs);
987
988 public:
990
1018 any vselectRows(string sql, *softlist vargs);
1019 };
1024
1026 const DSDB2 = "db2";
1028 const DSFreeTDS = "freetds";
1030 const DSMSSQL = "freetds";
1032 const DSMySQL = "mysql";
1034 const DSOracle = "oracle";
1036 const DSPGSQL = "pgsql";
1038 const DSSQLite3 = "sqlite3";
1040 const DSSybase = "sybase";
1042
1046
1048 const DBI_CAP_AUTORECONNECT = DBI_CAP_AUTORECONNECT;
1050 const DBI_CAP_BIND_BY_PLACEHOLDER = DBI_CAP_BIND_BY_PLACEHOLDER;
1052 const DBI_CAP_BIND_BY_VALUE = DBI_CAP_BIND_BY_VALUE;
1054 const DBI_CAP_CHARSET_SUPPORT = DBI_CAP_CHARSET_SUPPORT;
1056 const DBI_CAP_EVENTS = DBI_CAP_EVENTS;
1058 const DBI_CAP_HAS_DESCRIBE = DBI_CAP_HAS_DESCRIBE;
1060 const DBI_CAP_HAS_EXECRAW = DBI_CAP_HAS_EXECRAW;
1062 const DBI_CAP_HAS_NUMBER_SUPPORT = DBI_CAP_HAS_NUMBER_SUPPORT;
1064 const DBI_CAP_HAS_OPTION_SUPPORT = DBI_CAP_HAS_OPTION_SUPPORT;
1066 const DBI_CAP_HAS_SELECT_ROW = DBI_CAP_HAS_SELECT_ROW;
1068 const DBI_CAP_HAS_STATEMENT = DBI_CAP_HAS_STATEMENT;
1070 const DBI_CAP_LOB_SUPPORT = DBI_CAP_LOB_SUPPORT;
1072 const DBI_CAP_SERVER_TIME_ZONE = DBI_CAP_SERVER_TIME_ZONE;
1074 const DBI_CAP_STORED_PROCEDURES = DBI_CAP_STORED_PROCEDURES;
1076 const DBI_CAP_TIME_ZONE_SUPPORT = DBI_CAP_TIME_ZONE_SUPPORT;
1078 const DBI_CAP_TRANSACTION_MANAGEMENT = DBI_CAP_TRANSACTION_MANAGEMENT;
1080 };
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::execRaw
any execRaw(string sql)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
Qore::SQL::Datasource::vselectRow
*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...
Qore::SQL::Datasource::constructor
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 ...
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:1062
Qore::SQL::Datasource::setPort
nothing setPort(softint port=0)
Sets the port number to use for the connection.
Qore::SQL::DSFreeTDS
const DSFreeTDS
for the &quot;freetds&quot; driver
Definition: QC_Datasource.dox.h:1028
Qore::SQL::Datasource::transactionTid
int transactionTid()
Returns the TID of the thread holding the transaction lock or -1 if it&#39;s not currently held...
Qore::SQL::Datasource::selectRow
*hash 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::setDBCharset
nothing setDBCharset(string encoding)
Sets the database-specific character encoding name for the next connection to the server...
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:1048
Qore::SQL::Datasource::setEventQueue
nothing setEventQueue(Qore::Thread::Queue queue, any arg)
Sets a queue object for DBI events on the datasource.
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:1060
Qore::SQL::Datasource::getPassword
*string getPassword()
Returns the password parameter as a string or NOTHING if none is set.
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:1068
Qore::SQL::DSMSSQL
const DSMSSQL
another constant for the &quot;freetds&quot; driver
Definition: QC_Datasource.dox.h:1030
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::vselectRows
any vselectRows(string sql, *softlist vargs)
Executes a select statement on the server and returns the results in a list (rows) of hashes (column ...
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:1070
Qore::SQL::Datasource::rollback
nothing rollback()
Rolls the current transaction back and releases the transaction lock.
Qore::True
const True
logical True
Definition: qc_qore.dox.h:94
Qore::SQL::Datasource::setHostName
nothing setHostName(string host)
Sets the hostname to use for the next connection to the server.
Qore::SQL::Datasource::getCapabilities
int getCapabilities()
Returns an integer bitfield of DBI driver capabilities.
Qore::SQL::DSPGSQL
const DSPGSQL
for the &quot;pgsql&quot; driver
Definition: QC_Datasource.dox.h:1036
Qore::SQL::Datasource::getAutoCommit
bool getAutoCommit()
Returns the autocommit status for the object.
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:1058
Qore::SQL::Datasource::getDBCharset
string getDBCharset()
Retrieves the database-specific charset set encoding for the current connection.
Qore::SQL::Datasource::getConfigHash
hash getConfigHash()
Returns a datasource hash describing the configuration of the current object.
Qore::SQL::AbstractDatasource
This class defines an abstract interface for database access, inherited by both the Datasource and Da...
Definition: QC_AbstractDatasource.dox.h:8
Qore::list
list list(...)
Returns a list of the arguments passed at the top level.
Qore::SQL::Datasource::getOptionHash
hash getOptionHash()
returns the valid options for the driver associated with the Datasource with descriptions and current...
Qore::SQL::Datasource::getPort
*int getPort()
Gets the port number that will be used for the next connection to the server.
Qore::SQL::Datasource::setOption
setOption(string opt, any val)
sets an option for the datasource
Qore::SQL::DSSQLite3
const DSSQLite3
for the &quot;sqlite3&quot; driver
Definition: QC_Datasource.dox.h:1038
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:1064
Qore::SQL::Datasource::getHostName
*string getHostName()
Returns the hostname parameter as a string or NOTHING if none is set.
Qore::SQL::Datasource::beginTransaction
nothing beginTransaction()
Manually grabs the transaction lock.
Qore::SQL::Datasource::clearEventQueue
nothing clearEventQueue()
Clears the queue object for DBI events on the datasource.
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:1052
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:1076
Qore::SQL::DSSybase
const DSSybase
for the &quot;sybase&quot; driver
Definition: QC_Datasource.dox.h:1040
Qore::SQL::Datasource::getCapabilityList
list getCapabilityList()
Returns a list of strings giving the capabilities of the current DBI driver.
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::select
any 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::currentThreadInTransaction
bool currentThreadInTransaction()
Returns True if the current thread is in a transaction (i.e. holds the transaction lock)...
Qore::SQL::Datasource::selectRows
any 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::open
nothing open()
Opens a connection to the datasouce, using the connection parameters already set; an exception is thr...
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:1050
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::close
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.
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:1074
Qore::SQL::Datasource::getOSCharset
string getOSCharset()
Returns the Qore character encoding name for the current connection as a string or &quot;(unknown)&quot; if non...
Qore::SQL::Datasource::setAutoCommit
nothing setAutoCommit(bool ac=True)
Turns autocommit on or off for this object.
Qore::SQL::Datasource::commit
nothing commit()
Commits the current transaction and releases the transaction lock.
Qore::SQL::DSDB2
const DSDB2
for the &quot;db2&quot; driver
Definition: QC_Datasource.dox.h:1026
Qore::Thread::Queue
Queue objects provide a blocking, thread-safe message-passing object to Qore programs ...
Definition: QC_Queue.dox.h:13
Qore::SQL::Datasource::getOption
any getOption(string opt)
Returns the current value for the given option.
Qore::SQL::DBI_CAP_TRANSACTION_MANAGEMENT
const DBI_CAP_TRANSACTION_MANAGEMENT
Indicates that the DBI driver supports transaction management.
Definition: QC_Datasource.dox.h:1078
Qore::SQL::Datasource::destructor
destructor()
Closes the datasource if it&#39;s open (if any operations are in progress, will block until the operation...
Qore::SQL::Datasource::inTransaction
bool inTransaction()
Returns True if a transaction is currently in progress, False if not.
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&#39;s pres...
Definition: QC_Datasource.dox.h:1072
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::Datasource::getDBName
*string getDBName()
Returns the database name parameter as a string or NOTHING if none is set.
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::getTransactionLockTimeout
int getTransactionLockTimeout()
Retrieves the transaction lock timeout value as an integer in milliseconds.
Qore::SQL::Datasource::getClientVersion
any getClientVersion()
Retrieves the driver-specific client library version information; this method may not be implemented ...
Qore::SQL::Datasource::getUserName
*string getUserName()
Returns the username parameter as a string or NOTHING if none is set.
Qore::SQL::Datasource::setUserName
nothing setUserName(string user)
Sets the username parameter for the time a connection to the server is established.
Qore::hash
hash hash(object obj)
Returns a hash of an object&#39;s members.
Qore::SQL::DSMySQL
const DSMySQL
for the &quot;mysql&quot; driver
Definition: QC_Datasource.dox.h:1032
Qore::SQL::Datasource::describe
*hash 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::vexec
any vexec(string sql, *softlist vargs)
Grabs the transaction lock (if autocommit is disabled) and executes SQL code on the DB connection...
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:1066
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:1054
Qore::SQL::Datasource
This class provides the Qore interface to databases.
Definition: QC_Datasource.dox.h:74
Qore::SQL::Datasource::getServerVersion
any getServerVersion()
Returns the driver-specific server version data for the current connection.
Qore::SQL::Datasource::getDBEncoding
string getDBEncoding()
Retrieves the database-specific charset set encoding for the current connection.
Qore::SQL::DBI_CAP_EVENTS
const DBI_CAP_EVENTS
Indicates that the DBI driver supports the event API.
Definition: QC_Datasource.dox.h:1056
Qore::SQL::Datasource::copy
copy()
Creates a new Datasource object with the same driver as the original and copies of all the connection...
Qore::SQL::Datasource::exec
any exec(string sql,...)
Grabs the transaction lock (if autocommit is disabled) and executes an SQL command on the server and ...
Qore::SQL::Datasource::vselect
any vselect(string sql, *softlist vargs)
Executes a select statement on the server and returns the results in a hash (column names) of lists (...
Qore::SQL::DSOracle
const DSOracle
for the &quot;oracle&quot; driver
Definition: QC_Datasource.dox.h:1034
Qore::SQL::Datasource::getDriverName
string getDriverName()
Returns the name of the driver used for the object.