Qore SqlUtil Module Reference 1.9.3
Loading...
Searching...
No Matches
AbstractTable.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
26namespace SqlUtil {
28
31
32public:
34
41 const TableOptions = ...;
42
43
45
50 const IndexOptions = ...;
51
52
54
57
59 const CacheOptions = ...;
60
61
63
68
69
71
74
76
79 const SelectOptions = ...;
80
81
84
85
87
91
92
94
102 const AlignTableOptions = ...;
103
104
106
118
119
121
133 const ColumnDescOptions = ...;
134
135
137
141
142
144 const ColumnOptions = {};
145
147
152
153
155
164 const InsertOptions = ...;
165
166
168
174 const UpsertOptions = ...;
175
176
178
183
184
201
207
209
215
217
224
226
230 const UpsertAuto = 4;
231
233
238
240
245
247
249 const UpsertStrategyMap = ...;
250
251
253
256
258
264 const UR_Inserted = 1;
265
267 const UR_Verified = 2;
268
270 const UR_Updated = 3;
271
273 const UR_Unchanged = 4;
274
276 const UR_Deleted = 5;
278
280
282 const UpsertResultMap = ...;
283
284
286
289
290
293
294
295protected:
297 string name;
311 bool native_case = False;
313 bool inDb = False;
315 bool manual = False;
316
317 hash m_customCopMap = {};
318
319public:
320
322
330protected:
331 constructor(AbstractDatasource nds, string nname, *hash nopts) ;
332public:
333
334
337
338
340
351 setDatasource(AbstractDatasource nds);
352
353
354protected:
355 doTableOptions(*hash<auto> nopts);
356public:
357
358
361
362
365
366
369
370
372
381 bool inDb();
382
383
385
393
394
396
408 dropCommit(*hash<auto> opt);
409
410
412
426 drop(*hash<auto> opt);
427
428
430 deprecated dropNoCommit(*hash<auto> opt);
431
433
444 auto tryExec(string sql);
445
446
448
458 auto tryExecArgs(string sql, *softlist<auto> args);
459
460
462
473 auto tryExecRaw(string sql);
474
475
477
489 softlist<auto> getDropSql(*hash<auto> opt);
490
491
493
502
503
505
517
518
520 deprecated truncateNoCommit();
521
523
541 string getTruncateSql(*hash<auto> opt);
542
543
545
554 createCommit(*hash<auto> opt);
555
556
558
572 create(*hash<auto> opt);
573
574
576 deprecated createNoCommit(*hash<auto> opt);
577
579
595 rename(string new_name, *reference<string> sql, *Tables table_cache);
596
597
598protected:
599 doRenameIntern(string new_name, *Tables table_cache);
600public:
601
602
604
615 bool emptyData();
616
617
619
628 bool empty();
629
630
631protected:
632 bool emptyUnlocked();
633public:
634
635
637
645 setupTable(hash<auto> desc, *hash<auto> opt);
646
647
649
673 AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
674
675
677
706 list<auto> getAddColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
707
708
709protected:
710 AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
711public:
712
713
714protected:
715 addColumnToTableUnlocked(AbstractColumn c);
716public:
717
718
720
745 AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
746
747
749
776 list<auto> getModifyColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
777
778
780
797 AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
798
799
801
819 string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
820
821
822protected:
823 AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
824public:
825
826
827protected:
828 validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt);
829public:
830
831
832protected:
833 validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt, string tag);
834public:
835
836
837protected:
838 execSql(softlist lsql);
839public:
840
841
843
863 AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
864
865
867
889 string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
890
891
892protected:
893 setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
894public:
895
896
897protected:
898 AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
899public:
900
901
902protected:
903 AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
904public:
905
906
908
924 list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
925
926
927protected:
928 list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
929public:
930
931
933
952 list<auto> getDropPrimaryKeySql(*hash<auto> opt);
953
954
956
975
976
978
999 AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1000
1001
1003
1023 string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
1024
1025
1026protected:
1027 AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1028public:
1029
1030
1031protected:
1032 AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1033public:
1034
1035
1037
1058 AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1059
1060
1062
1083 string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1084
1085
1086protected:
1087 AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1088public:
1089
1090
1091protected:
1092 AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1093public:
1094
1095
1097
1109 AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1110
1111
1113
1131 AbstractIndex dropIndex(string iname, *reference<string> sql);
1132
1133
1135
1154 string getDropIndexSql(string iname, *hash<auto> opt);
1155
1156
1158
1180 AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1181
1182
1184
1206 string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1207
1208
1209protected:
1210 Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1211public:
1212
1213
1214protected:
1215 AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1216public:
1217
1218
1219protected:
1220 AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1221public:
1222
1223
1225
1243 AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1244
1245
1247
1263
1264
1266
1286 AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1287
1288
1290
1312 string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1313
1314
1315protected:
1316 AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1317public:
1318
1319
1320protected:
1321 AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1322public:
1323
1324
1326
1338 AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1339
1340
1342
1361 string getDropConstraintSql(string cname, *hash<auto> opt);
1362
1363
1365
1384 *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1385
1386
1387protected:
1388 AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1389public:
1390
1391
1393
1411 AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1412
1413
1415
1435 AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1436
1437
1439
1461 list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1462
1463
1464protected:
1465 AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1466public:
1467
1468
1469protected:
1470 AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1471public:
1472
1473
1475
1493 AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1494
1495
1497
1516 list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1517
1518
1519protected:
1520 getAllConstraintsUnlocked(*hash<auto> opt);
1521public:
1522
1523
1524protected:
1525 checkUniqueConstraintName(string err, string cname);
1526public:
1527
1528
1529protected:
1530 checkUniqueConstraintNameValidateOptions(string err, string cname, hash<auto> ropt, reference<hash> opt);
1531public:
1532
1533
1535protected:
1536 validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1537public:
1538
1539
1541
1559 AbstractColumn dropColumn(string cname, *reference lsql);
1560
1561
1563
1582 list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1583
1584
1586
1597 *hash<auto> insertCommit(hash<auto> row);
1598
1599
1601
1605 *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1606
1607
1609
1613 *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1614
1615
1617
1622 *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1623
1624
1626
1638 *hash<auto> insert(hash<auto> row);
1639
1640
1642
1646 *hash<auto> insert(hash<auto> row, reference<string> sql);
1647
1648
1650
1654 *hash<auto> insert(hash<auto> row, hash<auto> opt);
1655
1656
1658
1663 *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1664
1665
1667
1676 hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
1677
1678
1680 deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1681
1683 deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1684
1685protected:
1686 *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1687public:
1688
1689
1690protected:
1691 hash<auto> getPlaceholdersAndValues(hash<auto> row);
1692public:
1693
1694
1696
1700
1701
1703
1722 int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1723
1724
1727
1728
1730 int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1731
1732
1734 int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1735
1736
1738 int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1739
1740
1742
1761 int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1762
1763
1765 int insertFromSelect(list cols, AbstractTable source);
1766
1767
1769 int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1770
1771
1773 int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1774
1775
1777 int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1778
1779
1781
1794 hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash, *hash<auto> opt);
1795
1796
1798 deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1799
1800protected:
1801 int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1802public:
1803
1804
1806
1825
1826
1828
1847
1848
1850 deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
1851
1852protected:
1853 int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
1854public:
1855
1856
1858
1874 int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1875
1876
1878
1894 int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1895
1896
1898 deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
1899
1901
1922 code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1923
1924
1926
1953 code getBulkUpsertClosure(hash<auto> example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
1954
1955
1957
1978 code getUpsertClosureWithValidation(hash<auto> example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1979
1980
1982
2014 *hash<string, int> upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2015
2016
2018
2050 *hash<string, int> upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2051
2052
2054 deprecated *hash<string, int> upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2055
2056protected:
2057 *hash<string, int> upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2058public:
2059
2060
2061protected:
2062 *hash<string, int> doDeleteOthersIntern(hash<auto> pkh, *hash<auto> opt);
2063public:
2064
2065
2067
2129 *hash<string, int> upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2130
2131
2133 *hash<string, int> upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2134
2135
2137
2177 *hash<string, int> upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2178
2179
2181 deprecated *hash<string, int> upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2182
2184 deprecated *hash<string, int> upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2185
2187 deprecated *hash<string, int> upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2188
2190
2201 softint rowCount();
2202
2203
2205
2226 Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2227
2228
2230
2253 Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2254
2255
2257
2277 Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2278
2279
2281
2303 Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2304
2305
2307
2328 Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2329
2330
2332
2364 hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2365
2366
2368
2390 Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2391
2392
2394
2422 hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2423
2424
2426
2447 Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2448
2449
2450protected:
2451 Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args);
2452public:
2453
2454
2456
2477 *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2478
2479
2480protected:
2481 *hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2482public:
2483
2484
2486
2512 hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2513
2514
2516
2536 *list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2537
2538
2539protected:
2540 *list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2541public:
2542
2543
2545
2570 hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2571
2572
2574
2593 *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2594
2595
2596protected:
2597 *hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2598public:
2599
2600
2602
2627 hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2628
2629
2631
2649 *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2650
2651
2653
2670 *list<auto> selectRows(*hash<auto> sh, *hash<auto> opt);
2671
2672
2674
2691 *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2692
2693
2695
2713 string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2714
2715
2716 bool testMatchAnyUnique(softlist<auto> cols);
2717
2718
2719 *AbstractUniqueConstraint matchAnyUnique(softlist<auto> cols);
2720
2721
2722protected:
2723 string getSelectSqlStringIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2724public:
2725
2726
2727 // column & table information must be retrieved before calling this method
2728protected:
2729 string getSelectSqlStringIntern(*hash<auto> qh, string from, reference<list<auto>> args, *hash<string, bool> subquery_column_map, *hash<auto> opt, *hash<auto> pseudo_column_map);
2730public:
2731
2732
2734 AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2735
2736
2737 string getExpressionArg(reference<hash<QueryInfo>> info, int role, auto arg, AbstractDataProviderType expected_type);
2738
2739
2740protected:
2741 string getFromIntern(string from, *hash<auto> qh);
2742public:
2743
2744
2745protected:
2746 list<auto> getGroupByListUnlocked(hash<QueryInfo> info, list<auto> coll);
2747public:
2748
2749
2750protected:
2751 list<auto> getOrderByListIntern(hash<QueryInfo> info, list<auto> coll);
2752public:
2753
2754
2755protected:
2756 list<auto> getGroupOrderByListIntern(hash<QueryInfo> info, string key, list<auto> coll);
2757public:
2758
2759
2760protected:
2761 doForUpdate(reference<string> sql);
2762public:
2763
2764
2765protected:
2766 string getSelectSqlName(*hash<auto> qh);
2767public:
2768
2769
2770protected:
2771 string getColumnExpressionIntern(reference<hash<QueryInfo>> info, auto cvc);
2772public:
2773
2774
2775protected:
2776 string doColumnOperatorIntern(reference<hash<QueryInfo>> info, hash<auto> cvc);
2777public:
2778
2779
2780protected:
2781 string doColumnOperatorIntern(reference<hash<QueryInfo>> info, auto cop, auto arg, *string cve);
2782public:
2783
2784
2785protected:
2786 string getColumnNameIntern(hash<QueryInfo> info, string column_name);
2787public:
2788
2789
2791protected:
2793public:
2794
2795
2796protected:
2797 getSelectWhereSqlIntern(reference<hash<QueryInfo>> info, reference<string> sql);
2798public:
2799
2800
2801protected:
2802 *string getWhereClause(*hash<auto> cond, reference<list<auto>> args, *string cprefix, *hash<string, AbstractTable> join_map);
2803public:
2804
2805
2806protected:
2807 *string getWhereExpressionIntern(reference<hash<QueryInfo>> info, hash<DataProviderExpression> cond, *string cprefix);
2808public:
2809
2810
2811protected:
2812 *string getExpressionIntern(reference<hash<QueryInfo>> info, int role, hash<DataProviderExpression> cond, AbstractDataProviderType expected_type);
2813public:
2814
2815
2816protected:
2817 *string getWhereClauseIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
2818public:
2819
2820
2821protected:
2822 *list<string> getWhereClauseListIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
2823public:
2824
2825
2826protected:
2827 string doWhereExpressionIntern(reference<hash<QueryInfo>> info, string cn, auto we);
2828public:
2829
2830
2831 string getOrClause(reference<hash<QueryInfo>> info, list<auto> arglist);
2832
2833
2834 string getOrClause(reference<hash<QueryInfo>> info, hash<auto> arg);
2835
2836
2837protected:
2838 doSelectOrderBySqlIntern(hash<QueryInfo> info, reference<string> sql, list<auto> coll);
2839public:
2840
2841
2843
2859 int delCommit(hash<auto> cond, reference<string> sql, hash<auto> opt);
2860
2861
2863 int delCommit(hash<auto> cond, hash<auto> opt);
2864
2865
2867 int delCommit(hash<auto> cond, reference<string> sql);
2868
2869
2871 int delCommit(hash<auto> cond);
2872
2873
2876
2877
2879
2894 int del(hash<auto> cond, reference<string> sql, hash<auto> opt);
2895
2896
2898 int del(hash<auto> cond, hash<auto> opt);
2899
2900
2902 int del(hash<auto> cond, reference<string> sql);
2903
2904
2906 int del(hash<auto> cond);
2907
2908
2910 int del();
2911
2912
2914
2928 hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
2929
2930
2932 deprecated int delNoCommit(*hash<auto> cond, *reference<string> sql);
2933
2934protected:
2935 int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2936public:
2937
2938
2940
2959 int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
2960
2961
2963 int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql);
2964
2965
2967 int updateCommit(hash<auto> set, hash<auto> cond, hash<auto> opt);
2968
2969
2971 int updateCommit(hash<auto> set, hash<auto> cond);
2972
2973
2975 int updateCommit(hash<auto> set);
2976
2977
2979
2998 int update(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
2999
3000
3002 int update(hash<auto> set, hash<auto> cond, reference<string> sql);
3003
3004
3006 int update(hash<auto> set, hash<auto> cond, hash<auto> opt);
3007
3008
3010 int update(hash<auto> set, hash<auto> cond);
3011
3012
3014 int update(hash<auto> set);
3015
3016
3018
3037 hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
3038
3039
3041
3056 hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
3057
3058
3060 deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *reference<string> sql);
3061
3063 deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *hash<auto> opt);
3064
3065protected:
3066 int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
3067public:
3068
3069
3070protected:
3071 string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3072public:
3073
3074
3075protected:
3076 bool emptyDataIntern();
3077public:
3078
3079
3080protected:
3081 Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3082public:
3083
3084
3085protected:
3086 code getUpsertInsertFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3087public:
3088
3089
3090protected:
3091 code getUpsertUpdateFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3092public:
3093
3094
3095protected:
3096 code getUpsertSelectFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3097public:
3098
3099
3100protected:
3101 code getUpsertInsertOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3102public:
3103
3104
3105protected:
3106 code getUpsertUpdateOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3107public:
3108
3109
3110protected:
3111 Columns getUpsertColumns(reference<string> csrc);
3112public:
3113
3114
3116
3124protected:
3125 hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
3126public:
3127
3128
3129protected:
3130 bool matchUniqueColumns(Columns cols, hash<auto> row);
3131public:
3132
3133
3134protected:
3135 string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3136public:
3137
3138
3139protected:
3140 string getUpsertInsertSql(hash<auto> row);
3141public:
3142
3143
3144protected:
3145 string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3146public:
3147
3148
3149protected:
3150 softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3151public:
3152
3153
3154protected:
3155 checkValue(string cname, string argname, reference val, string type);
3156public:
3157
3158
3160
3169 string getSqlFromList(list<auto> l);
3170
3171
3173
3184 string getSqlValue(auto v);
3185
3186
3188 string getName();
3189
3190
3192
3199 cache(*hash<auto> opts);
3200
3201
3203
3209
3210
3212
3223
3224
3226
3234
3235
3237
3246
3247
3249
3259
3260
3262
3271protected:
3273public:
3274
3275
3277
3287
3288
3291
3292
3295
3296
3298
3308
3309
3311
3333 string getRenameSql(string new_name, *hash<auto> opt);
3334
3335
3337
3346 string getCreateSqlString(*hash<auto> opt);
3347
3348
3350
3359 list<auto> getCreateSql(*hash<auto> opt);
3360
3361
3363
3374 string getCreateTableSql(*hash<auto> opt);
3375
3376
3378
3383
3384
3385protected:
3386 *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3387public:
3388
3389
3391
3413 list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3414
3415
3416protected:
3417 list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3418public:
3419
3420
3421protected:
3422 *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3423public:
3424
3425
3426protected:
3427 *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3428public:
3429
3430
3431protected:
3432 renameIndexUnlocked(AbstractIndex ix, string new_name);
3433public:
3434
3435
3437
3450 string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3451
3452
3454
3466 *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3467
3468
3470
3482 *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3483
3484
3486
3498 *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3499
3500
3502
3516 *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3517
3518
3520
3532 *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3533
3534
3536
3550 *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3551
3552
3554
3561 *hash find(auto id);
3562
3563
3565
3576 *list find(list<auto> ids);
3577
3578
3579protected:
3580 string getPrimaryKeyColumn();
3581public:
3582
3583
3585
3598 *hash<auto> find(hash<auto> row);
3599
3600
3602
3615 *hash<auto> findSingle(*hash<auto> cond);
3616
3617
3619
3632 *list<auto> findAll(*hash<auto> cond);
3633
3634
3636
3640 string getDesc();
3641
3642
3644 string getBaseType();
3645
3646
3648 string getSqlName();
3649
3650
3652 string getColumnSqlName(string col);
3653
3654
3656 list<auto> getColumnSqlNames(softlist cols);
3657
3658
3660
3663
3664
3666
3670 *hash<string, AbstractDataField> getRecordType();
3671
3672
3674
3683 AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3684
3685
3687
3695 AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3696
3697
3699
3707 AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3708
3709
3711
3713 AbstractDataProviderType getDbType(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options);
3714
3715
3717
3719 AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3720
3721
3723
3725 AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3726
3727
3729
3734
3735
3737
3741 hash<auto> getExpressionMap();
3742
3743
3745
3748
3749
3751 abstract bool hasArrayBind();
3752
3754
3756protected:
3757 hash<auto> getTableOptions();
3758public:
3759
3760
3762
3764protected:
3766public:
3767
3768
3770
3772protected:
3774public:
3775
3776
3778
3780protected:
3781 hash<auto> getCacheOptions();
3782public:
3783
3784
3786
3788protected:
3790public:
3791
3792
3794
3796protected:
3798public:
3799
3800
3802
3804protected:
3806public:
3807
3808
3810
3812protected:
3813 hash<auto> getColumnOptions();
3814public:
3815
3816
3818
3820protected:
3822public:
3823
3824
3826
3828protected:
3830public:
3831
3832
3834
3836protected:
3837 hash<auto> getIndexOptions();
3838public:
3839
3840
3842
3844protected:
3845 hash<auto> getTriggerOptions();
3846public:
3847
3848
3850
3852protected:
3853 hash<auto> getSelectOptions();
3854public:
3855
3856
3858
3860protected:
3861 hash<auto> getUpsertOptions();
3862public:
3863
3864
3866
3868protected:
3869 hash<auto> getInsertOptions();
3870public:
3871
3872
3874
3876protected:
3878public:
3879
3880
3882
3884protected:
3886public:
3887
3888
3890
3892protected:
3894public:
3895
3896
3898protected:
3900public:
3901
3902
3904
3940 addCustomCopOperator(string name, hash<auto> operator);
3941
3942
3944
3946 bool isDuplicateRowError(hash<ExceptionInfo> ex);
3947
3948
3950
3952protected:
3954public:
3955
3956
3958
3960protected:
3962public:
3963
3964
3966
3968protected:
3970public:
3971
3972
3974
3976protected:
3977 *hash<auto> getPseudoColumnHash();
3978public:
3979
3980
3981protected:
3982 string getCreateTableSqlUnlocked(*hash<auto> opt);
3983public:
3984
3985
3986protected:
3987 *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
3988public:
3989
3990
3991protected:
3992 *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
3993public:
3994
3995
3996protected:
3997 *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3998public:
3999
4000
4001protected:
4002 *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
4003public:
4004
4005
4006protected:
4007 *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
4008public:
4009
4010
4011protected:
4012 *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
4013public:
4014
4015
4016protected:
4017 list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
4018public:
4019
4020
4021protected:
4022 cacheUnlocked(*hash<auto> opt);
4023public:
4024
4025
4026protected:
4027 auto execData(*hash<auto> opt, string sql, *list<auto> args);
4028public:
4029
4030
4031protected:
4032 execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
4033public:
4034
4035
4036 static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
4037
4038 static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
4039
4040 static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
4041
4042protected:
4043 getColumnsUnlocked();
4044public:
4045
4046
4047protected:
4048 getPrimaryKeyUnlocked();
4049public:
4050
4051
4052 // also loads primary key and constraints (for unique constraints)
4053protected:
4054 getIndexesUnlocked();
4055public:
4056
4057
4058protected:
4059 getForeignConstraintsUnlocked(*hash<auto> opt);
4060public:
4061
4062
4063protected:
4064 addSourceConstraint(string table_name, AbstractForeignConstraint fk);
4065public:
4066
4067
4068protected:
4069 getConstraintsUnlocked();
4070public:
4071
4072
4073protected:
4074 getTriggersUnlocked();
4075public:
4076
4077
4079protected:
4081public:
4082
4083
4084protected:
4085 softlist<auto> getDropSqlImpl();
4086public:
4087
4088
4089protected:
4090 string getTruncateSqlImpl();
4091public:
4092
4093
4095protected:
4096 auto tryExecArgsImpl(string sql, *softlist<auto> args);
4097public:
4098
4099
4101protected:
4102 auto tryExecRawImpl(string sql);
4103public:
4104
4105
4107protected:
4109public:
4110
4111
4112protected:
4113 preSetupTableImpl(reference desc, *hash<auto> opt);
4114public:
4115
4116
4118
4120protected:
4121 abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
4122public:
4123
4124protected:
4125 abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
4126public:
4127
4128protected:
4129 abstract bool emptyImpl();
4130public:
4131
4133protected:
4134 abstract *string getSqlValueImpl(auto v);
4135public:
4136
4138
4141protected:
4142 abstract bool checkExistenceImpl();
4143public:
4144
4146protected:
4148public:
4149
4151protected:
4153public:
4154
4156protected:
4158public:
4159
4160protected:
4161 abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4162public:
4163
4164protected:
4165 abstract Columns describeImpl();
4166public:
4167protected:
4168 abstract AbstractPrimaryKey getPrimaryKeyImpl();
4169public:
4171protected:
4173public:
4174protected:
4175 abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4176public:
4177protected:
4178 abstract Constraints getConstraintsImpl();
4179public:
4180protected:
4181 abstract Triggers getTriggersImpl();
4182public:
4183
4184protected:
4185 abstract string getCreateTableSqlImpl(*hash<auto> opt);
4186public:
4187protected:
4188 abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4189public:
4190protected:
4191 abstract string getCreateSqlImpl(list<auto> l);
4192public:
4193protected:
4194 abstract string getRenameSqlImpl(string new_name);
4195public:
4196protected:
4197 abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4198public:
4199
4200protected:
4201 abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4202public:
4203protected:
4204 abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4205public:
4206protected:
4207 abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4208public:
4209protected:
4210 abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4211public:
4212protected:
4213 abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4214public:
4215protected:
4216 abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4217public:
4218
4219protected:
4220 abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4221public:
4222
4224protected:
4225 abstract bool tryInsertImpl(string sql, hash<auto> row);
4226public:
4227
4229protected:
4230 abstract hash<auto> getQoreTypeMapImpl();
4231public:
4232
4234protected:
4235 abstract hash<auto> getTypeMapImpl();
4236public:
4237
4239protected:
4240 abstract doSelectOrderByWithOffsetSqlInternImpl(reference<hash<QueryInfo>> info, reference<string> sql, list<auto> coll);
4241public:
4242
4244protected:
4245 abstract doSelectLimitOnlyInternImpl(reference<hash<QueryInfo>> info, reference<string> sql);
4246public:
4247
4249protected:
4251public:
4252
4254
4258protected:
4260public:
4261
4263
4265protected:
4266 abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4267public:
4268};
4269};
abstract class for check constraints
Definition SqlUtil.qm.dox.h:5881
the base class for column information
Definition SqlUtil.qm.dox.h:5511
the API for a constraint with columns
Definition SqlUtil.qm.dox.h:5938
abstract base class for constraints
Definition SqlUtil.qm.dox.h:5819
const CreationOptions
default generic creation options
Definition AbstractDatabase.qc.dox.h:118
the base class for foreign key constraint information
Definition SqlUtil.qm.dox.h:6102
the abstract base class for index information
Definition SqlUtil.qm.dox.h:5689
represents a primary key
Definition SqlUtil.qm.dox.h:6021
Abstract base class for savepoint helpers for epheremal transaction support.
Definition AbstractSavepointHelper.qc.dox.h:33
base class for abstract SqlUtil classes
Definition AbstractSqlUtilBase.qc.dox.h:28
transient Mutex l()
mutex for atomic actions
*hash< auto > opts
option hash
Definition AbstractSqlUtilBase.qc.dox.h:35
the base abstract class for the table implementation
Definition AbstractTable.qc.dox.h:30
list< auto > getDropColumnSql(string cname, *hash< auto > opt)
returns the SQL that can be used to drop a column from the table
abstract bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
*hash< auto > insertCommit(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insertCommit() variant
const TableOptions
table options
Definition AbstractTable.qc.dox.h:41
dropCommit(*hash< auto > opt)
drops the table from the database; releases the transaction lock after dropping the table
bool isDuplicateRowError(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
int del(hash< auto > cond, reference< string > sql)
SqlUtil::AbstractTable::del() variant
*hash< auto > find(hash< auto > row)
finds a row in the table with the given primary key value given as a hash; if no row matches the prim...
*hash< auto > insertCommit(hash< auto > row)
inserts a row into the table; the transaction is committed if successful, if an error occurs,...
AbstractColumn modifyColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
modifies an existing column in the table; if the table is already known to be in the database,...
constructor(AbstractDatasource nds, string nname, *hash nopts)
creates the object; private constructor
AbstractPrimaryKey dropPrimaryKey(*reference lsql)
drops the primary key from the table; if the table is known to be in the database already,...
*hash< string, int > upsertFromSelect(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given foreign table and select option hash into the curre...
abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
softint rowCount()
returns the number of rows in the table
abstract *string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
const ColumnOptions
Column options; this is currently empty and can be extended in database-specific modules.
Definition AbstractTable.qc.dox.h:144
abstract hash< auto > getQoreTypeMapImpl()
returns the qore type -> column type map
deprecated *hash< string, int > upsertFromSelectNoCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
hash< auto > getTableOptions()
returns the table options for this driver
*list< auto > getCreateConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create non-foreign constraints on the table or NO...
hash< SqlResultInfo > selectRowWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result representing the row in the table that matches the argument hash; if mor...
Columns describe()
returns an object of class Columns describing the table
const TableOmissionOptions
alignment omission options
Definition AbstractTable.qc.dox.h:83
addCustomCopOperator(string name, hash< auto > operator)
register custom user column operator for this table object
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
list< auto > getDropPrimaryKeySql(*hash< auto > opt)
gets a list of SQL strings that can be used to drop the primary key from the table
bool hasReturningImpl()
returns True if the current database driver supports the "returning" clause in insert statements,...
abstract bool checkExistenceImpl()
returns True if the table exists in the DB, False if not
hash< SqlCommandInfo > getUpdateSql(hash< auto > set, *hash< auto > cond)
Returns the SQL for the given update parameters.
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql)
renames an existing constraint; this can be any constraint on the table, a primary key,...
hash< auto > getDescriptionHash()
Returns a description hash of the table.
rename(string new_name, *reference< string > sql, *Tables table_cache)
renames the table
deprecated *hash< string, int > upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromIterator() wrapper.
setupTable(hash< auto > desc, *hash< auto > opt)
creates the object from a table description hash
AbstractDataField getColumnDataField(string column_name, *hash< auto > options, *string append_desc)
returns a field object for the given column
*hash< auto > insert(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
copy(AbstractTable old)
copies the object
list< auto > getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash< auto > opt)
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the col...
int del(hash< auto > cond)
SqlUtil::AbstractTable::del() variant
int upsertCommit(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
AbstractColumn dropColumn(string cname, *reference lsql)
drops a column from the table
string getDropIndexSql(string iname, *hash< auto > opt)
gets the SQL that can be used to drop an index from the table
hash< auto > getTableCreationOptions()
returns the table creation options for this driver
deprecated dropNoCommit(*hash< auto > opt)
A legacy wrapper for drop()
Constraints constraints
constraint descriptions
Definition AbstractTable.qc.dox.h:307
deprecated createNoCommit(*hash< auto > opt)
A legacy wrapper for create()
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
int insertFromSelect(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
string getDesc()
returns a descriptive string of the datasource (without the password) and the table name (with a poss...
const UpsertResultLetterMap
maps upsert result codes to single letter symbols
Definition AbstractTable.qc.dox.h:292
AbstractPrimaryKey getPrimaryKey()
returns an object of class AbstractPrimaryKey describing the primary key of the table
int insertFromSelectCommit(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
const UpsertOptions
default upsert option keys
Definition AbstractTable.qc.dox.h:174
int update(hash< auto > set, hash< auto > cond)
A SqlUtil::AbstractTable::update() variant.
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
list< auto > getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
list< auto > getDropTriggerSql(string tname, *hash< auto > opt)
returns SQL that can be used to drop the given trigger from the table
int delCommit()
SqlUtil::AbstractTable::delCommit() variant
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
*hash< string, int > upsertFromSelectCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
Upserts or merges data from the given foreign table and select option hash into the current table.
AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a unique constraint to the table; if the table is known to be in the database already,...
hash< SqlResultInfo > insertWithInfo(hash< auto > row, *hash< auto > opt)
Inserts a row and returns the result and also the SQL used.
*hash< string, AbstractDataField > getRecordType()
returns a record description for the table
list< auto > getAddColumnSql(string cname, hash< auto > copt, bool nullable=True, *hash< auto > opt)
returns a list of SQL strings that can be use to add a column to the table
AbstractColumn addColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
adds a column to the table; if the table is already known to be in the database, then it is added in ...
int update(hash< auto > set, hash< auto > cond, reference< string > sql, hash< auto > opt)
updates rows in the table matching an optional condition and returns the count of rows updated; no tr...
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifier for schema,...
const ColumnDescOptions
Column description options.
Definition AbstractTable.qc.dox.h:133
string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash< auto > opt)
returns an SQL string that can be used to add a unique constraint to the table
hash< auto > getInsertFromIteratorOptions()
returns the insert from iterator options for this driver
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
bool inDb
in database
Definition AbstractTable.qc.dox.h:313
list< auto > getAlignSql(AbstractTable t, *hash< auto > opt)
returns a list of SQL strings required to align the table to the table given as an argument
*hash< auto > insert(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insert() variant
int update(hash< auto > set, hash< auto > cond, reference< string > sql)
A SqlUtil::AbstractTable::update() variant.
string name
the table's name
Definition AbstractTable.qc.dox.h:297
*list< auto > getCreateTriggersSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create triggers on the table or NOTHING if there ...
const IndexOptions
default index options
Definition AbstractTable.qc.dox.h:50
string getCreateTableSql(*hash< auto > opt)
returns an SQL string that could be used to create the basic table structure without indexes and cons...
*hash find(auto id)
finds a row in the table with the given primary key value; if no row matches the primary key value pa...
string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash< auto > opt)
returns an SQL string that can be used to add a check constraint to the table
*hash< auto > insert(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
hash< auto > getCacheOptions()
returns the cache options for this driver
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
*list< auto > selectRows(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
*hash< string, int > upsertFromSelectCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelectCommit() variant
AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash< auto > opt, *reference< string > sql)
adds an index to the table; if the table is already known to be in the database, then it is added in ...
bool hasReturning()
returns True if the current database driver supports the "returning" clause in insert statements,...
code getUpsertClosureWithValidation(hash< auto > example_row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
string getDropConstraintSql(string cname, *hash< auto > opt)
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the ...
abstract doSelectLimitOnlyInternImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
deprecated int upsertNoCommit(hash< auto > row, int upsert_strategy=UpsertAuto)
A legacy SqlUtil::AbstractTable::upsert() wrapper.
bool bindEmptyStringsAsNull()
returns True if the DB treats empty strings as NULL, False if not; by default this method returns Fal...
list< auto > getAddTriggerSql(string tname, string src, *hash topt, *hash< auto > opt)
returns a list of SQL strings that can be used to add a trigger to the table
hash< auto > getColumnDescOptions()
returns the column description options for this driver
AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size=-1, *hash< SqlUtilDataTypeOptionInfo > options)
returns the DB type for the given column type
*list< auto > getCreateMiscSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create other table attributes (such as comments,...
const SqlDataCallbackOptions
generic SQL data operation callbacks
Definition AbstractTable.qc.dox.h:151
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
const InsertOptions
generic SQL insert options
Definition AbstractTable.qc.dox.h:164
AbstractDataField getColumnDataField(AbstractColumn column, *hash< SqlUtilDataTypeOptionInfo > options, *string append_desc)
returns a field object for the given column
deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromIterator() wrapper.
abstract bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
AbstractIndex renameIndex(string old_name, string new_name, reference< string > sql)
renames an existing index; if the table is already known to be in the database, then the changes are ...
int delCommit(hash< auto > cond, reference< string > sql, hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; the transacti...
hash< auto > getSelectOptions()
returns the select options for this driver
int delCommit(hash< auto > cond, hash< auto > opt)
SqlUtil::AbstractTable::delCommit() variant
list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that could be used to create the table and all known properties of the ...
abstract copyImpl(AbstractTable old)
db-specific copy actions
deprecated *hash< auto > insertNoCommit(hash< auto > row, *reference< string > sql, *hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
AbstractConstraint dropConstraint(string cname, *reference< string > sql)
drops a constraint from the table; this can be any constraint on the table, a primary key,...
string getRenameSql(string new_name, *hash< auto > opt)
returns an SQL string that could be used to rename the table in the database
int delCommit(hash< auto > cond)
SqlUtil::AbstractTable::delCommit() variant
hash< auto > getTriggerOptions()
returns the trigger options for this driver
hash< auto > getUpsertOptions()
returns the upsert options for this driver
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
hash< string, Columns > getAllUpsertColumns(*hash< auto > row)
returns a hash with a single value\
AbstractForeignConstraint removeForeignConstraint(string cname)
removes the named foreign constraint from the table; no SQL is executed in any case,...
const CacheOptions
default cache options
Definition AbstractTable.qc.dox.h:59
*hash< auto > insertCommit(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
*hash< auto > findSingle(*hash< auto > cond)
finds a single row in the table that match the row condition passed; multiple rows may match,...
string getAddIndexSql(string iname, bool unique, softlist cols, *hash< auto > ixopt, *hash< auto > opt)
returns an SQL string that can be used to add an index to the table
bool native_case
native case option
Definition AbstractTable.qc.dox.h:311
int insertFromIterator(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
hash< SqlResultInfo > delWithInfo(hash< auto > cond, *hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; no transactio...
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
*hash< auto > insert(hash< auto > row)
inserts a row into the table without any transaction management; a transaction will be in progress af...
hash< auto > getColumnOptions()
returns the column options for this driver
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
bool emptyData()
returns True if the table has no data rows, False if not
*hash< auto > select(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash of lists representing the columns and rows in the table that match the argument hash
int updateCommit(hash< auto > set, hash< auto > cond, hash< auto > opt)
A SqlUtil::AbstractTable::updateCommit() variant.
drop(*hash< auto > opt)
drops the table from the database without any transaction management
AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash< auto > sh, *reference< string > sql, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromSelect() wrapper.
*hash< string, int > upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given iterator argument (whose getValue() method must ret...
abstract bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
int updateCommit(hash< auto > set, hash< auto > cond)
A SqlUtil::AbstractTable::updateCommit() variant.
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
hash< auto > getTableDescriptionHashOptions()
returns the table description hash<auto> options for this driver
deprecated int updateNoCommit(hash< auto > set, *hash< auto > cond, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::update() wrapper.
Columns columns
column description object
Definition AbstractTable.qc.dox.h:299
Indexes getIndexes()
returns an object of class Indexes describing the indexes on the table
*string getCreatePrimaryKeySql(*hash< auto > opt, bool cache=True)
returns an SQL string that could be used to create the primary key on the table
string getName()
returns the name of the table
AbstractForeignConstraint dropForeignConstraint(string cname, *reference< string > sql)
drops a foreign constraint from the table; if the table is known to be in the database already,...
hash< auto > getInsertOptions()
returns the insert options for this driver
*hash< auto > selectRow(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash representing the row in the table that matches the argument hash
*list< auto > selectRows(*hash< auto > sh, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
Triggers getTriggers()
returns an object of class Triggers describing the triggers on the table
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
ForeignConstraints foreignConstraints
foreign constraints description
Definition AbstractTable.qc.dox.h:305
clearImpl()
clears any driver-specific table information
const SelectOptions
default possible select options; can be extended by driver-specific modules
Definition AbstractTable.qc.dox.h:79
*hash< auto > getColumnOperatorMapImpl()
Reimplement in subclasses to provide driver specific column operators.
int upsert(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
*AbstractUniqueConstraint findUniqueConstraintUnlocked(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
int del(hash< auto > cond, hash< auto > opt)
SqlUtil::AbstractTable::del() variant
setDatasource(AbstractDatasource nds)
changes the datasource for the table; if the inDb flag is True, then it is set to False by calling th...
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
cache(*hash< auto > opts)
reads in all attributes of the table from the database
truncateCommit()
truncates all the table data; releases the transaction lock after executing
deprecated int updateNoCommit(hash< auto > set, *hash< auto > cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::update() wrapper.
int insertFromIteratorCommit(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
int del(hash< auto > cond, reference< string > sql, hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; no transactio...
const ConstraintOptions
default constraint options
Definition AbstractTable.qc.dox.h:56
hash< SqlResultInfo > selectRowsWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result key assigned to a list of hashes representing the rows in the table that...
hash< auto > getUpdateOperatorMap()
returns the update operator map for this object
hash< auto > getIndexOptions()
returns the index options for this driver
createCommit(*hash< auto > opt)
creates the table in the database; releases the transaction lock after creating the table
*list< auto > getCreateForeignConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create foreign constraints on the table or NOTHIN...
deprecated *hash< string, int > upsertFromSelect(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelect() variant
string getBaseType()
returns the base type of the underlying object (normally "table", some DB-specific implementations ma...
hash< SqlResultInfo > updateWithInfo(hash< auto > set, hash< auto > cond, *hash< auto > opt)
updates rows in the table matching an optional condition and returns an info hash with the count of r...
hash< SqlResultInfo > getStatementNoExecWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a result hash including an AbstractSQLStatement object that will iterate the results of a sel...
const TableDescriptionHashOptions
Table description options.
Definition AbstractTable.qc.dox.h:117
hash< auto > getTableColumnDescOptions()
returns the table column description options for this driver
int update(hash< auto > set)
A SqlUtil::AbstractTable::update() variant.
int update(hash< auto > set, hash< auto > cond, hash< auto > opt)
A SqlUtil::AbstractTable::update() variant.
clear()
purges the current table definition
hash< SqlResultInfo > getStatementWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a result hash including an AbstractSQLStatement object that will iterate the results of a sel...
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition AbstractTable.qc.dox.h:288
abstract doSelectOrderByWithOffsetSqlInternImpl(reference< hash< QueryInfo > > info, reference< string > sql, list< auto > coll)
processes a string for use in SQL select statements when there is an "order by" and "offset" argument
int updateCommit(hash< auto > set, hash< auto > cond, reference< string > sql)
A SqlUtil::AbstractTable::updateCommit() variant.
deprecated *hash< auto > insertNoCommit(hash< auto > row, hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
hash< auto > getConstraintOptions()
returns the constraint options for this driver
string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash< auto > opt)
returns the SQL that can be used to add a primary key to the table
*hash< string, int > upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given iterator argument (whose getValue() method must ret...
int updateCommit(hash< auto > set, hash< auto > cond, reference< string > sql, hash< auto > opt)
updates rows in the table matching an optional condition and returns the count of rows updated; the t...
hash< auto > getAlignTableOptions()
returns the align table options for this driver
Constraints getConstraints()
returns a Constraints object describing the non-foreign constraints on the table
abstract bool hasArrayBind()
returns True if the underlying DB driver supports bulk DML operations
validateColumnOptions(string cname, reference< hash > opt, bool nullable)
validates column options
deprecated truncateNoCommit()
A legacy warpper for truncate()
commit()
commits the current transaction on the underlying Qore::SQL::AbstractDatasource
bool checkExistence()
returns True if the table exists in the database, False if not
softlist< auto > getDropSql(*hash< auto > opt)
returns the sql required to drop the table; reimplement in subclasses if necessary
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
string getSelectSql(*hash< auto > sh, *reference< list< auto > > args)
returns the SQL string to be executed corresponding to the argument hash with an output parameter for...
AbstractTable getSubtableFromString(string table, *hash< auto > opt)
Returns the given table from the argument, using any "tablecode" option if present.
const TableCreationOptions
table creation options
Definition AbstractTable.qc.dox.h:90
int delCommit(hash< auto > cond, reference< string > sql)
SqlUtil::AbstractTable::delCommit() variant
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
Triggers triggers
trigger descriptions
Definition AbstractTable.qc.dox.h:309
AbstractColumn renameColumn(string old_name, string new_name, reference< string > sql)
renames an existing column; if the table is already known to be in the database, then the changes are...
abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
int updateCommit(hash< auto > set)
A SqlUtil::AbstractTable::updateCommit() variant.
AbstractDataProviderType getColumnDataType(string column_name, *hash< SqlUtilDataTypeOptionInfo > options)
returns the data type for the given column
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
AbstractPrimaryKey primaryKey
primary key description
Definition AbstractTable.qc.dox.h:301
bool inDb()
returns True if the table has been read from or created in the database, False if not
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
AbstractIndex dropIndex(string iname, *reference< string > sql)
drops the given index from the table; if the table is known to be in the database already,...
AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash< auto > opt, *reference< string > sql)
adds a foreign constraint to the table; if the table is already known to be in the database,...
hash< SqlResultInfo > selectWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result key assigned to a hash of lists representing the columns and rows in the...
AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a primary key to the table; if the table is already known to be in the database,...
abstract Indexes getIndexesImpl()
Always called with the lock held.
abstract hash< auto > getTypeMapImpl()
returns the type name -> type description hash
beginTransaction()
begins a transaction on the underlying Qore::SQL::AbstractDatasource
abstract bool supportsTablespacesImpl()
returns True if the database support tablespaces
hash< auto > getColumnOperatorMap()
returns the column operator map for this object
rollback()
rolls back the current transaction on the underlying Qore::SQL::AbstractDatasource
string getTruncateSql(*hash< auto > opt)
gets the SQL that can be used to truncate the table
*hash< auto > insertCommit(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
string getSqlFromList(list< auto > l)
returns an SQL string corresponding to the list of commands in the argument
string getRenameColumnSql(string old_name, string new_name, *hash< auto > opt)
gets an SQL string that can be used to rename an existing column in the table
AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash< auto > opt, *reference< string > sql)
adds a check constraint to the table; if the table is already known to be in the database,...
ForeignConstraints getForeignConstraints(*hash< auto > opt)
returns a ForeignConstraints object describing the foreign constraints that the table has on other ta...
string getSqlValue(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
const TriggerOptions
default trigger options
Definition AbstractTable.qc.dox.h:73
const AlignTableOptions
table alignment options
Definition AbstractTable.qc.dox.h:102
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
code getBulkUpsertClosure(hash< auto > example_row, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing either a single row or a se...
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost
*AbstractUniqueConstraint findUniqueConstraint(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
string getCreateSqlString(*hash< auto > opt)
returns an SQL string that could be used to create the table and all known properties of the table
int del()
SqlUtil::AbstractTable::del() variant
const UpsertResultMap
hash mapping upsert results to a description
Definition AbstractTable.qc.dox.h:282
AbstractSavepointHelper getSavepointHelper(*string savepoint)
get DB-specific savepoint helper
hash< auto > getSqlDataCallbackOptions()
returns the sql data operation callback options for this driver
truncate()
truncates all the table data without any transaction management
AbstractTrigger dropTrigger(string tname, *reference< string > sql)
drops the given trigger from the table; if the table is known to be in the database already,...
AbstractDataProviderType getDbType(AbstractColumn column, *hash< SqlUtilDataTypeOptionInfo > options)
returns the DB type for the given column type
*string getDropConstraintIfExistsSql(string cname, *hash< auto > opt, *reference< AbstractConstraint > cref)
gets the SQL that can be used to drop a constraint from the table if it exists, otherwise returns NOT...
string getAlignSqlString(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns an SQL string that could be executed to align the struc...
AbstractTrigger addTrigger(string tname, string src, *hash< auto > opt, *reference lsql)
adds a trigger to the table; if the table is already known to be in the database, then it is added in...
*list< auto > findAll(*hash< auto > cond)
finds all rows in the table with the given column values; a list of hashes is returned representing t...
Qore::SQL::SQLStatement getRowIteratorNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
bool manual
manual edits
Definition AbstractTable.qc.dox.h:315
*list find(list< auto > ids)
finds rows in the table with the given primary key values; if no row matches any primary key value pa...
deprecated *hash< string, int > upsertFromSelectNoCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
hash< auto > getForeignConstraintOptions()
return the foreign constraint options for this driver
const ForeignConstraintOptions
default foreign constraint options
Definition AbstractTable.qc.dox.h:67
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash
Definition AbstractTable.qc.dox.h:140
const InsertFromIteratorOptions
default insert option keys
Definition AbstractTable.qc.dox.h:182
string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash< auto > opt)
returns an SQL string that can be used to add a foreign constraint to the table
bool empty()
returns True if the table has no definitions, False if not
deprecated int delNoCommit(*hash< auto > cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::del() wrapper.
Qore::AbstractIterator getUniqueConstraintIterator()
returns an iterator for all unique constraints on the table (including the primary key if any)
hash< auto > getExpressionMap()
Returns the expression map for this database server.
*hash< auto > select(*hash< auto > sh, *hash< auto > opt)
returns a hash of lists representing the columns and rows in the table that match the argument hash
Indexes indexes
index descriptions
Definition AbstractTable.qc.dox.h:303
*list< auto > getCreateIndexesSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create indexes on the table or NOTHING if there a...
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
hash< SqlResultInfo > insertFromSelectWithInfo(list< auto > cols, AbstractTable source, hash< auto > select_hash, *hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
hash< auto > getWhereOperatorMap()
returns the "where" operator map for this object
abstract bool tryInsertImpl(string sql, hash< auto > row)
tries to insert a row, if there is a duplicate key, then it returns False, if successful,...
create(*hash< auto > opt)
creates the table with all associated properties (indexes, constraints, etc) without any transaction ...
*hash< auto > selectRow(*hash< auto > sh, *hash< auto > opt)
returns a hash representing the row in the table that matches the argument hash; if more than one row...
list< auto > getModifyColumnSql(string cname, hash< auto > copt, bool nullable=True, *hash< auto > opt)
gets a list of SQL strings that can be used to modify an existing column in the table
the base class for triggers
Definition SqlUtil.qm.dox.h:6304
represents a unique column constraint
Definition SqlUtil.qm.dox.h:6012
column container class that throws an exception if an unknown column is accessed
Definition SqlUtil.qm.dox.h:5429
constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:5777
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:6032
index container class that throws an exception if an unknown index is accessed
Definition SqlUtil.qm.dox.h:5643
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition Table.qc.dox.h:44
the table container class stores a collection of tables in a schema
Definition SqlUtil.qm.dox.h:5241
trigger container class that throws an exception if an unknown trigger is accessed
Definition SqlUtil.qm.dox.h:6322
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition AbstractTable.qc.dox.h:214
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition AbstractTable.qc.dox.h:249
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition AbstractTable.qc.dox.h:237
const UpsertInsertFirst
Definition AbstractTable.qc.dox.h:206
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition AbstractTable.qc.dox.h:244
const UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.
Definition AbstractTable.qc.dox.h:230
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition AbstractTable.qc.dox.h:255
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist,...
Definition AbstractTable.qc.dox.h:223
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition AbstractTable.qc.dox.h:270
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition AbstractTable.qc.dox.h:267
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition AbstractTable.qc.dox.h:276
const UR_Inserted
Definition AbstractTable.qc.dox.h:264
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly)
Definition AbstractTable.qc.dox.h:273
Qore AbstractDatabase class definition.
Definition AbstractDatabase.qc.dox.h:26