|
Qore TableMapper Module Reference
1.1
|
provides an outbound data mapper to a raw SQL statement More...

Public Member Functions | |
| constructor (AbstractDatasource ds, string sql, *softlist sqlargs, hash mapv, *hash opts) | |
| builds the obejct based on real SQL statement More... | |
| Qore::SQL::AbstractDatasource | getDatasource () |
| returns the AbstractDatasource object associated with this object | |
| private | initOptions (reference opts) |
| initializes options | |
| private | initStatement () |
| initializes the internal statement object | |
Public Member Functions inherited from TableMapper::AbstractSqlStatementOutboundMapper | |
| commit () | |
| commits the transaction and frees the AbstractDatasource resource | |
| constructor (hash mapv, *hash opts) | |
| builds the object based on an optional hash providing field mappings, data constraints, and optionally custom mapping logic More... | |
| *hash | getData () |
| Retrieve mapped data as a hash of lists. More... | |
| *list | getDataRows () |
| Retrieve mapped data as a hash of lists. More... | |
| Mapper::MapperIterator | iterator () |
| Get MapperIterator for easy line-by-line processing. More... | |
| hash | optionKeys () |
| returns a list of valid constructor options for this class (can be overridden in subclasses) More... | |
| rollback () | |
| rolls the transaction back and frees the AbstractDatasource resource | |
Static Public Member Functions | |
| static *hash | getStaticInputRecord (AbstractDatasource ds, string sql, *softlist args) |
| returns a description of the input record based on Qore::SQL::SQLStatement::describe() | |
Additional Inherited Members | |
Public Attributes inherited from TableMapper::AbstractSqlStatementOutboundMapper | |
| const | OptionDefaults |
| default option values | |
| const | OptionKeys |
| option keys for this object | |
provides an outbound data mapper to a raw SQL statement
| TableMapper::RawSqlStatementOutboundMapper::constructor | ( | AbstractDatasource | ds, |
| string | sql, | ||
| *softlist | sqlargs, | ||
| hash | mapv, | ||
| *hash | opts | ||
| ) |
builds the obejct based on real SQL statement
The source statement is also scanned using Qore::SQL::SQLStatement and column definitions are used to update the source record specification.
| ds | Qore::AbstractDatasource instance. Note that this object uses transaction lock for current thread. |
| sql | a string with SQL statement. Variables binding is provided by sqlargs |
| sqlargs | optional list with sql argumets/variables |
| mapv | a optional hash providing overrides for the default 1:1 input to output field mappings; each hash key is the name in lower case of the output column in the target table; each value is either True (meaning no translations are done; the data is copied 1:1) or a hash describing the mapping; see Mapper Specification Format for detailed documentation for this option |
| opts | an optional hash of options for the mapper; see Mapper Options for a description of valid mapper options plus the following options specific to this object:
|