Qore SqlUtil Module Reference 2.3.0
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
184 const UpsertOptions = ...;
185
186
188
193
194
211
217
219
225
227
234
236
240 const UpsertAuto = 4;
241
243
248
250
255
257
259 const UpsertStrategyMap = ...;
260
261
263
266
268
274 const UR_Inserted = 1;
275
277 const UR_Verified = 2;
278
280 const UR_Updated = 3;
281
283 const UR_Unchanged = 4;
284
286 const UR_Deleted = 5;
288
290
292 const UpsertResultMap = ...;
293
294
296
299
300
303
304
305protected:
307 string name;
321 bool native_case = False;
323 bool inDb = False;
325 bool manual = False;
326
327 hash m_customCopMap = {};
328
329public:
330
332
340protected:
341 constructor(AbstractDatasource nds, string nname, *hash nopts) ;
342public:
343
344
347
348
350
361 setDatasource(AbstractDatasource nds);
362
363
364protected:
365 doTableOptions(*hash<auto> nopts);
366public:
367
368
371
372
375
376
379
380
382
391 bool inDb();
392
393
395
403
404
406
418 dropCommit(*hash<auto> opt);
419
420
422
436 drop(*hash<auto> opt);
437
438
440 deprecated dropNoCommit(*hash<auto> opt);
441
443
454 auto tryExec(string sql);
455
456
458
468 auto tryExecArgs(string sql, *softlist<auto> args);
469
470
472
483 auto tryExecRaw(string sql);
484
485
487
499 softlist<auto> getDropSql(*hash<auto> opt);
500
501
503
512
513
515
527
528
530 deprecated truncateNoCommit();
531
533
551 string getTruncateSql(*hash<auto> opt);
552
553
555
564 createCommit(*hash<auto> opt);
565
566
568
582 create(*hash<auto> opt);
583
584
586 deprecated createNoCommit(*hash<auto> opt);
587
589
605 rename(string new_name, *reference<string> sql, *Tables table_cache);
606
607
608protected:
609 doRenameIntern(string new_name, *Tables table_cache);
610public:
611
612
614
625 bool emptyData();
626
627
629
638 bool empty();
639
640
641protected:
642 bool emptyUnlocked();
643public:
644
645
647
655 setupTable(hash<auto> desc, *hash<auto> opt);
656
657
659
683 AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
684
685
687
716 list<auto> getAddColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
717
718
719protected:
720 AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
721public:
722
723
724protected:
725 addColumnToTableUnlocked(AbstractColumn c);
726public:
727
728
730
755 AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
756
757
759
786 list<auto> getModifyColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
787
788
790
807 AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
808
809
811
829 string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
830
831
832protected:
833 AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
834public:
835
836
837protected:
838 validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt);
839public:
840
841
842protected:
843 validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt, string tag);
844public:
845
846
847protected:
848 execSql(softlist lsql);
849public:
850
851
853
873 AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
874
875
877
899 string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
900
901
902protected:
903 setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
904public:
905
906
907protected:
908 AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
909public:
910
911
912protected:
913 AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
914public:
915
916
918
934 list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
935
936
937protected:
938 list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
939public:
940
941
943
962 list<auto> getDropPrimaryKeySql(*hash<auto> opt);
963
964
966
985
986
988
1009 AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1010
1011
1013
1033 string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
1034
1035
1036protected:
1037 AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1038public:
1039
1040
1041protected:
1042 AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1043public:
1044
1045
1047
1068 AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1069
1070
1072
1093 string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1094
1095
1096protected:
1097 AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1098public:
1099
1100
1101protected:
1102 AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1103public:
1104
1105
1107
1119 AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1120
1121
1123
1141 AbstractIndex dropIndex(string iname, *reference<string> sql);
1142
1143
1145
1164 string getDropIndexSql(string iname, *hash<auto> opt);
1165
1166
1168
1190 AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1191
1192
1194
1216 string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1217
1218
1219protected:
1220 Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1221public:
1222
1223
1224protected:
1225 AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1226public:
1227
1228
1229protected:
1230 AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1231public:
1232
1233
1235
1253 AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1254
1255
1257
1273
1274
1276
1296 AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1297
1298
1300
1322 string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1323
1324
1325protected:
1326 AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1327public:
1328
1329
1330protected:
1331 AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1332public:
1333
1334
1336
1348 AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1349
1350
1352
1371 string getDropConstraintSql(string cname, *hash<auto> opt);
1372
1373
1375
1394 *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1395
1396
1397protected:
1398 AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1399public:
1400
1401
1403
1421 AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1422
1423
1425
1445 AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1446
1447
1449
1471 list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1472
1473
1474protected:
1475 AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1476public:
1477
1478
1479protected:
1480 AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1481public:
1482
1483
1485
1503 AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1504
1505
1507
1526 list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1527
1528
1529protected:
1530 getAllConstraintsUnlocked(*hash<auto> opt);
1531public:
1532
1533
1534protected:
1535 checkUniqueConstraintName(string err, string cname);
1536public:
1537
1538
1539protected:
1540 checkUniqueConstraintNameValidateOptions(string err, string cname, hash<auto> ropt, reference<hash> opt);
1541public:
1542
1543
1545protected:
1546 validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1547public:
1548
1549
1551
1569 AbstractColumn dropColumn(string cname, *reference lsql);
1570
1571
1573
1592 list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1593
1594
1596
1607 *hash<auto> insertCommit(hash<auto> row);
1608
1609
1611
1615 *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1616
1617
1619
1623 *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1624
1625
1627
1632 *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1633
1634
1636
1648 *hash<auto> insert(hash<auto> row);
1649
1650
1652
1656 *hash<auto> insert(hash<auto> row, reference<string> sql);
1657
1658
1660
1664 *hash<auto> insert(hash<auto> row, hash<auto> opt);
1665
1666
1668
1673 *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1674
1675
1677
1686 hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
1687
1688
1690 deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1691
1693 deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1694
1695protected:
1696 *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1697public:
1698
1699
1700protected:
1701 hash<auto> getPlaceholdersAndValues(hash<auto> row);
1702public:
1703
1704
1706
1710
1711
1713
1732 int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1733
1734
1737
1738
1740 int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1741
1742
1744 int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1745
1746
1748 int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1749
1750
1752
1771 int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1772
1773
1775 int insertFromSelect(list cols, AbstractTable source);
1776
1777
1779 int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1780
1781
1783 int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1784
1785
1787 int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1788
1789
1791
1804 hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash, *hash<auto> opt);
1805
1806
1808 deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1809
1810protected:
1811 int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1812public:
1813
1814
1816
1835
1836
1838
1857
1858
1860 deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
1861
1862protected:
1863 int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
1864public:
1865
1866
1868
1884 int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1885
1886
1888
1904 int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1905
1906
1908 deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
1909
1911
1944 code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1945
1946
1948
1975 code getBulkUpsertClosure(hash<auto> example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
1976
1977
1979
2000 code getUpsertClosureWithValidation(hash<auto> example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
2001
2002
2004
2036 *hash<string, int> upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2037
2038
2040
2072 *hash<string, int> upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2073
2074
2076 deprecated *hash<string, int> upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2077
2078protected:
2079 *hash<string, int> upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2080public:
2081
2082
2083protected:
2084 *hash<string, int> doDeleteOthersIntern(hash<auto> pkh, *hash<auto> opt);
2085public:
2086
2087
2089
2151 *hash<string, int> upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2152
2153
2155 *hash<string, int> upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2156
2157
2159
2199 *hash<string, int> upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2200
2201
2203 deprecated *hash<string, int> upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2204
2206 deprecated *hash<string, int> upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2207
2209 deprecated *hash<string, int> upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2210
2212
2223 softint rowCount();
2224
2225
2227
2248 Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2249
2250
2252
2275 Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2276
2277
2279
2299 Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2300
2301
2303
2325 Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2326
2327
2329
2350 Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2351
2352
2354
2386 hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2387
2388
2390
2412 Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2413
2414
2416
2444 hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2445
2446
2448
2469 Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2470
2471
2472protected:
2473 Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args);
2474public:
2475
2476
2478
2499 *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2500
2501
2502protected:
2503 *hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2504public:
2505
2506
2508
2534 hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2535
2536
2538
2558 *list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2559
2560
2561protected:
2562 *list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2563public:
2564
2565
2567
2592 hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2593
2594
2596
2615 *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2616
2617
2618protected:
2619 *hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2620public:
2621
2622
2624
2649 hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2650
2651
2653
2671 *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2672
2673
2675
2692 *list<auto> selectRows(*hash<auto> sh, *hash<auto> opt);
2693
2694
2696
2713 *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2714
2715
2717
2735 string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2736
2737
2738 bool testMatchAnyUnique(softlist<auto> cols);
2739
2740
2741 *AbstractUniqueConstraint matchAnyUnique(softlist<auto> cols);
2742
2743
2744protected:
2745 string getSelectSqlStringIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2746public:
2747
2748
2749 // column & table information must be retrieved before calling this method
2750protected:
2751 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);
2752public:
2753
2754
2756 AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2757
2758
2759 string getExpressionArg(reference<hash<QueryInfo>> info, int role, auto arg, AbstractDataProviderType expected_type);
2760
2761
2762protected:
2763 string getFromIntern(string from, *hash<auto> qh);
2764public:
2765
2766
2767protected:
2768 list<auto> getGroupByListUnlocked(hash<QueryInfo> info, list<auto> coll);
2769public:
2770
2771
2772protected:
2773 list<auto> getOrderByListIntern(hash<QueryInfo> info, list<auto> coll);
2774public:
2775
2776
2777protected:
2778 list<auto> getGroupOrderByListIntern(hash<QueryInfo> info, string key, list<auto> coll);
2779public:
2780
2781
2782protected:
2783 doForUpdate(reference<string> sql);
2784public:
2785
2786
2787protected:
2788 string getSelectSqlName(*hash<auto> qh);
2789public:
2790
2791
2792protected:
2793 string getColumnExpressionIntern(reference<hash<QueryInfo>> info, auto cvc);
2794public:
2795
2796
2797protected:
2798 string doColumnOperatorIntern(reference<hash<QueryInfo>> info, hash<auto> cvc);
2799public:
2800
2801
2802protected:
2803 string doColumnOperatorIntern(reference<hash<QueryInfo>> info, auto cop, auto arg, *string cve);
2804public:
2805
2806
2807protected:
2808 string getColumnNameIntern(hash<QueryInfo> info, string column_name);
2809public:
2810
2811
2813protected:
2815public:
2816
2817
2818protected:
2819 getSelectWhereSqlIntern(reference<hash<QueryInfo>> info, reference<string> sql);
2820public:
2821
2822
2823protected:
2824 *string getWhereClause(*hash<auto> cond, reference<list<auto>> args, *string cprefix, *hash<string, AbstractTable> join_map);
2825public:
2826
2827
2828protected:
2829 *string getWhereExpressionIntern(reference<hash<QueryInfo>> info, hash<DataProviderExpression> cond, *string cprefix);
2830public:
2831
2832
2833protected:
2834 *string getExpressionIntern(reference<hash<QueryInfo>> info, int role, hash<DataProviderExpression> cond, AbstractDataProviderType expected_type);
2835public:
2836
2837
2838protected:
2839 *string getWhereClauseIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
2840public:
2841
2842
2843protected:
2844 *list<string> getWhereClauseListIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
2845public:
2846
2847
2848protected:
2849 string doWhereExpressionIntern(reference<hash<QueryInfo>> info, string cn, auto we);
2850public:
2851
2852
2853 string getOrClause(reference<hash<QueryInfo>> info, list<auto> arglist);
2854
2855
2856 string getOrClause(reference<hash<QueryInfo>> info, hash<auto> arg);
2857
2858
2859protected:
2860 doSelectOrderBySqlIntern(hash<QueryInfo> info, reference<string> sql, list<auto> coll);
2861public:
2862
2863
2865
2881 int delCommit(hash<auto> cond, reference<string> sql, hash<auto> opt);
2882
2883
2885 int delCommit(hash<auto> cond, hash<auto> opt);
2886
2887
2889 int delCommit(hash<auto> cond, reference<string> sql);
2890
2891
2893 int delCommit(hash<auto> cond);
2894
2895
2898
2899
2901
2916 int del(hash<auto> cond, reference<string> sql, hash<auto> opt);
2917
2918
2920 int del(hash<auto> cond, hash<auto> opt);
2921
2922
2924 int del(hash<auto> cond, reference<string> sql);
2925
2926
2928 int del(hash<auto> cond);
2929
2930
2932 int del();
2933
2934
2936
2950 hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
2951
2952
2954 deprecated int delNoCommit(*hash<auto> cond, *reference<string> sql);
2955
2956protected:
2957 int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2958public:
2959
2960
2962
2981 int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
2982
2983
2985 int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql);
2986
2987
2989 int updateCommit(hash<auto> set, hash<auto> cond, hash<auto> opt);
2990
2991
2993 int updateCommit(hash<auto> set, hash<auto> cond);
2994
2995
2997 int updateCommit(hash<auto> set);
2998
2999
3001
3020 int update(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
3021
3022
3024 int update(hash<auto> set, hash<auto> cond, reference<string> sql);
3025
3026
3028 int update(hash<auto> set, hash<auto> cond, hash<auto> opt);
3029
3030
3032 int update(hash<auto> set, hash<auto> cond);
3033
3034
3036 int update(hash<auto> set);
3037
3038
3040
3059 hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
3060
3061
3063
3078 hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
3079
3080
3082 deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *reference<string> sql);
3083
3085 deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *hash<auto> opt);
3086
3087protected:
3088 int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
3089public:
3090
3091
3092protected:
3093 string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3094public:
3095
3096
3097protected:
3098 bool emptyDataIntern();
3099public:
3100
3101
3102protected:
3103 Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3104public:
3105
3106
3107protected:
3108 code getUpsertInsertFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3109public:
3110
3111
3112protected:
3113 code getUpsertUpdateFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3114public:
3115
3116
3117protected:
3118 code getUpsertSelectFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3119public:
3120
3121
3122protected:
3123 code getUpsertInsertOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3124public:
3125
3126
3127protected:
3128 code getUpsertUpdateOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3129public:
3130
3131
3132protected:
3133 Columns getUpsertColumns(reference<string> csrc);
3134public:
3135
3136
3138
3146protected:
3147 hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
3148public:
3149
3150
3151protected:
3152 bool matchUniqueColumns(Columns cols, hash<auto> row);
3153public:
3154
3155
3156protected:
3157 string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3158public:
3159
3160
3161protected:
3162 string getUpsertInsertSql(hash<auto> row);
3163public:
3164
3165
3166protected:
3167 string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3168public:
3169
3170
3171protected:
3172 softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3173public:
3174
3175
3176protected:
3177 checkValue(string cname, string argname, reference val, string type);
3178public:
3179
3180
3182
3191 string getSqlFromList(list<auto> l);
3192
3193
3195
3206 string getSqlValue(auto v);
3207
3208
3210 string getName();
3211
3212
3214
3221 cache(*hash<auto> opts);
3222
3223
3225
3231
3232
3234
3245
3246
3248
3256
3257
3259
3268
3269
3271
3281
3282
3284
3293protected:
3295public:
3296
3297
3299
3309
3310
3313
3314
3317
3318
3320
3330
3331
3333
3355 string getRenameSql(string new_name, *hash<auto> opt);
3356
3357
3359
3368 string getCreateSqlString(*hash<auto> opt);
3369
3370
3372
3381 list<auto> getCreateSql(*hash<auto> opt);
3382
3383
3385
3396 string getCreateTableSql(*hash<auto> opt);
3397
3398
3400
3405
3406
3407protected:
3408 *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3409public:
3410
3411
3413
3435 list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3436
3437
3438protected:
3439 list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3440public:
3441
3442
3443protected:
3444 *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3445public:
3446
3447
3448protected:
3449 *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3450public:
3451
3452
3453protected:
3454 renameIndexUnlocked(AbstractIndex ix, string new_name);
3455public:
3456
3457
3459
3472 string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3473
3474
3476
3488 *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3489
3490
3492
3504 *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3505
3506
3508
3520 *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3521
3522
3524
3538 *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3539
3540
3542
3554 *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3555
3556
3558
3572 *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3573
3574
3576
3583 *hash find(auto id);
3584
3585
3587
3598 *list find(list<auto> ids);
3599
3600
3601protected:
3602 string getPrimaryKeyColumn();
3603public:
3604
3605
3607
3620 *hash<auto> find(hash<auto> row);
3621
3622
3624
3637 *hash<auto> findSingle(*hash<auto> cond);
3638
3639
3641
3654 *list<auto> findAll(*hash<auto> cond);
3655
3656
3658
3662 string getDesc();
3663
3664
3666 string getBaseType();
3667
3668
3670 string getSqlName();
3671
3672
3674 string getColumnSqlName(string col);
3675
3676
3678 list<auto> getColumnSqlNames(softlist cols);
3679
3680
3682
3685
3686
3688
3692 *hash<string, AbstractDataField> getRecordType();
3693
3694
3696
3705 AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3706
3707
3709
3717 AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3718
3719
3721
3729 AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3730
3731
3733
3735 AbstractDataProviderType getDbType(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options);
3736
3737
3739
3741 AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3742
3743
3745
3747 AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3748
3749
3751
3756
3757
3759
3763 hash<auto> getExpressionMap();
3764
3765
3767
3770
3771
3773 abstract bool hasArrayBind();
3774
3776
3778protected:
3779 hash<auto> getTableOptions();
3780public:
3781
3782
3784
3786protected:
3788public:
3789
3790
3792
3794protected:
3796public:
3797
3798
3800
3802protected:
3803 hash<auto> getCacheOptions();
3804public:
3805
3806
3808
3810protected:
3812public:
3813
3814
3816
3818protected:
3820public:
3821
3822
3824
3826protected:
3828public:
3829
3830
3832
3834protected:
3835 hash<auto> getColumnOptions();
3836public:
3837
3838
3840
3842protected:
3844public:
3845
3846
3848
3850protected:
3852public:
3853
3854
3856
3858protected:
3859 hash<auto> getIndexOptions();
3860public:
3861
3862
3864
3866protected:
3867 hash<auto> getTriggerOptions();
3868public:
3869
3870
3872
3874protected:
3875 hash<auto> getSelectOptions();
3876public:
3877
3878
3880
3882protected:
3883 hash<auto> getUpsertOptions();
3884public:
3885
3886
3888
3890protected:
3891 hash<auto> getInsertOptions();
3892public:
3893
3894
3896
3898protected:
3900public:
3901
3902
3904
3906protected:
3908public:
3909
3910
3912
3914protected:
3916public:
3917
3918
3920protected:
3922public:
3923
3924
3926
3962 addCustomCopOperator(string name, hash<auto> operator);
3963
3964
3966
3968 bool isDuplicateRowError(hash<ExceptionInfo> ex);
3969
3970
3972
3974protected:
3976public:
3977
3978
3980
3982protected:
3984public:
3985
3986
3988
3990protected:
3992public:
3993
3994
3996
3998protected:
3999 *hash<auto> getPseudoColumnHash();
4000public:
4001
4002
4003protected:
4004 string getCreateTableSqlUnlocked(*hash<auto> opt);
4005public:
4006
4007
4008protected:
4009 *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
4010public:
4011
4012
4013protected:
4014 *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
4015public:
4016
4017
4018protected:
4019 *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
4020public:
4021
4022
4023protected:
4024 *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
4025public:
4026
4027
4028protected:
4029 *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
4030public:
4031
4032
4033protected:
4034 *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
4035public:
4036
4037
4038protected:
4039 list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
4040public:
4041
4042
4043protected:
4044 cacheUnlocked(*hash<auto> opt);
4045public:
4046
4047
4048protected:
4049 auto execData(*hash<auto> opt, string sql, *list<auto> args);
4050public:
4051
4052
4053protected:
4054 execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
4055public:
4056
4057
4058 static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
4059
4060 static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
4061
4062 static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
4063
4064protected:
4065 getColumnsUnlocked();
4066public:
4067
4068
4069protected:
4070 getPrimaryKeyUnlocked();
4071public:
4072
4073
4074 // also loads primary key and constraints (for unique constraints)
4075protected:
4076 getIndexesUnlocked();
4077public:
4078
4079
4080protected:
4081 getForeignConstraintsUnlocked(*hash<auto> opt);
4082public:
4083
4084
4085protected:
4086 addSourceConstraint(string table_name, AbstractForeignConstraint fk);
4087public:
4088
4089
4090protected:
4091 getConstraintsUnlocked();
4092public:
4093
4094
4095protected:
4096 getTriggersUnlocked();
4097public:
4098
4099
4101protected:
4103public:
4104
4105
4106protected:
4107 softlist<auto> getDropSqlImpl();
4108public:
4109
4110
4111protected:
4112 string getTruncateSqlImpl();
4113public:
4114
4115
4117protected:
4118 auto tryExecArgsImpl(string sql, *softlist<auto> args);
4119public:
4120
4121
4123protected:
4124 auto tryExecRawImpl(string sql);
4125public:
4126
4127
4129protected:
4131public:
4132
4133
4134protected:
4135 preSetupTableImpl(reference desc, *hash<auto> opt);
4136public:
4137
4138
4140
4142protected:
4143 abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
4144public:
4145
4146protected:
4147 abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
4148public:
4149
4150protected:
4151 abstract bool emptyImpl();
4152public:
4153
4155protected:
4156 abstract *string getSqlValueImpl(auto v);
4157public:
4158
4160
4163protected:
4164 abstract bool checkExistenceImpl();
4165public:
4166
4168protected:
4170public:
4171
4173protected:
4175public:
4176
4178protected:
4180public:
4181
4182protected:
4183 abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4184public:
4185
4186protected:
4187 abstract Columns describeImpl();
4188public:
4189protected:
4190 abstract AbstractPrimaryKey getPrimaryKeyImpl();
4191public:
4193protected:
4195public:
4196protected:
4197 abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4198public:
4199protected:
4200 abstract Constraints getConstraintsImpl();
4201public:
4202protected:
4203 abstract Triggers getTriggersImpl();
4204public:
4205
4206protected:
4207 abstract string getCreateTableSqlImpl(*hash<auto> opt);
4208public:
4209protected:
4210 abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4211public:
4212protected:
4213 abstract string getCreateSqlImpl(list<auto> l);
4214public:
4215protected:
4216 abstract string getRenameSqlImpl(string new_name);
4217public:
4218protected:
4219 abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4220public:
4221
4222protected:
4223 abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4224public:
4225protected:
4226 abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4227public:
4228protected:
4229 abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4230public:
4231protected:
4232 abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4233public:
4234protected:
4235 abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4236public:
4237protected:
4238 abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4239public:
4240
4241protected:
4242 abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4243public:
4244
4246protected:
4247 abstract bool tryInsertImpl(string sql, hash<auto> row);
4248public:
4249
4251protected:
4252 abstract hash<auto> getQoreTypeMapImpl();
4253public:
4254
4256protected:
4257 abstract hash<auto> getTypeMapImpl();
4258public:
4259
4261protected:
4262 abstract doSelectOrderByWithOffsetSqlInternImpl(reference<hash<QueryInfo>> info, reference<string> sql, list<auto> coll);
4263public:
4264
4266protected:
4267 abstract doSelectLimitOnlyInternImpl(reference<hash<QueryInfo>> info, reference<string> sql);
4268public:
4269
4271protected:
4273public:
4274
4276
4280protected:
4282public:
4283
4285
4287protected:
4288 abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4289public:
4290};
4291};
abstract class for check constraints
Definition SqlUtil.qm.dox.h:5885
the base class for column information
Definition SqlUtil.qm.dox.h:5515
the API for a constraint with columns
Definition SqlUtil.qm.dox.h:5942
abstract base class for constraints
Definition SqlUtil.qm.dox.h:5823
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:6106
the abstract base class for index information
Definition SqlUtil.qm.dox.h:5693
represents a primary key
Definition SqlUtil.qm.dox.h:6025
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:317
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:302
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:184
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:323
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:307
*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:321
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:309
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:315
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:298
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:319
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:311
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:292
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:325
*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:192
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:313
*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:6308
represents a unique column constraint
Definition SqlUtil.qm.dox.h:6016
column container class that throws an exception if an unknown column is accessed
Definition SqlUtil.qm.dox.h:5433
constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:5781
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:6036
index container class that throws an exception if an unknown index is accessed
Definition SqlUtil.qm.dox.h:5647
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:5245
trigger container class that throws an exception if an unknown trigger is accessed
Definition SqlUtil.qm.dox.h:6326
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition AbstractTable.qc.dox.h:224
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition AbstractTable.qc.dox.h:259
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition AbstractTable.qc.dox.h:247
const UpsertInsertFirst
Definition AbstractTable.qc.dox.h:216
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition AbstractTable.qc.dox.h:254
const UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.
Definition AbstractTable.qc.dox.h:240
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition AbstractTable.qc.dox.h:265
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist,...
Definition AbstractTable.qc.dox.h:233
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition AbstractTable.qc.dox.h:280
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition AbstractTable.qc.dox.h:277
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition AbstractTable.qc.dox.h:286
const UR_Inserted
Definition AbstractTable.qc.dox.h:274
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly)
Definition AbstractTable.qc.dox.h:283
Qore AbstractDatabase class definition.
Definition AbstractDatabase.qc.dox.h:26