Qore SqlUtil Module Reference 1.9.2
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 *AbstractUniqueConstraint matchAnyUnique(softlist<auto> cols);
2717
2718
2719protected:
2720 string getSelectSqlStringIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2721public:
2722
2723
2724 // column & table information must be retrieved before calling this method
2725protected:
2726 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);
2727public:
2728
2729
2731 AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2732
2733
2734 string getExpressionArg(reference<hash<QueryInfo>> info, int role, auto arg, AbstractDataProviderType expected_type);
2735
2736
2737protected:
2738 string getFromIntern(string from, *hash<auto> qh);
2739public:
2740
2741
2742protected:
2743 list<auto> getGroupByListUnlocked(hash<QueryInfo> info, list<auto> coll);
2744public:
2745
2746
2747protected:
2748 list<auto> getOrderByListIntern(hash<QueryInfo> info, list<auto> coll);
2749public:
2750
2751
2752protected:
2753 list<auto> getGroupOrderByListIntern(hash<QueryInfo> info, string key, list<auto> coll);
2754public:
2755
2756
2757protected:
2758 doForUpdate(reference<string> sql);
2759public:
2760
2761
2762protected:
2763 string getSelectSqlName(*hash<auto> qh);
2764public:
2765
2766
2767protected:
2768 string getColumnExpressionIntern(reference<hash<QueryInfo>> info, auto cvc);
2769public:
2770
2771
2772protected:
2773 string doColumnOperatorIntern(reference<hash<QueryInfo>> info, hash<auto> cvc);
2774public:
2775
2776
2777protected:
2778 string doColumnOperatorIntern(reference<hash<QueryInfo>> info, auto cop, auto arg, *string cve);
2779public:
2780
2781
2782protected:
2783 string getColumnNameIntern(hash<QueryInfo> info, string column_name);
2784public:
2785
2786
2788protected:
2790public:
2791
2792
2793protected:
2794 getSelectWhereSqlIntern(reference<hash<QueryInfo>> info, reference<string> sql);
2795public:
2796
2797
2798protected:
2799 *string getWhereClause(*hash<auto> cond, reference<list<auto>> args, *string cprefix, *hash<string, AbstractTable> join_map);
2800public:
2801
2802
2803protected:
2804 *string getWhereExpressionIntern(reference<hash<QueryInfo>> info, hash<DataProviderExpression> cond, *string cprefix);
2805public:
2806
2807
2808protected:
2809 *string getExpressionIntern(reference<hash<QueryInfo>> info, int role, hash<DataProviderExpression> cond, AbstractDataProviderType expected_type);
2810public:
2811
2812
2813protected:
2814 *string getWhereClauseIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
2815public:
2816
2817
2818protected:
2819 *list<string> getWhereClauseListIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
2820public:
2821
2822
2823protected:
2824 string doWhereExpressionIntern(reference<hash<QueryInfo>> info, string cn, auto we);
2825public:
2826
2827
2828 string getOrClause(reference<hash<QueryInfo>> info, list<auto> arglist);
2829
2830
2831 string getOrClause(reference<hash<QueryInfo>> info, hash<auto> arg);
2832
2833
2834protected:
2835 doSelectOrderBySqlIntern(hash<QueryInfo> info, reference<string> sql, list<auto> coll);
2836public:
2837
2838
2840
2856 int delCommit(hash<auto> cond, reference<string> sql, hash<auto> opt);
2857
2858
2860 int delCommit(hash<auto> cond, hash<auto> opt);
2861
2862
2864 int delCommit(hash<auto> cond, reference<string> sql);
2865
2866
2868 int delCommit(hash<auto> cond);
2869
2870
2873
2874
2876
2891 int del(hash<auto> cond, reference<string> sql, hash<auto> opt);
2892
2893
2895 int del(hash<auto> cond, hash<auto> opt);
2896
2897
2899 int del(hash<auto> cond, reference<string> sql);
2900
2901
2903 int del(hash<auto> cond);
2904
2905
2907 int del();
2908
2909
2911
2925 hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
2926
2927
2929 deprecated int delNoCommit(*hash<auto> cond, *reference<string> sql);
2930
2931protected:
2932 int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2933public:
2934
2935
2937
2954 int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
2955
2956
2958 int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql);
2959
2960
2962 int updateCommit(hash<auto> set, hash<auto> cond, hash<auto> opt);
2963
2964
2966 int updateCommit(hash<auto> set, hash<auto> cond);
2967
2968
2970 int updateCommit(hash<auto> set);
2971
2972
2974
2991 int update(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
2992
2993
2995 int update(hash<auto> set, hash<auto> cond, reference<string> sql);
2996
2997
2999 int update(hash<auto> set, hash<auto> cond, hash<auto> opt);
3000
3001
3003 int update(hash<auto> set, hash<auto> cond);
3004
3005
3007 int update(hash<auto> set);
3008
3009
3011
3029 hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
3030
3031
3033
3045 hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
3046
3047
3049 deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *reference<string> sql);
3050
3052 deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *hash<auto> opt);
3053
3054protected:
3055 int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
3056public:
3057
3058
3059protected:
3060 string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3061public:
3062
3063
3064protected:
3065 bool emptyDataIntern();
3066public:
3067
3068
3069protected:
3070 Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3071public:
3072
3073
3074protected:
3075 code getUpsertInsertFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3076public:
3077
3078
3079protected:
3080 code getUpsertUpdateFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3081public:
3082
3083
3084protected:
3085 code getUpsertSelectFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3086public:
3087
3088
3089protected:
3090 code getUpsertInsertOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3091public:
3092
3093
3094protected:
3095 code getUpsertUpdateOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3096public:
3097
3098
3099protected:
3100 Columns getUpsertColumns(reference<string> csrc);
3101public:
3102
3103
3105
3113protected:
3114 hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
3115public:
3116
3117
3118protected:
3119 bool matchUniqueColumns(Columns cols, hash<auto> row);
3120public:
3121
3122
3123protected:
3124 string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3125public:
3126
3127
3128protected:
3129 string getUpsertInsertSql(hash<auto> row);
3130public:
3131
3132
3133protected:
3134 string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3135public:
3136
3137
3138protected:
3139 softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3140public:
3141
3142
3143protected:
3144 checkValue(string cname, string argname, reference val, string type);
3145public:
3146
3147
3149
3158 string getSqlFromList(list<auto> l);
3159
3160
3162
3173 string getSqlValue(auto v);
3174
3175
3177 string getName();
3178
3179
3181
3188 cache(*hash<auto> opts);
3189
3190
3192
3198
3199
3201
3212
3213
3215
3223
3224
3226
3235
3236
3238
3248
3249
3251
3260protected:
3262public:
3263
3264
3266
3276
3277
3280
3281
3284
3285
3287
3297
3298
3300
3322 string getRenameSql(string new_name, *hash<auto> opt);
3323
3324
3326
3335 string getCreateSqlString(*hash<auto> opt);
3336
3337
3339
3348 list<auto> getCreateSql(*hash<auto> opt);
3349
3350
3352
3363 string getCreateTableSql(*hash<auto> opt);
3364
3365
3367
3372
3373
3374protected:
3375 *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3376public:
3377
3378
3380
3402 list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3403
3404
3405protected:
3406 list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3407public:
3408
3409
3410protected:
3411 *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3412public:
3413
3414
3415protected:
3416 *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3417public:
3418
3419
3420protected:
3421 renameIndexUnlocked(AbstractIndex ix, string new_name);
3422public:
3423
3424
3426
3439 string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3440
3441
3443
3455 *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3456
3457
3459
3471 *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3472
3473
3475
3487 *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3488
3489
3491
3505 *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3506
3507
3509
3521 *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3522
3523
3525
3539 *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3540
3541
3543
3550 *hash find(auto id);
3551
3552
3554
3565 *list find(list<auto> ids);
3566
3567
3568protected:
3569 string getPrimaryKeyColumn();
3570public:
3571
3572
3574
3587 *hash<auto> find(hash<auto> row);
3588
3589
3591
3604 *hash<auto> findSingle(*hash<auto> cond);
3605
3606
3608
3621 *list<auto> findAll(*hash<auto> cond);
3622
3623
3625
3629 string getDesc();
3630
3631
3633 string getBaseType();
3634
3635
3637 string getSqlName();
3638
3639
3641 string getColumnSqlName(string col);
3642
3643
3645 list<auto> getColumnSqlNames(softlist cols);
3646
3647
3649
3652
3653
3655
3659 *hash<string, AbstractDataField> getRecordType();
3660
3661
3663
3672 AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3673
3674
3676
3684 AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3685
3686
3688
3696 AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3697
3698
3700
3702 AbstractDataProviderType getDbType(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options);
3703
3704
3706
3708 AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3709
3710
3712
3714 AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3715
3716
3718
3723
3724
3726
3730 hash<auto> getExpressionMap();
3731
3732
3734
3737
3738
3740 abstract bool hasArrayBind();
3741
3743
3745protected:
3746 hash<auto> getTableOptions();
3747public:
3748
3749
3751
3753protected:
3755public:
3756
3757
3759
3761protected:
3763public:
3764
3765
3767
3769protected:
3770 hash<auto> getCacheOptions();
3771public:
3772
3773
3775
3777protected:
3779public:
3780
3781
3783
3785protected:
3787public:
3788
3789
3791
3793protected:
3795public:
3796
3797
3799
3801protected:
3802 hash<auto> getColumnOptions();
3803public:
3804
3805
3807
3809protected:
3811public:
3812
3813
3815
3817protected:
3819public:
3820
3821
3823
3825protected:
3826 hash<auto> getIndexOptions();
3827public:
3828
3829
3831
3833protected:
3834 hash<auto> getTriggerOptions();
3835public:
3836
3837
3839
3841protected:
3842 hash<auto> getSelectOptions();
3843public:
3844
3845
3847
3849protected:
3850 hash<auto> getUpsertOptions();
3851public:
3852
3853
3855
3857protected:
3858 hash<auto> getInsertOptions();
3859public:
3860
3861
3863
3865protected:
3867public:
3868
3869
3871
3873protected:
3875public:
3876
3877
3879
3881protected:
3883public:
3884
3885
3887protected:
3889public:
3890
3891
3893
3929 addCustomCopOperator(string name, hash<auto> operator);
3930
3931
3933
3935 bool isDuplicateRowError(hash<ExceptionInfo> ex);
3936
3937
3939
3941protected:
3943public:
3944
3945
3947
3949protected:
3951public:
3952
3953
3955
3957protected:
3959public:
3960
3961
3963
3965protected:
3966 *hash<auto> getPseudoColumnHash();
3967public:
3968
3969
3970protected:
3971 string getCreateTableSqlUnlocked(*hash<auto> opt);
3972public:
3973
3974
3975protected:
3976 *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
3977public:
3978
3979
3980protected:
3981 *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
3982public:
3983
3984
3985protected:
3986 *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3987public:
3988
3989
3990protected:
3991 *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3992public:
3993
3994
3995protected:
3996 *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
3997public:
3998
3999
4000protected:
4001 *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
4002public:
4003
4004
4005protected:
4006 list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
4007public:
4008
4009
4010protected:
4011 cacheUnlocked(*hash<auto> opt);
4012public:
4013
4014
4015protected:
4016 auto execData(*hash<auto> opt, string sql, *list<auto> args);
4017public:
4018
4019
4020protected:
4021 execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
4022public:
4023
4024
4025 static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
4026
4027 static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
4028
4029 static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
4030
4031protected:
4032 getColumnsUnlocked();
4033public:
4034
4035
4036protected:
4037 getPrimaryKeyUnlocked();
4038public:
4039
4040
4041 // also loads primary key and constraints (for unique constraints)
4042protected:
4043 getIndexesUnlocked();
4044public:
4045
4046
4047protected:
4048 getForeignConstraintsUnlocked(*hash<auto> opt);
4049public:
4050
4051
4052protected:
4053 addSourceConstraint(string table_name, AbstractForeignConstraint fk);
4054public:
4055
4056
4057protected:
4058 getConstraintsUnlocked();
4059public:
4060
4061
4062protected:
4063 getTriggersUnlocked();
4064public:
4065
4066
4068protected:
4070public:
4071
4072
4073protected:
4074 softlist<auto> getDropSqlImpl();
4075public:
4076
4077
4078protected:
4079 string getTruncateSqlImpl();
4080public:
4081
4082
4084protected:
4085 auto tryExecArgsImpl(string sql, *softlist<auto> args);
4086public:
4087
4088
4090protected:
4091 auto tryExecRawImpl(string sql);
4092public:
4093
4094
4096protected:
4098public:
4099
4100
4101protected:
4102 preSetupTableImpl(reference desc, *hash<auto> opt);
4103public:
4104
4105
4107
4109protected:
4110 abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
4111public:
4112
4113protected:
4114 abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
4115public:
4116
4117protected:
4118 abstract bool emptyImpl();
4119public:
4120
4122protected:
4123 abstract *string getSqlValueImpl(auto v);
4124public:
4125
4127
4130protected:
4131 abstract bool checkExistenceImpl();
4132public:
4133
4135protected:
4137public:
4138
4140protected:
4142public:
4143
4145protected:
4147public:
4148
4149protected:
4150 abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4151public:
4152
4153protected:
4154 abstract Columns describeImpl();
4155public:
4156protected:
4157 abstract AbstractPrimaryKey getPrimaryKeyImpl();
4158public:
4160protected:
4162public:
4163protected:
4164 abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4165public:
4166protected:
4167 abstract Constraints getConstraintsImpl();
4168public:
4169protected:
4170 abstract Triggers getTriggersImpl();
4171public:
4172
4173protected:
4174 abstract string getCreateTableSqlImpl(*hash<auto> opt);
4175public:
4176protected:
4177 abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4178public:
4179protected:
4180 abstract string getCreateSqlImpl(list<auto> l);
4181public:
4182protected:
4183 abstract string getRenameSqlImpl(string new_name);
4184public:
4185protected:
4186 abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4187public:
4188
4189protected:
4190 abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4191public:
4192protected:
4193 abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4194public:
4195protected:
4196 abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4197public:
4198protected:
4199 abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4200public:
4201protected:
4202 abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4203public:
4204protected:
4205 abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4206public:
4207
4208protected:
4209 abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4210public:
4211
4213protected:
4214 abstract bool tryInsertImpl(string sql, hash<auto> row);
4215public:
4216
4218protected:
4219 abstract hash<auto> getQoreTypeMapImpl();
4220public:
4221
4223protected:
4224 abstract hash<auto> getTypeMapImpl();
4225public:
4226
4228protected:
4229 abstract doSelectOrderByWithOffsetSqlInternImpl(reference<hash<QueryInfo>> info, reference<string> sql, list<auto> coll);
4230public:
4231
4233protected:
4234 abstract doSelectLimitOnlyInternImpl(reference<hash<QueryInfo>> info, reference<string> sql);
4235public:
4236
4238protected:
4240public:
4241
4243
4247protected:
4249public:
4250
4252
4254protected:
4255 abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4256public:
4257};
4258};
abstract class for check constraints
Definition SqlUtil.qm.dox.h:5875
the base class for column information
Definition SqlUtil.qm.dox.h:5505
the API for a constraint with columns
Definition SqlUtil.qm.dox.h:5932
abstract base class for constraints
Definition SqlUtil.qm.dox.h:5813
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:6096
the abstract base class for index information
Definition SqlUtil.qm.dox.h:5683
represents a primary key
Definition SqlUtil.qm.dox.h:6015
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:6298
represents a unique column constraint
Definition SqlUtil.qm.dox.h:6006
column container class that throws an exception if an unknown column is accessed
Definition SqlUtil.qm.dox.h:5423
constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:5771
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:6026
index container class that throws an exception if an unknown index is accessed
Definition SqlUtil.qm.dox.h:5637
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:5235
trigger container class that throws an exception if an unknown trigger is accessed
Definition SqlUtil.qm.dox.h:6316
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