Qore DbDataProvider Module Reference  1.0
DbDataProvider::DbSelectBulkRecordInterface Class Reference

Defines the record iterator class for Table-based iterators. More...

Inherits AbstractDataProviderBulkRecordInterface.

Public Member Methods

 constructor (int block_size, AbstractDatasource ds, *hash< auto > where_cond, hash< auto > select_options)
 creates the iterator More...
 
 destructor ()
 rolls back the transaction if a transaction lock was acquired in the constructor and keepTransactionLock() was not called
 
*hash< string, AbstractDataField > getRecordType ()
 Returns the record description, if available. More...
 
 keepTransactionLock ()
 Ensures that no rollback is performed when the object is destroyed.
 

Private Member Methods

hash< string, list< auto > > getValueImpl ()
 Returns a hash of lists according to the block size. More...
 

Private:Internal Attributes

bool release_transaction
 release the transaction with a rollback in the destructor?
 
AbstractSQLStatement stmt
 the statement being iterated
 

Detailed Description

Defines the record iterator class for Table-based iterators.

Member Function Documentation

◆ constructor()

DbDataProvider::DbSelectBulkRecordInterface::constructor ( int  block_size,
AbstractDatasource  ds,
*hash< auto >  where_cond,
hash< auto >  select_options 
)

creates the iterator

Parameters
block_sizethe number of records in a read block; must be a positive number
dsthe datasource to use
where_condmust be empty; an exception will be thrown if search conditions are passed to this constructor
search_optionssearch options; assumed to have already been processed for validity before this call; contains:
  • sql (required): the SQL query
  • args (optional): a list of bind arguments to sql
Exceptions
DBSELECT-BULK-ERRORwhere_cond must be empty

◆ getRecordType()

*hash<string, AbstractDataField> DbDataProvider::DbSelectBulkRecordInterface::getRecordType ( )

Returns the record description, if available.

Returns
the record type of the query results

◆ getValueImpl()

hash<string, list<auto> > DbDataProvider::DbSelectBulkRecordInterface::getValueImpl ( )
private

Returns a hash of lists according to the block size.

Exceptions
INVALID-ITERATORthe iterator is not pointing at a valid element
Note
This call moves the internal record pointer forward, therefore multiple calls of this methods will return different results as long as data is available