Qore TableMapper Module Reference 1.3
Loading...
Searching...
No Matches
TableMapper.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* TableMapper.qm Copyright 2014 - 2023 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25// minimum Qore version
26
27// require type definitions everywhere
28
29// enable all warnings
30
31// don't use "$" signs for variables and class members, assume local variable scope
32
33// requires the Mapper module
34// requires the SqlUtil module
35
36
271namespace TableMapper {
274
275public:
277 const OptionKeys = ...;
278
279
281 const UserOptions = Mapper::UserOptions + {
282 "unstable_input": <MapperOptionInfo>{
283 "type": "bool",
284 "desc": sprintf("if this is set to True then a slower insert/upsert method will be used that "
285 "verifies each input row; if False an optimized insert/upsert method is used (additionally "
286 "bulk inserts/upserts are possible) but all input hashes must have the same keys in the same "
287 "order; default: %y", OptionDefaults.unstable_input),
288 },
289 "insert_block": <MapperOptionInfo>{
290 "type": "int",
291 "desc": sprintf("the row block size used when bulk DML / batch inserts/upserts are used; "
292 "default: %y", OptionDefaults.insert_block),
293 },
294 "upsert": <MapperOptionInfo>{
295 "type": "bool",
296 "desc": "if True then data will be upserted instead of inserted",
297 },
298 "upsert_strategy": <MapperOptionInfo>{
299 "type": "string",
300 "desc": "the upsert strategy code to use; implies 'upsert'",
301 },
302 };
303
306 "unstable_input": False,
307 "insert_block": 1000,
308 };
309
310protected:
313
316
319
321 list ret_args = ();
322
324 list out_args = ();
325
327 bool unstable_input = False;
328
331
334
336 hash hbuf;
338 /* FIXME would be nice to have hbuf with hbuf_size in a class, but there are performance considerations.
339 */
341
343 *code rowcode;
344
346 bool upsert = False;
347
350
353
354public:
355
357
390 constructor(SqlUtil::Table target, hash<auto> mapv, *hash<auto> opts);
391
392
394
427 constructor(SqlUtil::AbstractTable target, hash<auto> mapv, *hash<auto> opts);
428
429
431
434
435
437 static *hash<string, AbstractDataField> getOutputRecord(string mapper_name, AbstractTable table, *hash<auto> opts, *hash<SqlUtilDataTypeOptionInfo> field_opts, *hash<auto> mapv);
438
440protected:
441 init(hash<auto> mapv, *hash<auto> opts);
442public:
443
444
446protected:
447 auto mapFieldType(string key, hash<auto> mapping, AbstractDataProviderType type, auto value, hash<auto> rec);
448public:
449
450
452
455protected:
456 checkMapField(string k, reference<auto> fh);
457public:
458
459
461
463 hash<string, bool> validKeys();
464
465
467
469 hash<auto> optionKeys();
470
471
473 hash<string, hash<MapperOptionInfo>> getUserOptions();
474
475
477
487 hash<auto> insertRow(hash<auto> rec);
488
489
491
503 setRowCode(*code rowc);
504
505
507
589 *hash<auto> queueData(hash<auto> rec, *hash<auto> crec);
590
591
593
629 *hash<auto> queueData(Qore::AbstractIterator iter, *hash<auto> crec);
630
631
633
668 *hash<auto> queueData(list<auto> l, *hash<auto> crec);
669
670
672
687protected:
688 *hash<auto> queueDataIntern(hash<auto> rec);
689public:
690
691
696protected:
697 hash record2Batch(hash h);
698public:
699
700
704protected:
706public:
707
708
714 static nothing addBatchToBatch(reference<hash<auto>> hb, hash<auto> batch);
715
717
719 deprecated static nothing addBatchToBatch(reference<hash> hb, reference x1, hash batch, *reference x2);
720
722
745 *hash<auto> flush();
746
747
749
771
772
782 // return nothing if nothing needs to be flushed
783protected:
784 *hash<auto> flushIntern(bool force_flush);
785public:
786
787
789 *list<hash<auto>> getReturning();
790
791
793 logOutput(hash<auto> h);
794
795
797
803
804
806 deprecated hash<auto> insertRowNoCommit(hash<auto> rec);
807
809 nothing commit();
810
811
813 nothing rollback();
814
815
817 string getTableName();
818
819
822
823
826
827
829protected:
830 error(string fmt);
831public:
832
833
835protected:
836 error2(string ex, string fmt);
837public:
838
839 };
840
843
844public:
846
865 constructor(SqlUtil::Table target, hash<auto> mapv = {}, *hash<auto> opts) ;
866
867
869
889 constructor(SqlUtil::AbstractTable target, hash<auto> mapv = {}, *hash<auto> opts) ;
890
891
893protected:
894 init(hash<auto> mapv, *hash<auto> opts);
895public:
896
897
899protected:
900 hash<string, AbstractDataField> getInputRecord(SqlUtil::AbstractTable table, *hash<auto> opts);
901public:
902
903 };
904
907
908public:
909
910protected:
913
916
918 int cnt = 0;
919
921 hash<auto> val;
922
923public:
924
926
933
934
936
964 constructor(Qore::AbstractIterator i, SqlUtil::Table target, hash<auto> mapv, *hash<auto> opts, int commit_limit = 0) ;
965
966
968
996 constructor(Qore::AbstractIterator i, SqlUtil::AbstractTable target, hash<auto> mapv, *hash<auto> opts, int commit_limit = 0) ;
997
998
1000
1024
1025
1027 hash<auto> getValue();
1028
1029
1031
1035 bool next();
1036
1037
1040
1041
1043 nothing commit();
1044
1045
1047 nothing rollback();
1048
1049
1052
1053
1055
1058
1059
1061
1064
1065
1068
1069
1071
1082 setRuntime(string key, auto value);
1083
1084
1086
1096 setRuntime(hash<auto> runtime);
1097
1098
1100
1110 replaceRuntime(*hash<auto> runtime);
1111
1112
1114
1125 auto getRuntime(string key);
1126
1127 };
1128
1130
1135
1136public:
1137
1138protected:
1141
1142public:
1143
1145
1148
1149
1151
1158 constructor(SqlUtil::AbstractTable table, hash<auto> sh, hash<auto> mapv, *hash<auto> opts) ;
1159
1160
1162
1169 constructor(SqlUtil::Table table, hash<auto> sh, hash<auto> mapv, *hash<auto> opts) ;
1170
1171
1173
1177 constructor(Qore::SQL::AbstractSQLStatement stmt, hash<auto> mapv, *hash<auto> opts) ;
1178
1179
1180protected:
1181 setup(hash<auto> mapv, *hash<auto> opts);
1182public:
1183
1184
1186 hash<auto> getValue();
1187
1188
1190
1193
1194
1196
1199
1200
1202 bool hasBulk();
1203
1204
1206
1210 list<auto> mapBulk(int size);
1211
1212
1214
1225 setRuntime(string key, auto value);
1226
1227
1229
1239 setRuntime(hash<auto> runtime);
1240
1241
1243
1253 replaceRuntime(*hash<auto> runtime);
1254
1255
1257
1268 auto getRuntime(string key);
1269
1270 }; // class SqlStatementMapperIterator
1271
1274
1275public:
1277 const OptionKeys = ...;
1278
1279
1282 "select_block": 1000,
1283 };
1284
1285protected:
1286 // internal SQLStatement
1287 AbstractSQLStatement m_stmt;
1288 // a select_block size. Taken from options
1289 int select_block;
1290 // original option hash
1291 *hash<auto> m_orig_opts;
1292
1293public:
1294
1296
1306 constructor(hash<auto> mapv, *hash<auto> opts);
1307
1308
1310
1312 hash<auto> optionKeys();
1313
1314
1316 hash<string, hash<MapperOptionInfo>> getUserOptions();
1317
1318
1321
1322
1325
1326
1329
1331protected:
1332 abstract initOptions(reference<hash> opts);
1333public:
1334
1336protected:
1337 abstract initStatement();
1338public:
1339
1341
1347
1348
1350
1353
1354
1356
1362
1363
1365
1374 *hash<string, auto> getData();
1375
1376
1378
1386 *list<auto> getDataRows();
1387
1388
1390protected:
1391 static *hash<string, AbstractDataField> getInputRecordFromStmt(AbstractSQLStatement stmt, *hash<auto> input);
1392public:
1393
1394 }; // AbstractSqlStatementOutboundMapper
1395
1398
1399public:
1400protected:
1401 // the target table object
1402 SqlUtil::AbstractTable m_table;
1403 // SqlUtil select hash
1404 *hash m_sh;
1405
1407 const OptionKeys = ...;
1408
1409
1411 const UserOptions = {
1412 "sh": <MapperOptionInfo>{
1413 "type": "hash",
1414 "desc": "(optional) an SqlUtil select hash",
1415 },
1416 };
1417
1418public:
1419
1421
1431 constructor(SqlUtil::Table source, *hash<auto> sh, hash<auto> mapv, *hash<auto> opts) ;
1432
1433
1435
1445 constructor(SqlUtil::AbstractTable source, *hash<auto> sh, hash<auto> mapv, *hash<auto> opts) ;
1446
1447
1449
1452
1453
1455
1458
1459
1462
1463
1466
1467
1469
1471 hash<auto> optionKeys();
1472
1473
1475 hash<string, hash<MapperOptionInfo>> getUserOptions();
1476
1477
1479protected:
1480 initOptions(reference<hash<auto>> opts);
1481public:
1482
1483
1485 static *hash<string, AbstractDataField> getStaticInputRecord(AbstractTable table, *hash<auto> select_hash, *reference<string> sql, *hash<auto> input);
1486 }; // SqlStatementOutboundMapper
1487
1490
1491public:
1492protected:
1493 AbstractDatasource m_ds;
1494 string m_sql;
1495 *list m_sqlargs;
1496
1498 const OptionKeys = ...;
1499
1500
1502 const UserOptions = {
1503 "select": <MapperOptionInfo>{
1504 "type": "string",
1505 "desc": "the SQL statement to use",
1506 },
1507 "bind": <MapperOptionInfo>{
1508 "type": "list",
1509 "desc": "(internal) a list of runtime bind values",
1510 },
1511 };
1512
1513public:
1514
1516
1546 constructor(Qore::SQL::AbstractDatasource ds, string sql, *softlist<auto> sqlargs, hash<auto> mapv, *hash<auto> opts) ;
1547
1548
1551
1552
1554
1556 hash<auto> optionKeys();
1557
1558
1560 hash<string, hash<MapperOptionInfo>> getUserOptions();
1561
1562
1564protected:
1566public:
1567
1568
1570protected:
1571 initOptions(reference<hash<auto>> opts);
1572public:
1573
1574
1576 static *hash<string, AbstractDataField> getStaticInputRecord(Qore::SQL::AbstractDatasource ds, string sql, *softlist<auto> args, *hash<auto> input);
1577 }; // RawSqlStatementOutboundMapper
1578};
Qore::AbstractIterator i
*hash< string, AbstractDataField > input
provides an abstract base for all SQL based outbound mappers
Definition: TableMapper.qm.dox.h:1273
abstract Qore::SQL::AbstractDatasource getDatasource()
returns the AbstractDatasource object associated with this object
Qore::SQL::SQLStatement getRowIterator()
returns a row iterator for the underlying SQL statement for this object
Qore::SQL::AbstractSQLStatement getStatement()
returns a row iterator for the underlying SQL statement for this object
abstract initOptions(reference< hash > opts)
re-implement to initialize options
static *hash< string, AbstractDataField > getInputRecordFromStmt(AbstractSQLStatement stmt, *hash< auto > input)
returns an input record description from an SQLStatement
SqlStatementMapperIterator iterator()
Returns an SqlStatementMapperIterator based on the current object.
commit()
commits the transaction and frees the Qore::SQL::AbstractDatasource transaction thread resource
rollback()
rolls the transaction back and frees the Qore::SQL::AbstractDatasource transaction thread resource
hash< string, hash< MapperOptionInfo > > getUserOptions()
returns mapper options useful for users
*hash< string, auto > getData()
Retrieve mapped data as a hash of lists.
const OptionDefaults
default option values
Definition: TableMapper.qm.dox.h:1281
hash< auto > optionKeys()
returns a list of valid constructor options for this class (can be overridden in subclasses)
constructor(hash< auto > mapv, *hash< auto > opts)
builds the object based on an optional hash providing field mappings, data constraints,...
*list< auto > getDataRows()
Retrieve mapped data as a list of hashes.
abstract initStatement()
re-implement to initialize Qore::SQL::AbstractSQLStatement on demand
const OptionKeys
option keys for this class
Definition: TableMapper.qm.dox.h:1277
maps from source to target tables with exactly the same structure
Definition: TableMapper.qm.dox.h:842
constructor(SqlUtil::AbstractTable target, hash< auto > mapv={}, *hash< auto > opts)
builds the object based on an optional hash providing field mappings, data constraints,...
constructor(SqlUtil::Table target, hash< auto > mapv={}, *hash< auto > opts)
builds the object based on an optional hash providing field mappings, data constraints,...
hash< string, AbstractDataField > getInputRecord(SqlUtil::AbstractTable table, *hash< auto > opts)
returns a description of the input record based on the AbstractTable source
init(hash< auto > mapv, *hash< auto > opts)
common constructor initialization
provides an inbound data mapper to a Table target
Definition: TableMapper.qm.dox.h:273
destructor()
throws an exception if there is data pending in the block cache
Qore::SQL::AbstractDatasource getDatasource()
returns the AbstractDatasource object associated with this object
init(hash< auto > mapv, *hash< auto > opts)
common constructor initialization
constructor(SqlUtil::AbstractTable target, hash< auto > mapv, *hash< auto > opts)
builds the object based on a hash providing field mappings, data constraints, and optionally custom m...
*hash< auto > flush()
flushes any remaining batched data to the database; this method should always be called before commit...
list out_args
extra arguments for sequence output binds
Definition: TableMapper.qm.dox.h:324
*hash< auto > flushIntern(bool force_flush)
const OptionKeys
option keys for this object
Definition: TableMapper.qm.dox.h:277
bool unstable_input
"unstable input" option for non-optimized inserts/upserts (~33% performance reduction in insert/upser...
Definition: TableMapper.qm.dox.h:327
static nothing addBatchToBatch(reference< hash< auto > > hb, hash< auto > batch)
SqlUtil::AbstractDatabase db
the target Database object in case sequence value need to be acquired
Definition: TableMapper.qm.dox.h:315
SqlUtil::AbstractTable table
the target table object
Definition: TableMapper.qm.dox.h:312
string getTableName()
returns the table name
static *hash< string, AbstractDataField > getOutputRecord(string mapper_name, AbstractTable table, *hash< auto > opts, *hash< SqlUtilDataTypeOptionInfo > field_opts, *hash< auto > mapv)
returns a description of the output record based on the AbstractTable target
Qore::SQL::AbstractSQLStatement stmt
statement for inserts/upserts
Definition: TableMapper.qm.dox.h:330
bool has_returning
if the AbstractTable object supports the "returning" clause
Definition: TableMapper.qm.dox.h:318
SqlUtil::AbstractTable getTable()
returns the underlying SqlUtil::AbstractTable object
deprecated hash< auto > insertRowNoCommit(hash< auto > rec)
Plain alias to insertRow(). Obsolete. Do not use.
*code rowcode
per-row Closures or Call References for batch inserts/upserts
Definition: TableMapper.qm.dox.h:343
int insert_block
bulk DML block size (also valid for upserts despite the name)
Definition: TableMapper.qm.dox.h:333
*hash< auto > queueData(hash< auto > rec, *hash< auto > crec)
inserts/upserts a row (or a set of rows, in case a hash of lists is passed) into the block buffer bas...
*hash< auto > queueData(Qore::AbstractIterator iter, *hash< auto > crec)
inserts/upserts a set of rows (from an iterator that returns hashes as values where each hash value r...
setRowCode(*code rowc)
sets a closure or call reference that will be called when data has been sent to the database and all ...
list ret_args
"returning" arguments for sequences
Definition: TableMapper.qm.dox.h:321
nothing commit()
flushes any queued data and commits the transaction
*hash< auto > queueData(list< auto > l, *hash< auto > crec)
inserts/upserts a set of rows (list of hashes representing input records) into the block buffer based...
auto mapFieldType(string key, hash< auto > mapping, AbstractDataProviderType type, auto value, hash< auto > rec)
performs type handling
const UserOptions
User options.
Definition: TableMapper.qm.dox.h:281
hash< string, hash< MapperOptionInfo > > getUserOptions()
returns mapper options useful for users
TableMapper::InboundTableMapperIterator iterator(Qore::AbstractIterator i)
returns an iterator for the current object
*list< hash< auto > > getReturning()
returns a list argument for the SqlUtil "returning" option, if applicable
logOutput(hash< auto > h)
ignore logging from Mapper since we may have to log sequence values; output logged manually in insert...
discard()
discards any buffered batched data; this method should be called after using the batch APIs (queueDat...
error(string fmt)
prepends the datasource description to the error string and calls Mapper::error()
*code upsert_code
closure used for upserting
Definition: TableMapper.qm.dox.h:352
const OptionDefaults
default option values
Definition: TableMapper.qm.dox.h:305
hash< auto > insertRow(hash< auto > rec)
inserts or upserts a row into the target table based on a mapped input record; does not commit the tr...
static deprecated nothing addBatchToBatch(reference< hash > hb, reference x1, hash batch, *reference x2)
adds a batch (hash of lists) to another batch (in-place)
constructor(SqlUtil::Table target, hash< auto > mapv, *hash< auto > opts)
builds the object based on a hash providing field mappings, data constraints, and optionally custom m...
*hash< auto > queueDataIntern(hash< auto > rec)
inserts a row into the block buffer based on a mapped input record; does not commit the transaction
error2(string ex, string fmt)
prepends the datasource description to the error description and calls Mapper::error2()
hash< auto > optionKeys()
returns a list of valid constructor options for this class (can be overridden in subclasses)
hash hbuf
buffer for bulk DML
Definition: TableMapper.qm.dox.h:336
hash< string, bool > validKeys()
returns a list of valid field keys for this class (can be overridden in subclasses)
*int upsert_strategy
upsert strategy option
Definition: TableMapper.qm.dox.h:349
checkMapField(string k, reference< auto > fh)
perform per-field pre-processing on the passed map in the constructor
bool upsert
upsert flag
Definition: TableMapper.qm.dox.h:346
nothing rollback()
discards any queued data and rolls back the transaction
*int hbuf_size
size of the batch in hbuf as if returned from getRecListSize()
Definition: TableMapper.qm.dox.h:340
provides a hash iterator based on a InboundTableMapper object and an iterator input source; for each ...
Definition: TableMapper.qm.dox.h:906
setRuntime(hash< auto > runtime)
adds runtime options to the current runtime option hash
hash< auto > getValue()
returns the current row transformed with the mapper
constructor(Qore::AbstractIterator i, SqlUtil::Table target, hash< auto > mapv, *hash< auto > opts, int commit_limit=0)
creates the iterator from the arguments passed
int commit_limit
row commit limit (<= 0 for no commits)
Definition: TableMapper.qm.dox.h:915
TableMapper::InboundTableMapper mapc
data mapper
Definition: TableMapper.qm.dox.h:912
string getTableName()
returns the table name
bool next()
Moves the current position of the input iterator to the next element; returns False if there are no m...
constructor(Qore::AbstractIterator i, TableMapper::InboundTableMapper mapv, int commit_limit)
creates the iterator from the arguments passed
resetCount()
resets the internal record count
replaceRuntime(*hash< auto > runtime)
replaces runtime options
Qore::SQL::AbstractDatasource getDatasource()
returns the AbstractDatasource object associated with this object
setRuntime(string key, auto value)
set the runtime option with "key" to value "value"
nothing commit()
commits the transaction
int commitLimit()
returns the commit_limit value set in the constructor()
nothing rollback()
rolls back the transaction
constructor(Qore::AbstractIterator i, SqlUtil::AbstractTable target, hash< auto > mapv, *hash< auto > opts, int commit_limit=0)
creates the iterator from the arguments passed
auto getRuntime(string key)
get current runtime option value for a key
hash< auto > val
a copy of the last hash value mapped
Definition: TableMapper.qm.dox.h:921
int getCount()
returns the internal record count
constructor(Qore::AbstractIterator i, InboundTableMapper mapper)
creates the iterator from the mapper passed
int cnt
row count for commit
Definition: TableMapper.qm.dox.h:918
provides an outbound data mapper to a raw SQL statement
Definition: TableMapper.qm.dox.h:1489
hash< auto > optionKeys()
returns a list of valid constructor options for this class (can be overridden in subclasses)
constructor(Qore::SQL::AbstractDatasource ds, string sql, *softlist< auto > sqlargs, hash< auto > mapv, *hash< auto > opts)
builds the obejct based on real SQL statement
const UserOptions
user options for this class
Definition: TableMapper.qm.dox.h:1502
hash< string, hash< MapperOptionInfo > > getUserOptions()
returns mapper options useful for users
Qore::SQL::AbstractDatasource getDatasource()
returns the AbstractDatasource object associated with this object
initStatement()
initializes the internal statement object
initOptions(reference< hash< auto > > opts)
initializes options
const OptionKeys
option keys for this class
Definition: TableMapper.qm.dox.h:1498
static *hash< string, AbstractDataField > getStaticInputRecord(Qore::SQL::AbstractDatasource ds, string sql, *softlist< auto > args, *hash< auto > input)
returns a description of the input record based on Qore::SQL::AbstractSQLStatement::describe()
provides a hash iterator based on a mapper object and an SQLStatement or SqlUtil select hash
Definition: TableMapper.qm.dox.h:1134
setRuntime(string key, auto value)
set the runtime option with "key" to value "value"
replaceRuntime(*hash< auto > runtime)
replaces runtime options
bool hasBulk()
returns True because this class supports bulk mode
resetCount()
resets the internal record count
constructor(TableMapper::AbstractSqlStatementOutboundMapper mapper)
creates the iterator from the Mapper passed
auto getRuntime(string key)
get current runtime option value for a key
setRuntime(hash< auto > runtime)
adds runtime options to the current runtime option hash
int getCount()
returns the internal record count
hash< auto > getValue()
returns the current row transformed with the mapper
list< auto > mapBulk(int size)
performs bulk mapping by selecting the requested number of rows in a single select
constructor(Qore::SQL::AbstractSQLStatement stmt, hash< auto > mapv, *hash< auto > opts)
creates the iterator from the arguments passed
Mapper::Mapper m_mapper
data mapper
Definition: TableMapper.qm.dox.h:1140
constructor(SqlUtil::AbstractTable table, hash< auto > sh, hash< auto > mapv, *hash< auto > opts)
creates the iterator from the arguments passed
constructor(SqlUtil::Table table, hash< auto > sh, hash< auto > mapv, *hash< auto > opts)
creates the iterator from the arguments passed
provides an outbound data mapper to a Table with SqlUtil select hash as a asource
Definition: TableMapper.qm.dox.h:1397
constructor(SqlUtil::Table source, *hash< auto > sh, hash< auto > mapv, *hash< auto > opts)
builds the object based on an optional hash providing field mappings, data constraints,...
hash< string, hash< MapperOptionInfo > > getUserOptions()
returns mapper options useful for users
hash< auto > optionKeys()
returns a list of valid constructor options for this class (can be overridden in subclasses)
string getTableName()
returns the table name
initStatement()
initializes the internal statement object
const UserOptions
user options for this class
Definition: TableMapper.qm.dox.h:1411
initOptions(reference< hash< auto > > opts)
initializes options
constructor(SqlUtil::AbstractTable source, *hash< auto > sh, hash< auto > mapv, *hash< auto > opts)
builds the object based on an optional hash providing field mappings, data constraints,...
const OptionKeys
option keys for this class
Definition: TableMapper.qm.dox.h:1407
Qore::SQL::AbstractDatasource getDatasource()
returns the AbstractDatasource object associated with this object
static *hash< string, AbstractDataField > getStaticInputRecord(AbstractTable table, *hash< auto > select_hash, *reference< string > sql, *hash< auto > input)
returns a description of the input record based on Qore::SQL::AbstractSQLStatement::describe()
SqlUtil::AbstractTable getTable()
returns the underlying SqlUtil::AbstractTable object
the TableMapper namespace contains all the definitions in the TableMapper module
Definition: TableMapper.qm.dox.h:271