| Qore Programming Language Reference Manual 2.2.0

Loading...
Searching...
No Matches
QC_DatasourcePool.dox.h
1
2 namespace Qore {
4 namespace SQL {
6
50 class DatasourcePool : public AbstractDatasource, public Serializable {
51
52 public:
54
65nothing beginTransaction();
66
67 public:
69
71nothing clearEventQueue();
72
73 public:
75
82 clearWarningCallback();
83
84 public:
86
92nothing commit();
93
94 public:
96
117 constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, softint min = 3, softint max = 10, softint port = 0, *Qore::Thread::Queue queue, auto arg);
118
119 public:
121
136 constructor(string desc, *Qore::Thread::Queue queue, auto arg);
137
138 public:
140
161 constructor(hash<auto> opts, *Qore::Thread::Queue queue, auto arg);
162
163 public:
165
170 copy();
171
172 public:
174
186 bool currentThreadInTransaction();
187
188 public:
190
197 destructor();
198
199 public:
201
215 auto exec(string sql, ...);
216
217 public:
219
235 auto execRaw(string sql);
236
237 public:
239
253 int getCapabilities();
254
255 public:
257
271 list<auto> getCapabilityList();
272
273 public:
275
284 auto getClientVersion();
285
286 public:
288
300 hash<auto> getConfigHash();
301
302 public:
304
316 string getConfigString();
317
318 public:
320
332*string getDBCharset();
333
334 public:
336
348*string getDBEncoding();
349
350 public:
352
362*string getDBName();
363
364 public:
366
378 string getDriverName();
379
380 public:
382
401 string getDriverRealName();
402
403 public:
405
417 int getErrorTimeout();
418
419 public:
421
431*string getHostName();
432
433 public:
435
446 int getMaximum();
447
448 public:
450
462 int getMinimum();
463
464 public:
466
478 string getOSCharset();
479
480 public:
482
492*string getOSEncoding();
493
494 public:
496
505 auto getOption(string opt);
506
507 public:
509
519 hash<auto> getOptionHash();
520
521 public:
523
533*string getPassword();
534
535 public:
537
547*int getPort();
548
549 public:
551
560 AbstractSQLStatement getSQLStatement();
561
562 public:
564
573 auto getServerVersion();
574
575 public:
577
597*hash<auto> getUsageInfo();
598
599 public:
601
611*string getUserName();
612
613 public:
615
625 bool inTransaction();
626
627 public:
629
635nothing rollback();
636
637 public:
639
670 auto select(string sql, ...);
671
672 public:
674
694 auto selectRow(string sql, ...);
695
696 public:
698
720 auto selectRows(string sql, ...);
721
722 public:
724
731 setErrorTimeout(timeout ts);
732
733 public:
735
742nothing setEventQueue(Qore::Thread::Queue queue, auto arg);
743
744 public:
746
762 setWarningCallback(timeout ms, code callback, auto arg);
763
764 public:
766
777 string toString();
778
779 public:
781
797 auto vexec(string sql, *softlist<auto> vargs);
798
799 public:
801
829 auto vselect(string sql, *softlist<auto> vargs);
830
831 public:
833
853 auto vselectRow(string sql, *softlist<auto> vargs);
854
855 public:
857
881 auto vselectRows(string sql, *softlist<auto> vargs);
882};
883}
884}
Qore::SQL::AbstractDatasource
This class defines an abstract interface for database access, inherited by both the Datasource and Da...
Definition QC_AbstractDatasource.dox.h:10
Qore::SQL::AbstractSQLStatement
This class defines an abstract interface for the SQLStatement class.
Definition QC_AbstractSQLStatement.dox.h:11
Qore::SQL::DatasourcePool
Provides transparent per-thread, per-transaction datasource connection pooling.
Definition QC_DatasourcePool.dox.h:50
Qore::SQL::DatasourcePool::getDriverName
string getDriverName()
Returns the name of the driver used for the object.
Qore::SQL::DatasourcePool::getUsageInfo
*hash< auto > getUsageInfo()
Returns a hash with usage information about the DatasourcePool object.
Qore::SQL::DatasourcePool::beginTransaction
nothing beginTransaction()
Manually allocates a persistent connection from the pool to the calling thread.
Qore::SQL::DatasourcePool::getPassword
*string getPassword()
Returns the password parameter as a string or NOTHING if none is set.
Qore::SQL::DatasourcePool::vselect
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 (...
Qore::SQL::DatasourcePool::getConfigString
string getConfigString()
Returns a string giving the configuration of the current object in a format that can be parsed by par...
Qore::SQL::DatasourcePool::setErrorTimeout
setErrorTimeout(timeout ts)
Sets the timeout period for waiting for a connection to come free; note that timeout values less than...
Qore::SQL::DatasourcePool::getOptionHash
hash< auto > getOptionHash()
returns the valid options for the driver associated with the Datasource with descriptions and current...
Qore::SQL::DatasourcePool::getHostName
*string getHostName()
Returns the hostname parameter as a string or NOTHING if none is set.
Qore::SQL::DatasourcePool::constructor
constructor(string desc, *Qore::Thread::Queue queue, auto arg)
Creates a DatasourcePool object from a single string giving all parameters that can be parsed by pars...
Qore::SQL::DatasourcePool::setEventQueue
nothing setEventQueue(Qore::Thread::Queue queue, auto arg)
Sets a queue object for DBI events on the pool.
Qore::SQL::DatasourcePool::inTransaction
bool inTransaction()
Returns True if a transaction is currently in progress (meaning in this case that a datasource form t...
Qore::SQL::DatasourcePool::execRaw
auto execRaw(string sql)
Allocates a persistent connection to the current thread from the pool (if one has not already been al...
Qore::SQL::DatasourcePool::getErrorTimeout
int getErrorTimeout()
Returns the error timeout period for waiting for a connection to come free as an integer giving milli...
Qore::SQL::DatasourcePool::getClientVersion
auto getClientVersion()
Retrieves the driver-specific client library version information; this method may not be implemented ...
Qore::SQL::DatasourcePool::getDBName
*string getDBName()
Returns the database name parameter as a string or NOTHING if none is set.
Qore::SQL::DatasourcePool::constructor
constructor(string driver, *string user, *string pass, *string db, *string encoding, *string host, softint min=3, softint max=10, softint port=0, *Qore::Thread::Queue queue, auto arg)
Creates the DatasourcePool object; attempts to load a DBI driver if the driver is not already present...
Qore::SQL::DatasourcePool::copy
copy()
Creates a new Datasource object with the same driver as the original and copies of all the connection...
Qore::SQL::DatasourcePool::exec
auto exec(string sql,...)
Allocates a persistent connection to the current thread from the pool (if one has not already been al...
Qore::SQL::DatasourcePool::getCapabilities
int getCapabilities()
Returns an integer bitfield of DBI driver capabilities.
Qore::SQL::DatasourcePool::rollback
nothing rollback()
Rolls back the current transaction and releases the connection to the pool.
Qore::SQL::DatasourcePool::getDBEncoding
*string getDBEncoding()
Retrieves the database-specific charset set encoding for the object.
Qore::SQL::DatasourcePool::getDBCharset
*string getDBCharset()
Retrieves the database-specific charset set encoding for the object.
Qore::SQL::DatasourcePool::setWarningCallback
setWarningCallback(timeout ms, code callback, auto arg)
sets a connection delay warning callback to be called any time the delay assigning a connection from ...
Qore::SQL::DatasourcePool::getOSEncoding
*string getOSEncoding()
Returns the Qore character encoding name for the object as a string or NOTHING if none is set.
Qore::SQL::DatasourcePool::selectRows
auto selectRows(string sql,...)
Executes an SQL select statement on the server and returns the result as a list (rows) of hashes (the...
Qore::SQL::DatasourcePool::getServerVersion
auto getServerVersion()
Returns the driver-specific server version data for the current connection.
Qore::SQL::DatasourcePool::commit
nothing commit()
Commits the current transaction and releases the connection to the pool.
Qore::SQL::DatasourcePool::getPort
*int getPort()
Gets the port number that will be used for the next connection to the server.
Qore::SQL::DatasourcePool::vselectRow
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...
Qore::SQL::DatasourcePool::getUserName
*string getUserName()
Returns the username parameter as a string or NOTHING if none is set.
Qore::SQL::DatasourcePool::getMaximum
int getMaximum()
Returns the maximum number of connections in this object.
Qore::SQL::DatasourcePool::getMinimum
int getMinimum()
Returns the minimum number of connections in this object.
Qore::SQL::DatasourcePool::toString
string toString()
Returns a string with technical information about the object.
Qore::SQL::DatasourcePool::getOption
auto getOption(string opt)
Returns the current value for the given option.
Qore::SQL::DatasourcePool::constructor
constructor(hash< auto > opts, *Qore::Thread::Queue queue, auto arg)
Creates a DatasourcePool object from a hash argument giving parameters for the constructor.
Qore::SQL::DatasourcePool::selectRow
auto selectRow(string sql,...)
Executes an SQL select statement on the server and returns the first row as a hash (the column values...
Qore::SQL::DatasourcePool::currentThreadInTransaction
bool currentThreadInTransaction()
Returns True if the current thread is in a transaction (i.e. has a dedicated datasource allocation),...
Qore::SQL::DatasourcePool::select
auto select(string sql,...)
Executes an SQL select statement on the server and returns the result as a hash (column names) of lis...
Qore::SQL::DatasourcePool::clearEventQueue
nothing clearEventQueue()
Clears the queue object for DBI events on the pool.
Qore::SQL::DatasourcePool::getDriverRealName
string getDriverRealName()
Returns the real DB driver name if supported by the driver, otherwise the Qore driver name.
Qore::SQL::DatasourcePool::vselectRows
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 ...
Qore::SQL::DatasourcePool::getConfigHash
hash< auto > getConfigHash()
Returns a datasource hash describing the configuration of the current object.
Qore::SQL::DatasourcePool::clearWarningCallback
clearWarningCallback()
clears any connection delay warning callback from the object
Qore::SQL::DatasourcePool::getCapabilityList
list< auto > getCapabilityList()
Returns a list of strings giving the capabilities of the current DBI driver.
Qore::SQL::DatasourcePool::getOSCharset
string getOSCharset()
Returns the Qore character encoding name for the object as a string or "(unknown)" if none is set.
Qore::SQL::DatasourcePool::destructor
destructor()
Throws an exception if any transactions are in progress and returns immediately; the object is destro...
Qore::SQL::DatasourcePool::vexec
auto vexec(string sql, *softlist< auto > vargs)
Allocates a persistent connection to the current thread from the pool (if one has not already been al...
Qore::SQL::DatasourcePool::getSQLStatement
AbstractSQLStatement getSQLStatement()
Returns an AbstractSQLStatement object based on the current database connection object.
Qore::Serializable
The Serializable class can be used to mark a class as being serializable.
Definition QC_Serializable.dox.h:100
Qore::Thread::Queue
Queue objects provide a blocking, thread-safe message-passing object to Qore programs
Definition QC_Queue.dox.h:22
Qore::max
auto max(list< auto > l)
Returns the maximum value in a list.
Qore::min
auto min(list< auto > l)
Returns the minumum value in a list.
Qore::hash
hash< auto > hash(object obj)
Returns a hash of an object's members.
Qore::list
list< auto > list(...)
Returns a list of the arguments passed at the top level.
Qore::SQL
SQL namespace.
Definition QC_AbstractDatasource.dox.h:4
Qore
main Qore-language namespace
Definition Pseudo_QC_All.dox.h:3