Qore SqlUtil Module Reference 1.9.2
Loading...
Searching...
No Matches
SqlUtil.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* SqlUtil.qm Copyright (C) 2013 - 2024 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25// minimum required Qore version
26
27// requires the Util module
28
29// requires the DataProvider module
30
31// don't use "$" signs for variables and class members, assume local variable scope
32
33// require type definitions everywhere
34
35// enable all warnings
36
37
38// version history is included below in the docs
39
2328namespace SqlUtil {
2330 public hashdecl GenericColumnInfo {
2336 softint size;
2338 softint scale;
2344 *string comment;
2346 bool notnull = False;
2348 hash<string, hash> driver;
2351 };
2352
2354 public hashdecl OperatorInfo {
2355 string op;
2356 auto arg;
2357 };
2358
2360 public hashdecl ColumnOperatorInfo {
2361 string cop;
2362 auto column;
2363 auto arg;
2364 };
2365
2367 public hashdecl InsertOperatorInfo {
2368 string _iop;
2369 any arg;
2370 };
2371
2373 public hashdecl UpdateOperatorInfo {
2374 string uop;
2375 auto arg;
2376 *hash nest;
2377 };
2378
2380 public hashdecl JoinOperatorInfo {
2381 string jop;
2382 auto table;
2383 *string alias;
2384 *hash jcols;
2385 *hash cond;
2386 *string ta;
2387 *hash<auto> opt;
2388 };
2389
2394
2396 *TimeZone data_timezone;
2397
2399 *TimeZone db_timezone;
2400
2403
2405 *softbool mandatory;
2406
2408
2410 *softint maxlen;
2411 };
2412
2414
2416 public hashdecl SqlCommandInfo {
2418 string sql;
2419
2421 list<auto> args;
2422 };
2423
2429
2431 const DB_FUNCTIONS = "functions";
2433 const DB_MVIEWS = "materialized views";
2435 const DB_PACKAGES = "packages";
2437 const DB_PROCEDURES = "procedures";
2439 const DB_SEQUENCES = "sequences";
2441 const DB_TABLES = "tables";
2443 const DB_TYPES = "named types";
2445 const DB_VIEWS = "views";
2447 const DB_SYNONYMS = "synonyms";
2449
2450 /* @defgroup SqlTypeConstants SQL Type Constants
2451 These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
2452 */
2455 const VARCHAR = "string";
2456
2458 const NUMERIC = "number";
2459
2461 const CHAR = "char";
2462
2464 const BLOB = "blob";
2465
2467 const CLOB = "clob";
2469
2475 const SZ_NONE = 0;
2476
2478 const SZ_MAND = 1;
2479
2481 const SZ_OPT = 2;
2482
2484 const SZ_NUM = 3;
2486
2492
2494 const COP_AS = "as";
2495
2497
2499 const COP_CAST = "cast";
2500
2502
2504 const COP_PREPEND = "prepend";
2505
2507
2509 const COP_APPEND = "append";
2510
2512
2514 const COP_VALUE = "value";
2515
2517
2519 const COP_UPPER = "upper";
2520
2522
2524 const COP_LOWER = "lower";
2525
2527
2529 const COP_DISTINCT = "distinct";
2530
2532
2534 const COP_MIN = "min";
2535
2537
2539 const COP_MAX = "max";
2540
2542
2544 const COP_AVG = "avg";
2545
2547
2549 const COP_SUM = "sum";
2550
2552
2554 const COP_COUNT = "count";
2555
2557
2559 const COP_OVER = "over";
2560
2562
2564 const COP_MINUS = "minus";
2565
2567
2569 const COP_PLUS = "plus";
2570
2572
2574 const COP_DIVIDE = "divide";
2575
2577
2579 const COP_MULTIPLY = "multiply";
2580
2582
2584 const COP_YEAR = "year";
2585
2587
2589 const COP_YEAR_MONTH = "year_month";
2590
2592
2594 const COP_YEAR_DAY = "year_day";
2595
2597
2599 const COP_YEAR_HOUR = "year_hour";
2600
2602
2604 const COP_SEQ = "seq";
2605
2607
2609 const COP_SEQ_CURRVAL = "seq_currval";
2610
2612
2614 const COP_COALESCE = "coalesce";
2615
2617
2619 const COP_SUBSTR = "substr";
2620
2622
2626 const COP_LENGTH = "length";
2627
2629
2635 const COP_TRUNC_DATE = "truncate_date";
2636
2638
2642 const COP_CUME_DIST = "cume_dist";
2643
2645
2649 const COP_DENSE_RANK = "dense_rank";
2650
2652
2656 const COP_FIRST_VALUE = "first_value";
2657
2659
2663 const COP_LAST_VALUE = "last_value";
2664
2666
2670 const COP_NTILE = "ntile";
2671
2673
2677 const COP_PERCENT_RANK = "percent_rank";
2678
2680
2684 const COP_RANK = "rank";
2685
2687
2691 const COP_ROW_NUMBER = "row_number";
2692
2694 public hashdecl QueryInfo {
2696 object table;
2697
2699 *hash<auto> query_hash;
2700
2702 *hash<auto> query_options;
2703
2705 *hash<string, AbstractTable> join_map;
2706
2708 *hash<string, bool> subquery_column_map;
2709
2712
2714 *hash<auto> expression_map;
2715
2718
2721
2723 list<auto> args;
2724 };
2725
2727 const DefaultCopMap = ...;
2728
2730
2773
2781 hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
2782
2783
2785
2797 hash<ColumnOperatorInfo> cop_as(auto column, string arg);
2798
2799
2801
2815 hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
2816
2817
2819
2829 hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
2830
2831
2833
2843 hash<ColumnOperatorInfo> cop_append(auto column, string arg);
2844
2845
2847
2975 hash<ColumnOperatorInfo> cop_value(auto arg);
2976
2977
2979
2988 hash<ColumnOperatorInfo> cop_upper(auto column);
2989
2990
2992
3001 hash<ColumnOperatorInfo> cop_lower(auto column);
3002
3003
3005
3014 hash<ColumnOperatorInfo> cop_distinct(auto column);
3015
3016
3018
3027 hash<ColumnOperatorInfo> cop_min(auto column);
3028
3029
3031
3040 hash<ColumnOperatorInfo> cop_max(auto column);
3041
3042
3044
3053 hash<ColumnOperatorInfo> cop_avg(auto column);
3054
3055
3057
3066 hash<ColumnOperatorInfo> cop_sum(auto column);
3067
3068
3070
3077 hash<ColumnOperatorInfo> cop_count(auto column = '');
3078
3079
3081
3088 hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
3089
3090
3092
3102 hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
3103
3104
3106
3116 hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
3117
3118
3120
3130 hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
3131
3132
3134
3144 hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
3145
3146
3148
3157 hash<ColumnOperatorInfo> cop_year(auto column);
3158
3159
3161
3170 hash<ColumnOperatorInfo> cop_year_month(auto column);
3171
3172
3174
3183 hash<ColumnOperatorInfo> cop_year_day(auto column);
3184
3185
3187
3196 hash<ColumnOperatorInfo> cop_year_hour(auto column);
3197
3198
3200
3210 hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
3211
3212
3214
3224 hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
3225
3226
3228
3240 hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
3241
3242
3244
3255 hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
3256
3257
3259
3270 hash<ColumnOperatorInfo> cop_length(auto column);
3271
3272
3274
3288 hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
3289
3290
3291
3293
3321 hash<ColumnOperatorInfo> cop_cume_dist();
3322
3323
3325
3353 hash<ColumnOperatorInfo> cop_dense_rank();
3354
3355
3357
3385 hash<ColumnOperatorInfo> cop_first_value(any column);
3386
3387
3389
3417 hash<ColumnOperatorInfo> cop_last_value(any column);
3418
3419
3421
3451 hash<ColumnOperatorInfo> cop_ntile(int value);
3452
3453
3455
3483 hash<ColumnOperatorInfo> cop_percent_rank();
3484
3485
3487
3515 hash<ColumnOperatorInfo> cop_rank();
3516
3517
3519
3547 hash<ColumnOperatorInfo> cop_row_number();
3548
3549
3551
3603 const DT_YEAR = "Y";
3604
3606 const DT_MONTH = "M";
3607
3609 const DT_DAY = "D";
3610
3612 const DT_HOUR = "H";
3613
3615 const DT_MINUTE = "m";
3616
3618 const DT_SECOND = "S";
3619
3620 // let's simulate and enum here'
3621 const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
3623
3629 const DefaultUopMap = ...;
3630
3632
3655
3663 hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
3664
3665
3667
3677 hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
3678
3679
3681
3691 hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
3692
3693
3695
3704 hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
3705
3706
3708
3717 hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
3718
3719
3721
3732 hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
3733
3734
3736
3746 hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
3747
3748
3750
3760 hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
3761
3762
3764
3774 hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
3775
3776
3778
3788 hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
3789
3790
3792
3801 hash<UpdateOperatorInfo> uop_seq(string seq);
3802
3803
3805
3814 hash<UpdateOperatorInfo> uop_seq_currval(string seq);
3815
3817
3825
3827 const JOP_INNER = "inner";
3828
3830
3832 const JOP_LEFT = "left";
3833
3835
3837 const JOP_RIGHT = "right";
3838
3840 const JopMap = ...;
3841
3843
3854
3857 hash<string, hash<JoinOperatorInfo>> make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3858
3859
3861
3865 hash<string, hash<JoinOperatorInfo>> make_jop(string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3866
3867
3869
3888 hash<string, hash<JoinOperatorInfo>> join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3889
3890
3892
3911 hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3912
3913
3915
3934 hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3935
3936
3938
3960 hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3961
3962
3964
3984 hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3985
3986
3988
4010 hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4011
4012
4014
4033 hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4034
4035
4037
4056 hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4057
4058
4060
4081 hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4082
4083
4085
4105 hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4106
4107
4109
4129 hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4130
4131
4133
4155 hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4156
4157
4159
4178 hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4179
4180
4182
4201 hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4202
4203
4205
4226 hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4227
4228
4230
4250 hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4251
4252
4254
4274 hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4275
4276
4278
4300 hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4301
4303
4309
4311 const OP_LIKE = "like";
4312
4314
4316 const OP_LT = "<";
4317
4319
4321 const OP_LE = "<=";
4322
4324
4326 const OP_GT = ">";
4327
4329
4331 const OP_GE = ">=";
4332
4334
4336 const OP_NE = "!=";
4337
4339
4341 const OP_EQ = "=";
4342
4344
4346 const OP_CLT = "C<";
4347
4349
4351 const OP_CLE = "C<=";
4352
4354
4356 const OP_CGT = "C>";
4357
4359
4361 const OP_CGE = "C>=";
4362
4364
4366 const OP_CNE = "C!=";
4367
4369
4371 const OP_CEQ = "C=";
4372
4374
4376 const OP_BETWEEN = "between";
4377
4379
4381 const OP_IN = "in";
4382
4384
4386 const OP_NOT = "not";
4387
4389
4391 const OP_SUBSTR = "substr";
4392
4394
4396 const OP_OR = "or";
4397
4399
4401 const OP_IN_SELECT = "in_select";
4402
4405
4406
4408 const DefaultOpMap = ...;
4409
4411
4436 hash<OperatorInfo> make_op(string op, auto arg);
4437
4438
4440
4449 hash<OperatorInfo> op_like(string str);
4450
4451
4453
4464 hash<OperatorInfo> op_lt(auto arg);
4465
4466
4468
4479 hash<OperatorInfo> op_le(auto arg);
4480
4481
4483
4494 hash<OperatorInfo> op_gt(auto arg);
4495
4496
4498
4509 hash<OperatorInfo> op_ge(auto arg);
4510
4511
4513
4526 hash<OperatorInfo> op_ne(auto arg);
4527
4528
4530
4543 hash<OperatorInfo> op_eq(auto arg);
4544
4545
4547
4559 hash<OperatorInfo> op_between(auto l, auto r);
4560
4561
4563
4572 hash<OperatorInfo> op_in();
4573
4574
4576
4583 hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
4584
4585
4587
4594 hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
4595
4596
4598
4605 hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
4606
4607
4609
4620 hash<OperatorInfo> op_in(list<auto> args);
4621
4622
4624
4631 hash<OperatorInfo> op_not(hash arg);
4632
4633
4635
4646 hash<OperatorInfo> op_clt(string arg);
4647
4648
4650
4661 hash<OperatorInfo> op_cle(string arg);
4662
4663
4665
4676 hash<OperatorInfo> op_cgt(string arg);
4677
4678
4680
4691 hash<OperatorInfo> op_cge(string arg);
4692
4693
4695
4706 hash<OperatorInfo> op_cne(string arg);
4707
4708
4710
4721 hash<OperatorInfo> op_ceq(string arg);
4722
4723
4725
4736 hash<OperatorInfo> op_substr(int start, *int count, string text);
4737
4738
4740
4750 hash<OperatorInfo> op_substr(int start, string text);
4751
4752
4754
4771 hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
4772
4774
4782
4784 const IOP_SEQ = "seq";
4785
4787
4789 const IOP_SEQ_CURRVAL = "seq_currval";
4790
4792 const DefaultIopMap = {};
4794
4801
4808 hash<InsertOperatorInfo> make_iop(string iop, auto arg);
4809
4810
4812
4821 hash<InsertOperatorInfo> iop_seq(string arg);
4822
4823
4825
4834 hash<InsertOperatorInfo> iop_seq_currval(string arg);
4835
4837
4839 const SqlUtilDrivers = ...;
4840
4841
4842 // private variable to store the closure used to deserialize datasources (if any)
4843 extern code ds_get;
4844
4845 // private variable to store the closure used to serialize datasources (if any)
4846 extern code ds_do;
4847
4850
4851
4854
4855
4856 // private function used to deserialize datasources
4857 AbstractDatasource sqlutil_get_ds(string type, string config);
4858
4859
4860 // private function used to serialize datasources
4861 hash<auto> sqlutil_ds(AbstractDatasource ds);
4862
4863
4866
4867public:
4868
4869
4870protected:
4872 *hash h;
4873
4874public:
4875
4877 constructor(*hash nh);
4878
4879
4882
4883
4886
4887
4889
4904 auto memberGate(string k);
4905
4906
4908
4915
4916
4918 abstract auto take(string k);
4919
4921 renameKey(string old_name, string new_name);
4922
4923
4925 *hash<auto> getHash();
4926
4927
4929
4938 bool matchKeys(hash h1);
4939
4940
4942
4951 bool matchKeys(list<auto> l);
4952
4953
4955
4965
4966
4968
4977 bool partialMatchKeys(hash h1);
4978
4979
4981
4990 bool partialMatchKeys(list<auto> l);
4991
4992
4994
5004
5005
5007
5016 bool val();
5017
5018
5020
5027 list<string> keys();
5028
5029
5031
5038 list<auto> values();
5039
5040
5042
5050
5051
5053
5061
5062
5064
5072
5073
5075 bool empty();
5076
5077
5079
5086 int size();
5087
5088
5090
5099 bool hasKey(string k);
5100
5101
5103
5112 bool hasKeyValue(string k);
5113
5114
5116
5125 *string firstKey();
5126
5127
5129
5138 *string lastKey();
5139
5140
5142 abstract string getElementName();
5143 };
5144
5147
5148public:
5149
5150
5151protected:
5152 softlist l;
5153
5154public:
5155
5157 constructor(softlist nl);
5158
5159
5161
5172 abstract auto get(softint i);
5173
5175 add(auto val);
5176
5177
5179 auto take(int i);
5180
5181
5183 list<auto> getList();
5184
5185
5187
5196 bool val();
5197
5198
5200
5208
5209
5211 bool empty();
5212
5213
5215
5222 int size();
5223
5224
5226 abstract string getElementName();
5227
5228protected:
5229 checkIndex(int i);
5230public:
5231
5232 };
5233
5236
5237public:
5240
5241
5243 constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
5244
5245
5247 constructor(AbstractDatasource ds);
5248
5249
5251 add(string k, Table val);
5252
5253
5256
5257
5260
5261
5264
5265
5268
5269
5271 populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
5272
5273
5275 populate(AbstractDatasource ds);
5276
5277
5279
5295 *list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
5296
5297
5299
5315
5316
5319
5320
5322 *AbstractTable getIfExists(AbstractDatasource ds, string name);
5323
5324
5326 AbstractTable get(AbstractDatasource ds, string name);
5327
5328
5330
5345 *string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
5346
5347
5349
5360 bool tableRenamed(string old_name, string new_name, string old_sql_name);
5361
5362
5363protected:
5364 tableRenamedIntern(string old_name, string new_name, string oldsn);
5365public:
5366
5367
5369
5384 *string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
5385
5386
5387 list<auto> getCreateList();
5388
5389
5390 Qore::AbstractIterator createIterator();
5391
5392
5394
5402 list<auto> getDropList();
5403
5404
5406
5414
5415
5416protected:
5417 getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
5418public:
5419
5420 };
5421
5424
5425public:
5427 constructor(*hash c) ;
5428
5429
5432
5433
5436
5437
5440
5441
5443
5459
5460
5462 Columns subset(softlist l);
5463
5464
5467
5468
5470 bool equal(Columns cols);
5471
5472
5474 AbstractIterator getSqlColumnNameIterator();
5475
5476 };
5477
5480
5481public:
5483 string name;
5484
5486 string ddl_name;
5487
5489protected:
5491public:
5492
5493
5496
5497
5499
5501 abstract string getDdlName(string name);
5502 };
5503
5506
5507public:
5510
5512 *string qore_type;
5513
5515 int size;
5516
5519
5521 *string def_val;
5522
5524 *string comment;
5525
5527 *int scale;
5528
5531
5533protected:
5535public:
5536
5537
5538 constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c, *int scale) ;
5539
5540
5542
5546 hash<GenericColumnInfo> getDescriptionHash();
5547
5548
5550
5553
5554
5557
5558
5560
5569 abstract list<auto> getAddColumnSql(AbstractTable t);
5570
5572 string getDropSql(string table_name);
5573
5574
5576
5589 list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5590
5591
5593
5603 abstract string getRenameSql(AbstractTable t, string new_name);
5604
5607
5608
5610protected:
5611 abstract bool equalImpl(AbstractColumn c);
5612public:
5613
5615
5631protected:
5632 abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5633public:
5634 };
5635
5638
5639public:
5640 constructor(*hash c) ;
5641
5642
5645
5646
5649
5650
5653
5654
5657
5658
5660
5676
5677
5678 string getElementName();
5679
5680 };
5681
5684
5685public:
5687 string name;
5688
5691
5694
5695protected:
5698
5701
5702public:
5703
5705 constructor(string n, bool u, hash c);
5706
5707
5709 string getName();
5710
5711
5713 bool hasColumn(string cname);
5714
5715
5717 abstract string getCreateSql(string table_name, *hash<auto> opt);
5718
5720 string getDropSql(string table_name);
5721
5722
5725
5726
5729
5730
5732 abstract bool equalImpl(AbstractIndex ix);
5733
5735 abstract string getRenameSql(string table_name, string new_name);
5736
5739
5740
5743
5744
5747
5748
5751
5752
5755
5756
5759
5760
5762 *list<AbstractColumnConstraint> getAllSupportingConstraints();
5763
5764
5766 list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
5767
5768 };
5769
5772
5773public:
5774 constructor(*hash c) ;
5775
5776
5779
5780
5783
5784
5787
5788
5790
5806
5807
5808 string getElementName();
5809
5810 };
5811
5814
5815public:
5816
5817
5818protected:
5820 string name;
5821
5822public:
5823
5825 constructor(string n);
5826
5827
5829 string getName();
5830
5831
5833 rename(string n);
5834
5835
5837 abstract string getCreateSql(string table_name, *hash<auto> opt);
5838
5840 string getDropSql(string table_name);
5841
5842
5844 abstract list<auto> getRenameSql(string table_name, string new_name);
5845
5847 string getDisableSql(string table_name);
5848
5849
5851 string getEnableSql(string table_name, *hash<auto> opt);
5852
5853
5856
5857
5859protected:
5861public:
5862
5864 abstract bool setIndexBase(string ix);
5865
5867 abstract clearIndex();
5868
5870 bool hasColumn(string cname);
5871
5872 };
5873
5876
5877public:
5879 string src;
5880
5882 constructor(string n, string n_src) ;
5883
5884
5886protected:
5888public:
5889
5890
5892 bool setIndexBase(string ix);
5893
5894
5897
5898 };
5899
5902
5903public:
5904protected:
5906 *string index;
5907
5908public:
5909
5911 constructor(string name, *hash<auto> cols, *string index) ;
5912
5913
5915 constructor(string name, Columns cols, *string index) ;
5916
5917
5919 bool setIndexBase(string ix);
5920
5921
5923 bool hasColumn(string cname);
5924
5925
5928
5929 };
5930
5933
5934public:
5935protected:
5937 *hash<string, hash<string, AbstractForeignConstraint>> sourceConstraints;
5938
5939public:
5940
5942 constructor(string name, *hash<auto> cols, *string index) ;
5943
5944
5946 constructor(string name, Columns cols, *string index) ;
5947
5948
5950
5955
5956
5958 hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
5959
5960
5963
5964
5966
5977
5978
5980 removeSourceConstraint(string tname, list<auto> cols);
5981
5982
5984 renameSourceConstraintTable(string old_name, string new_name);
5985
5986
5988 bool hasColumn(string cname);
5989
5990
5992 *string getIndex();
5993
5994
5996protected:
5998public:
5999
6000
6002 abstract string getCreateSql(string table_name, *hash<auto> opts);
6003 };
6004
6007
6008public:
6010 constructor(string n, *hash<auto> c, *string n_index) ;
6011
6012 };
6013
6016
6017public:
6018 constructor() ;
6019
6020
6021 constructor(string n, *hash<auto> c) ;
6022
6023 };
6024
6027
6028public:
6029 constructor(*hash<auto> c) ;
6030
6031
6034
6035
6038
6039
6042
6043
6045
6061
6062
6064 *hash<auto> findConstraintOn(string table, softlist<auto> cols);
6065
6066
6069
6070 };
6071
6074
6075public:
6077 string table;
6078
6081
6083 constructor(string t, Columns c);
6084
6085
6087 bool hasColumn(string cname);
6088
6089
6092
6093 };
6094
6097
6098public:
6101
6103
6104
6106 bool hasTargetColumn(string col);
6107
6108
6110protected:
6112public:
6113
6114 };
6115
6118
6119public:
6121 string name;
6122
6124 number start;
6125
6128
6130 *number max;
6131
6133 constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
6134
6135
6137 abstract string getCreateSql(*hash<auto> opt);
6138
6140
6142 string getDropSql(*hash<auto> opt);
6143
6144
6146
6149 abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6150 };
6151
6154
6155public:
6156 // ! potential object schema
6157 *string schema;
6158
6160 string name;
6161
6163 string src;
6164
6167
6169 constructor(string n_name, string n_src);
6170
6171
6173 abstract string getCreateSql(*hash<auto> opt);
6174
6176
6178 string getDropSql(*hash<auto> opt);
6179
6180
6182
6185 abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6186 };
6187
6190
6191public:
6193 string name;
6194
6196 string type;
6197
6199 string src;
6200
6202
6206 constructor(string n, string n_type, string n_src);
6207
6208
6210 string getType();
6211
6212
6214
6216 string getDropSql(*hash<auto> opt);
6217
6218
6221
6222
6224 string getNormalizedSource(string src);
6225
6226
6228protected:
6230public:
6231 };
6232
6235
6236public:
6238
6242 constructor(string n, string n_type, string n_src) ;
6243
6244
6246 abstract list<auto> getCreateSql(*hash<auto> opt);
6247
6249
6252 abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6253
6255 setName(string new_name);
6256
6257 };
6258
6261
6262public:
6263 constructor(*hash c) ;
6264
6265
6268
6269
6272
6273
6275
6291
6292
6293 string getElementName();
6294
6295 };
6296
6299
6300public:
6302 constructor(string n, string n_src) ;
6303
6304
6306 abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
6307
6309 abstract softlist<auto> getRenameSql(string table_name, string new_name);
6310
6312 abstract list<auto> getDropSql(string table_name);
6313 };
6314
6317
6318public:
6319 constructor(*hash c) ;
6320
6321
6324
6325
6328
6329
6331
6347
6348
6349 string getElementName();
6350
6351 };
6352};
abstract class for check constraints
Definition SqlUtil.qm.dox.h:5875
string src
the source of the check clause
Definition SqlUtil.qm.dox.h:5879
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_src)
creates the object and sets its name and the check clause source
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
clearIndex()
clears any index base for the constraint
the API for a constraint with columns
Definition SqlUtil.qm.dox.h:5901
*string index
the index supporting the constraint
Definition SqlUtil.qm.dox.h:5906
constructor(string name, Columns cols, *string index)
creates the object from the name and a Columns object
clearIndex()
clears any index base for the constraint
constructor(string name, *hash< auto > cols, *string index)
creates the object from the name and a hash of column information
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
bool hasColumn(string cname)
returns True if the constraint references the named column
the base class for column information
Definition SqlUtil.qm.dox.h:5505
abstract bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
abstract string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
hash< GenericColumnInfo > getDescriptionHash()
Returns a description hash of the column.
string native_type
the native type name of the column
Definition SqlUtil.qm.dox.h:5509
abstract list< auto > getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash< auto > opt)
returns a list of sql strings that can be used to modify the column to the new definition
*string comment
comment on the column
Definition SqlUtil.qm.dox.h:5524
*string def_val
default value for column
Definition SqlUtil.qm.dox.h:5521
list< auto > getModifySql(AbstractTable t, AbstractColumn c, *hash< auto > opt)
returns a list of sql strings that can be used to modify the column to the new definition; if the col...
constructor()
empty constructor for subclasses
*string qore_type
the equivalent qore type name of the column if known
Definition SqlUtil.qm.dox.h:5512
string getCreateSql(AbstractTable t)
returns an sql string that can be used to add the column to a table
bool nullable
True if the column can hold a NULL value, False if not
Definition SqlUtil.qm.dox.h:5518
bool equal(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
const DefaultVarcharSize
Default VARCHAR column size.
Definition SqlUtil.qm.dox.h:5530
string getNativeTypeString()
returns the string describing the native type that can be used in SQL
int size
the size of the column
Definition SqlUtil.qm.dox.h:5515
*int scale
the scale for numeric columns
Definition SqlUtil.qm.dox.h:5527
abstract list< auto > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
string getDropSql(string table_name)
returns a string that can be used to drop the column from the table
the API for a constraint with columns
Definition SqlUtil.qm.dox.h:5932
Qore::AbstractIterator getSourceConstraintIterator()
returns an iterator through all known source foreign constraints on the current table
addSourceConstraint(string tname, AbstractForeignConstraint fk)
adds a foreign constraint source to the unique constraint
*hash< string, hash< string, AbstractForeignConstraint > > sourceConstraints
a hash of ForeignConstraintSources, keyed by table name, the value is a hash of foreign constraints k...
Definition SqlUtil.qm.dox.h:5937
constructor(string name, Columns cols, *string index)
creates the object from the name and a Columns object
renameSourceConstraintTable(string old_name, string new_name)
renames a table in a source constraint
abstract string getCreateSql(string table_name, *hash< auto > opts)
returns a string that can be used to create the constraint in the database
findMatchingIndex(*Indexes indexes)
find an index that matches the constraint and marks both objects as related
*string getIndex()
returns the name of the associated index, if any
hash< auto > getDisableReenableSql(AbstractDatasource ds, string table_name, *hash< auto > opts)
returns lists of SQL strings to disable this constraint plus any dependent constraints and another li...
removeSourceConstraint(string tname, list< auto > cols)
removes a source constraint
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
constructor(string name, *hash< auto > cols, *string index)
creates the object from the name and a hash of column information
bool hasColumn(string cname)
returns True if the constraint references the named column
abstract base class for constraints
Definition SqlUtil.qm.dox.h:5813
abstract bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database; if disabli...
string getName()
returns the constraint name
constructor(string n)
creates the object and sets its name
bool hasColumn(string cname)
returns True if the constraint references the named column
rename(string n)
renames the constraint
abstract list< auto > getRenameSql(string table_name, string new_name)
returns a list of SQL strings that can be used to rename the constraint in the database
abstract clearIndex()
clears any index base for the constraint
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
string name
the name of the constraint
Definition SqlUtil.qm.dox.h:5820
abstract bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
bool equal(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
string getEnableSql(string table_name, *hash< auto > opt)
returns a string that can be used to enable the constraint in the database; if disabling constraints ...
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the constraint in the database
the base class for named objects
Definition SqlUtil.qm.dox.h:5479
constructor()
empty constructor for subclasses
abstract string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
string ddl_name
the name of the object for DDL (in case it's a reserved word)
Definition SqlUtil.qm.dox.h:5486
string name
the name of the object
Definition SqlUtil.qm.dox.h:5483
constructor(string name)
creates the object from the name
the base class for foreign key constraint information
Definition SqlUtil.qm.dox.h:6096
bool equalImpl(AbstractConstraint con)
returns True if the argument is equal to the current object, False if not
ForeignConstraintTarget target
a ForeignConstraintTarget object to describe the target table and columns
Definition SqlUtil.qm.dox.h:6100
bool hasTargetColumn(string col)
Returns True if the constraint refers to the given target column.
base class for function or objects with code
Definition SqlUtil.qm.dox.h:6189
string getNormalizedSource(string src)
returns normalized source for comparisons
string name
the name of the object
Definition SqlUtil.qm.dox.h:6193
abstract bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the function from the database
bool equal(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
string src
the source of the object
Definition SqlUtil.qm.dox.h:6199
string type
the type of object
Definition SqlUtil.qm.dox.h:6196
string getType()
returns the type of object
base class for functions
Definition SqlUtil.qm.dox.h:6234
abstract softlist< auto > getRenameSql(string new_name, *hash< auto > opt)
returns a list of strings that can be used to rename the function in the database
setName(string new_name)
sets the new name of the object
abstract list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that can be used to create the function in the database
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
abstract container class that throws an exception if an unknown key is accessed
Definition SqlUtil.qm.dox.h:4865
bool partialMatchKeys(hash h1)
returns True if the hash argument has at least the same keys (in any order, can have more keys),...
Qore::AbstractIterator pairIterator()
Returns a HashPairIterator object for the contained hash.
bool hasKeyValue(string k)
Returns True if the key exists in the contained hash and is assigned a value, False if not.
abstract auto take(string k)
removes the given key from the contained hash and returns the value
bool partialMatchKeys(list< auto > l)
returns True if the list<auto> argument has at least the same keys (in any order, can have more keys)...
*string firstKey()
Returns the first key name in the contained hash or NOTHING if the contained hash has no keys.
bool partialMatchKeys(AbstractHashContainer c)
returns True if the container argument has at least the same keys (in any order, can have more keys),...
Qore::AbstractIterator iterator()
Returns a HashIterator object for the contained hash.
auto memberGate(string k)
returns the value of the given key in the contained hash if it exists, otherwise throws a KEY-ERROR e...
bool hasKey(string k)
Returns True if the key exists in the contained hash (may or may not be assigned a value),...
renameKey(string old_name, string new_name)
renames the given key; maintains the key order
list< auto > values()
Returns a list of values of the contained hash.
*string lastKey()
Returns the last key name in the contained hash or NOTHING if the contained hash has no keys.
*hash< auto > getHash()
returns the hash contained by this object
clear()
purges the contained data
bool matchKeys(hash h1)
returns True if the hash argument has the same keys (in any order), False if not
*hash h
the data to be contained
Definition SqlUtil.qm.dox.h:4872
abstract string getElementName()
must return the name of the contained element
list< string > keys()
Returns a list of key names of the contained hash.
Qore::AbstractIterator keyIterator()
Returns a HashKeyIterator object for the contained hash.
int size()
Returns the number of keys in the contained hash.
constructor(*hash nh)
creates the object with the hash argument passed
bool matchKeys(list< auto > l)
returns True if the list<auto> argument has the same list of key strings as the keys in the object (i...
constructor(AbstractHashContainer old)
creates a copy of the object
bool empty()
returns True if the container is empty, False if not
bool matchKeys(AbstractHashContainer c)
returns True if the container argument has the same keys (in any order), False if not
bool val()
Returns False if the contained hash has no keys, True if it does.
copy(AbstractHashContainer old)
creates a "deep copy" of the object
the abstract base class for index information
Definition SqlUtil.qm.dox.h:5683
bool equalExceptName(AbstractIndex ix)
returns True if the argument is equal to the current index with the exception of the name,...
bool hasColumn(string cname)
returns True if the constraint references the named column
*AbstractForeignConstraint foreign_constraint
Any foreign constraint that this index supports.
Definition SqlUtil.qm.dox.h:5700
abstract bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
setForeignConstraint()
clears the supporting constraint
*AbstractColumnSupportingConstraint getSupportingConstraint()
returns the supporting constraint, if any
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the index in the database
string name
the name of the index
Definition SqlUtil.qm.dox.h:5687
*AbstractForeignConstraint getForeignConstraint()
returns the supporting constraint, if any
constructor(string n, bool u, hash c)
creates the object from the name, a unique flag, and a hash of column information
setSupportingConstraint(AbstractForeignConstraint c)
tags the index with a column supporting constraint (unique or fk constraint, etc) that the index supp...
setSupportingConstraint(AbstractColumnSupportingConstraint c)
tags the index with a column supporting constraint (unique or fk constraint, etc) that the index supp...
bool unique
True if the index is a unique index, False if not
Definition SqlUtil.qm.dox.h:5690
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition SqlUtil.qm.dox.h:5697
string getName()
returns the index name
setSupportingConstraint()
clears the supporting constraint
bool equal(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
*list< AbstractColumnConstraint > getAllSupportingConstraints()
returns all supporting constraints, if any
string getDropSql(string table_name)
returns a string that can be used to drop the index from the database
abstract string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
Columns columns
an object of class Columns representing the columns in the index
Definition SqlUtil.qm.dox.h:5693
list< auto > getRecreateSql(AbstractDatasource ds, string table_name, *hash< auto > opt)
returns a list of strings to drop and recreate the current index; if there are dependent constraints,...
abstract container class that throws an exception if an unknown key is accessed
Definition SqlUtil.qm.dox.h:5146
list< auto > getList()
returns the list contained by this object
bool empty()
returns True if the container is empty, False if not
abstract auto get(softint i)
returns the value of the given element in the contained list if it exists, otherwise throws an ELEMEN...
auto take(int i)
removes the given element from the contained list and returns the value
add(auto val)
adds the given value to the list
bool val()
Returns False if the contained list is empty, True if not.
abstract string getElementName()
must return the name of the contained element
constructor(softlist nl)
creates the object with the list<auto> argument passed
Qore::ListIterator iterator()
Returns a ListIterator object for the contained list.
int size()
Returns the number of elements in the contained list.
represents a primary key
Definition SqlUtil.qm.dox.h:6015
base class for sequences
Definition SqlUtil.qm.dox.h:6117
*number max
the ending number
Definition SqlUtil.qm.dox.h:6130
string name
the name of the sequence
Definition SqlUtil.qm.dox.h:6121
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the sequence from the database
abstract softlist< auto > getRenameSql(string new_name, *hash< auto > opt)
returns a list of strings that can be used to rename the sequence in the database
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the sequence in the database
number start
the starting number
Definition SqlUtil.qm.dox.h:6124
number increment
the increment
Definition SqlUtil.qm.dox.h:6127
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_max)
creates the object from the arguments
the base abstract class for the table implementation
Definition AbstractTable.qc.dox.h:30
the base class for triggers
Definition SqlUtil.qm.dox.h:6298
abstract softlist< auto > getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
abstract list< auto > getDropSql(string table_name)
returns a string that can be used to drop the trigger in the database
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
abstract list< auto > getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the trigger in the database
represents a unique column constraint
Definition SqlUtil.qm.dox.h:6006
constructor(string n, *hash< auto > c, *string n_index)
creates the object from the name an a hash of column information
base class for views
Definition SqlUtil.qm.dox.h:6153
bool updatable
Flag showing if is the view updatable with DML commands.
Definition SqlUtil.qm.dox.h:6166
string name
the name of the sequence
Definition SqlUtil.qm.dox.h:6160
abstract softlist< auto > getRenameSql(string new_name, *hash< auto > opt)
returns a list with command(s) that can be used to rename the view in the database
constructor(string n_name, string n_src)
creates the object from the arguments
string src
the source code
Definition SqlUtil.qm.dox.h:6163
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the view from the database
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the view in the database
column container class that throws an exception if an unknown column is accessed
Definition SqlUtil.qm.dox.h:5423
bool equal(Columns cols)
returns True if the argument has the same columns in the same order as the current object,...
add(string k, AbstractColumn val)
adds the given value to the hash with the given key name
Columns subset(softlist l)
returns a subset of the current columns according to the list<auto> argument
string getElementName()
returns "column" since this object stores column objects
AbstractIterator getSqlColumnNameIterator()
returns an iterator for column SQL names
AbstractColumn memberGate(string k)
returns the AbstractColumn object corresponding to the key given or throws a KEY-ERROR exception
AbstractColumn take(string k)
removes the given key from the contained hash and returns the value
constructor(Columns old)
creates a copy of the object
constructor(*hash c)
creates the object from the argument
constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:5771
AbstractConstraint memberGate(string k)
returns the AbstractConstraint object corresponding to the key given or throws a KEY-ERROR exception
AbstractConstraint take(string k)
removes the given key from the contained hash and returns the value
*AbstractUniqueConstraint findEqualUniqueConstraint(AbstractUniqueConstraint uk)
finds a unique constraint with the same columns as the unique constraint passed
add(string k, AbstractConstraint val)
adds the given value to the hash with the given key name
a class describing a foreign constraint target
Definition SqlUtil.qm.dox.h:6073
constructor(string t, Columns c)
creates the object and sets the target table name and the target columns
bool equal(ForeignConstraintTarget targ)
returns True if the argument is equal to the current object, False if not
Columns columns
columns in the target table
Definition SqlUtil.qm.dox.h:6080
bool hasColumn(string cname)
returns True if the constraint references the named column
string table
the name of the target table
Definition SqlUtil.qm.dox.h:6077
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:6026
AbstractForeignConstraint take(string k)
removes the given key from the contained hash and returns the value
*AbstractForeignConstraint findEqual(AbstractForeignConstraint fk)
find an index with columns equal to the index passed
add(string k, AbstractForeignConstraint val)
adds the given value to the hash with the given key name
string getElementName()
returns "foreign constraint" for the type of object encapsulated
*hash< auto > findConstraintOn(string table, softlist< auto > cols)
returns either a hash of AbstractColumn information or NOTHING if no foreign constraint can be found ...
AbstractForeignConstraint memberGate(string k)
returns the AbstractForeignConstraint object corresponding to the key given or throws a KEY-ERROR exc...
function container class that throws an exception if an unknown function is accessed
Definition SqlUtil.qm.dox.h:6260
add(string k, AbstractFunction val)
adds the given value to the hash with the given key name
AbstractFunction take(string k)
removes the given key from the contained hash and returns the value
AbstractFunction memberGate(string k)
returns the AbstractFunction object corresponding to the key given or throws a KEY-ERROR exception
index container class that throws an exception if an unknown index is accessed
Definition SqlUtil.qm.dox.h:5637
AbstractIndex take(string k)
removes the given key from the contained hash and returns the value
*AbstractIndex tryTake(string k)
tries to remove the given key from the contained hash and returns the value if it exists
*AbstractIndex findEqual(AbstractIndex ix)
find an index with columns equal to the index passed
add(string k, AbstractIndex val)
adds the given value to the hash with the given key name
AbstractIndex memberGate(string k)
returns the AbstractIndex object corresponding to the key given or throws a KEY-ERROR exception
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
AbstractTable memberGate(string k)
returns the AbstractTable object corresponding to the key given or throws a KEY-ERROR exception
Qore::AbstractIterator dropIterator()
returns an iterator for a list of cached table names in the order that can be used to drop the tables...
constructor(AbstractDatasource ds, hash tables, *hash< auto > opt)
creates and populates the object from a hash<auto> description
populate(AbstractDatasource ds, hash< auto > tables, *hash< auto > opt)
populates the object from a hash<auto> description
*list< auto > getDropAllForeignConstraintsOnTableSql(string name, *hash< auto > opt)
returns a list of SQL strings that can be used to drop all the foreign constraints on a particular ta...
list< auto > getDropList()
returns a list of cached table names in the order that can be used to drop the tables,...
bool tableRenamed(string old_name, string new_name, string old_sql_name)
updates table names and internal references for renamed tables
add(AbstractTable val)
adds the given value to the hash with the given key name
add(string k, Table val)
adds the given value to the hash with the given key name
AbstractTable take(string k)
removes the given key from the contained hash and returns the value
*AbstractTable getIfExists(AbstractDatasource ds, string name)
gets a table from the database or from the cache if already cached; if the table does not exist,...
populate(AbstractDatasource ds)
populates the object from tables in the database
constructor(AbstractDatasource ds)
creates and populates the object from tables in the database
add(string k, AbstractTable val)
adds the given value to the hash with the given key name
*string getDropConstraintIfExistsSql(string tname, string cname, *hash< auto > opts)
returns an SQL string that can be used to drop an existing constraint on a table, if the table is not...
add(Table val)
adds the given value to the hash with the given key name
*string getRenameTableIfExistsSql(string old_name, string new_name, *hash< auto > opts)
returns an SQL string that can be used to rename the given table if it exists and the target does not...
string getElementName()
returns "table" since this object stores AbstractTable objects
constructor()
creates an empty object
AbstractTable get(AbstractDatasource ds, string name)
gets a table from the database or from the cache if already cached
trigger container class that throws an exception if an unknown trigger is accessed
Definition SqlUtil.qm.dox.h:6316
AbstractTrigger memberGate(string k)
returns the AbstractTrigger object corresponding to the key given or throws a KEY-ERROR exception
AbstractTrigger take(string k)
removes the given key from the contained hash and returns the value
add(string k, AbstractTrigger val)
adds the given value to the hash with the given key name
const SZ_NONE
Definition SqlUtil.qm.dox.h:2475
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition SqlUtil.qm.dox.h:2484
const SZ_MAND
the data type takes a mandatory size parameter
Definition SqlUtil.qm.dox.h:2478
const SZ_OPT
the data type takes an optional size parameter
Definition SqlUtil.qm.dox.h:2481
const CLOB
specifies a large variable-length character column (ie CLOB or TEXT, etc)
Definition SqlUtil.qm.dox.h:2467
const DB_SYNONYMS
Feature: synonyms.
Definition SqlUtil.qm.dox.h:2447
const DB_PACKAGES
Feature: packages.
Definition SqlUtil.qm.dox.h:2435
const VARCHAR
Definition SqlUtil.qm.dox.h:2455
const DB_MVIEWS
Feature: materialized views / snapshots.
Definition SqlUtil.qm.dox.h:2433
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition SqlUtil.qm.dox.h:2464
const DB_PROCEDURES
Feature: procedures.
Definition SqlUtil.qm.dox.h:2437
const DB_TABLES
Feature: tables.
Definition SqlUtil.qm.dox.h:2441
const DB_VIEWS
Feature: views.
Definition SqlUtil.qm.dox.h:2445
const CHAR
specifies a CHAR column
Definition SqlUtil.qm.dox.h:2461
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition SqlUtil.qm.dox.h:2458
const DB_FUNCTIONS
Feature: functions.
Definition SqlUtil.qm.dox.h:2431
const DB_SEQUENCES
Feature: sequences.
Definition SqlUtil.qm.dox.h:2439
const DB_TYPES
Feature: named types.
Definition SqlUtil.qm.dox.h:2443
hash< ColumnOperatorInfo > cop_plus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "+" operator with the given arguments
hash< ColumnOperatorInfo > cop_year(auto column)
returns a ColumnOperatorInfo hash for the "year" operator with the given argument
hash< ColumnOperatorInfo > cop_as(auto column, string arg)
returns a ColumnOperatorInfo hash for the "as" operator with the given argument
hash< ColumnOperatorInfo > cop_seq_currval(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq_currval" operator with the given argument giving the s...
hash< ColumnOperatorInfo > cop_year_day(auto column)
returns a ColumnOperatorInfo hash for the "year_day" operator with the given argument
hash< ColumnOperatorInfo > cop_year_month(auto column)
returns a ColumnOperatorInfo hash for the "year_month" operator with the given argument
hash< ColumnOperatorInfo > cop_count(auto column='')
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts
hash< ColumnOperatorInfo > cop_append(auto column, string arg)
returns a ColumnOperatorInfo hash for the "append" operator with the given argument
hash< ColumnOperatorInfo > cop_coalesce(auto col1, auto col2)
returns a ColumnOperatorInfo hash for the "coalesce" operator with the given column arguments; the fi...
hash< ColumnOperatorInfo > cop_dense_rank()
Analytic/window function: rank of the current row without gaps.
hash< ColumnOperatorInfo > cop_length(auto column)
returns a ColumnOperatorInfo hash for the "len" operator with the given argument; returns the length ...
hash< ColumnOperatorInfo > cop_lower(auto column)
returns a ColumnOperatorInfo hash for the "lower" operator with the given argument; returns a column ...
hash< ColumnOperatorInfo > cop_multiply(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "*" operator with the given arguments
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence ...
hash< ColumnOperatorInfo > cop_value(auto arg)
returns a ColumnOperatorInfo hash for the "value" (literal) operator with the given argument
hash< ColumnOperatorInfo > cop_last_value(any column)
Analytic/window function: value evaluated at the row that is the last row of the window frame.
hash< ColumnOperatorInfo > cop_prepend(auto column, string arg)
returns a ColumnOperatorInfo hash for the "prepend" operator with the given argument
hash< ColumnOperatorInfo > cop_rank()
Analytic/window function: rank of the current row with gaps.
hash< ColumnOperatorInfo > cop_min(auto column)
returns a ColumnOperatorInfo hash for the "min" operator; returns minimum column values
hash< ColumnOperatorInfo > cop_row_number()
Analytic/window function: number of the current row within its partition, counting from 1.
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
hash< ColumnOperatorInfo > cop_cast(auto column, string arg, auto arg1, auto arg2)
returns a ColumnOperatorInfo hash for the "cast" operator with the given argument(s)
hash< ColumnOperatorInfo > cop_upper(auto column)
returns a ColumnOperatorInfo hash for the "upper" operator with the given argument; returns a column ...
hash< ColumnOperatorInfo > cop_avg(auto column)
returns a ColumnOperatorInfo hash for the "avg" operator; returns average column values
hash< ColumnOperatorInfo > cop_percent_rank()
Analytic/window function: relative rank of the current row.
hash< ColumnOperatorInfo > cop_substr(auto column, int start, *int count)
returns a ColumnOperatorInfo hash for the "substr" operator with the given arguments; returns a subst...
hash< ColumnOperatorInfo > cop_sum(auto column)
returns a ColumnOperatorInfo hash for the "sum" operator; returns the total sum of a numeric column.
hash< ColumnOperatorInfo > cop_distinct(auto column)
returns a ColumnOperatorInfo hash for the "distinct" operator with the given argument; returns distin...
hash< ColumnOperatorInfo > cop_minus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "-" operator with the given arguments
hash< ColumnOperatorInfo > cop_over(auto column, *string partitionby, *string orderby)
returns a ColumnOperatorInfo hash for the "over" clause
hash< ColumnOperatorInfo > make_cop(string cop, auto column, auto arg)
hash< ColumnOperatorInfo > cop_divide(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "/" operator with the given arguments
hash< ColumnOperatorInfo > cop_ntile(int value)
Analytic/window function: integer ranging from 1 to the argument value, dividing the partition as equ...
hash< ColumnOperatorInfo > cop_first_value(any column)
Analytic/window function: value evaluated at the row that is the first row of the window frame.
hash< ColumnOperatorInfo > cop_max(auto column)
returns a ColumnOperatorInfo hash for the "max" operator; returns maximum column values
hash< ColumnOperatorInfo > cop_year_hour(auto column)
returns a ColumnOperatorInfo hash for the "year_hour" operator with the given argument
hash< ColumnOperatorInfo > cop_trunc_date(auto column, string mask)
Truncates a date column or value regarding the given mask. The resulting value remains Qore::date (no...
const DT_YEAR
Definition SqlUtil.qm.dox.h:3603
const DT_MINUTE
Format unit: minute.
Definition SqlUtil.qm.dox.h:3615
const DT_SECOND
Format unit: hour.
Definition SqlUtil.qm.dox.h:3618
const DT_MONTH
Format unit: month.
Definition SqlUtil.qm.dox.h:3606
const DT_HOUR
Format unit: hour.
Definition SqlUtil.qm.dox.h:3612
const DT_DAY
Format unit: day.
Definition SqlUtil.qm.dox.h:3609
const COP_MAX
to return the maximum value
Definition SqlUtil.qm.dox.h:2539
const COP_OVER
the SQL "over" clause
Definition SqlUtil.qm.dox.h:2559
const COP_SEQ_CURRVAL
to return the last value of a sequence issued in the same session
Definition SqlUtil.qm.dox.h:2609
const COP_LENGTH
to get the length of a text field
Definition SqlUtil.qm.dox.h:2626
const COP_RANK
Analytic (window) function: RANK.
Definition SqlUtil.qm.dox.h:2684
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition SqlUtil.qm.dox.h:2514
const COP_COALESCE
to return the first non-null argument in the list
Definition SqlUtil.qm.dox.h:2614
const COP_MIN
to return the minimum value
Definition SqlUtil.qm.dox.h:2534
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition SqlUtil.qm.dox.h:2599
const COP_DIVIDE
the SQL "divide" operator
Definition SqlUtil.qm.dox.h:2574
const COP_YEAR
to return a date value with year information only
Definition SqlUtil.qm.dox.h:2584
const COP_COUNT
to return the row count
Definition SqlUtil.qm.dox.h:2554
const COP_MULTIPLY
the SQL "multiply" operator
Definition SqlUtil.qm.dox.h:2579
const COP_AVG
to return the average value
Definition SqlUtil.qm.dox.h:2544
const COP_PLUS
the SQL "plus" operator
Definition SqlUtil.qm.dox.h:2569
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition SqlUtil.qm.dox.h:2642
const COP_SUBSTR
to extract a substring from a column
Definition SqlUtil.qm.dox.h:2619
const COP_SEQ
to return the next value of a sequence
Definition SqlUtil.qm.dox.h:2604
const COP_APPEND
to append a string to a column on output
Definition SqlUtil.qm.dox.h:2509
const COP_PERCENT_RANK
Analytic (window) function: PERCENT_RANK.
Definition SqlUtil.qm.dox.h:2677
const COP_NTILE
Analytic (window) function: NTILE.
Definition SqlUtil.qm.dox.h:2670
const COP_YEAR_MONTH
to return a date value with year to month information
Definition SqlUtil.qm.dox.h:2589
const COP_PREPEND
to prepend a string to a column on output
Definition SqlUtil.qm.dox.h:2504
const COP_LOWER
to return column value in lower case
Definition SqlUtil.qm.dox.h:2524
const COP_AS
Definition SqlUtil.qm.dox.h:2494
const COP_CAST
to convert column value into another datatype
Definition SqlUtil.qm.dox.h:2499
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition SqlUtil.qm.dox.h:2691
const COP_YEAR_DAY
to return a date value with year to day information
Definition SqlUtil.qm.dox.h:2594
const COP_UPPER
to return column value in upper case
Definition SqlUtil.qm.dox.h:2519
const COP_DENSE_RANK
Analytic (window) function: DENSE_RANK.
Definition SqlUtil.qm.dox.h:2649
const COP_TRUNC_DATE
to return the date with truncated value
Definition SqlUtil.qm.dox.h:2635
const COP_MINUS
the SQL "minus" operator
Definition SqlUtil.qm.dox.h:2564
const COP_LAST_VALUE
Analytic (window) function: LAST_VALUE.
Definition SqlUtil.qm.dox.h:2663
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition SqlUtil.qm.dox.h:2656
const DefaultCopMap
a hash of default column operator descriptions
Definition SqlUtil.qm.dox.h:2727
const COP_DISTINCT
to return distinct values
Definition SqlUtil.qm.dox.h:2529
const COP_SUM
to return the sum value
Definition SqlUtil.qm.dox.h:2549
hash< InsertOperatorInfo > make_iop(string iop, auto arg)
hash< InsertOperatorInfo > iop_seq_currval(string arg)
returns an InsertOperatorInfo hash for retrieving the current value of the given sequence in insert q...
hash< InsertOperatorInfo > iop_seq(string arg)
returns an InsertOperatorInfo hash for retrieving the value of the given sequence in insert queries
const IOP_SEQ
Definition SqlUtil.qm.dox.h:4784
const DefaultIopMap
a hash of default insert operator descriptions (currently empty, all operators are driver-dependent)
Definition SqlUtil.qm.dox.h:4792
const IOP_SEQ_CURRVAL
for using the last value of a sequence issued in the current session
Definition SqlUtil.qm.dox.h:4789
hash< string, hash< JoinOperatorInfo > > join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for standard inner joins with the given arguments for use when joining with a table ot...
hash< string, hash< JoinOperatorInfo > > join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for right outer joins with the given arguments
hash< string, hash< JoinOperatorInfo > > join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for right outer joins with the given arguments for use when joining with a table other...
hash< string, hash< JoinOperatorInfo > > join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for left outer joins with the given arguments
hash< string, hash< JoinOperatorInfo > > join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for left outer joins with the given arguments for use when joining with a table other ...
hash< string, hash< JoinOperatorInfo > > make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash< auto > opt)
hash< string, hash< JoinOperatorInfo > > join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for standard inner joins with the given arguments
const JopMap
a hash of valid join operators
Definition SqlUtil.qm.dox.h:3840
const JOP_INNER
Definition SqlUtil.qm.dox.h:3827
const JOP_RIGHT
for right outer joins
Definition SqlUtil.qm.dox.h:3837
const JOP_LEFT
for left outer joins
Definition SqlUtil.qm.dox.h:3832
hash< OperatorInfo > op_ceq(string arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_clt(string arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_between(auto l, auto r)
returns an OperatorInfo hash for the "between" operator with the given arguments, neither of which ca...
hash< OperatorInfo > op_cle(string arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
hash< OperatorInfo > op_cne(string arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
hash< OperatorInfo > op_cgt(string arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_ne(auto arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
hash< string, hash< OperatorInfo > > wop_or(hash h1, hash h2)
returns an OperatorInfo hash with a fake "_OR_" column name; the list of arguments to the function is...
hash< OperatorInfo > make_op(string op, auto arg)
hash< OperatorInfo > op_lt(auto arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_substr(int start, *int count, string text)
returns an OperatorInfo hash for the "substr" operator with the given arguments; for use in where cla...
hash< OperatorInfo > op_like(string str)
returns an OperatorInfo hash for the "like" operator with the given argument for use in where clauses
hash< OperatorInfo > op_gt(auto arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_in_select(string table, hash< auto > select_hash)
returns an OperatorInfo hash for the "in" operator with a subquery as the argument; for use in where ...
hash< OperatorInfo > op_ge(auto arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
hash< OperatorInfo > op_not(hash arg)
returns an OperatorInfo hash for the "not" operator; for use in where clauses
hash< OperatorInfo > op_eq(auto arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_cge(string arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
hash< OperatorInfo > op_in()
returns an OperatorInfo hash for the "in" operator with all arguments passed to the function; for use...
hash< OperatorInfo > op_le(auto arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4331
const OP_NE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4336
const OP_LE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4321
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4341
const OP_IN
the SQL "in" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4381
const OP_NOT
the SQL "not" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4386
const DefaultExpressionMap
Default expressions to be supported by all SqlUtil modules.
Definition SqlUtil.qm.dox.h:4404
const DefaultOpMap
a hash of valid operators for use in Where Clauses
Definition SqlUtil.qm.dox.h:4408
const OP_SUBSTR
the SQL "substr" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4391
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4361
const OP_LT
the SQL less than (<) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4316
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4351
const OP_BETWEEN
the SQL "between" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4376
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4326
const OP_CNE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4366
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition SqlUtil.qm.dox.h:4346
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition SqlUtil.qm.dox.h:4396
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition SqlUtil.qm.dox.h:4401
const OP_CGT
the SQL greater than operator (>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4356
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4371
const OP_LIKE
Definition SqlUtil.qm.dox.h:4311
hash< UpdateOperatorInfo > uop_plus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "+" operator with the given arguments
hash< UpdateOperatorInfo > uop_seq_currval(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
hash< UpdateOperatorInfo > uop_prepend(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "prepend" operator with the given argument
hash< UpdateOperatorInfo > uop_seq(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
hash< UpdateOperatorInfo > uop_upper(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "upper" operator with the given argument; returns a column...
hash< UpdateOperatorInfo > uop_divide(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "/" operator with the given arguments
hash< UpdateOperatorInfo > uop_append(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "append" or concatenate operator with the given argument
hash< UpdateOperatorInfo > make_uop(string uop, auto arg, *hash< UpdateOperatorInfo > nest)
hash< UpdateOperatorInfo > uop_substr(int start, *int count, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "substr" operator with the given arguments; returns a subs...
hash< UpdateOperatorInfo > uop_multiply(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "*" operator with the given arguments
hash< UpdateOperatorInfo > uop_lower(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "lower" operator with the given argument; returns a column...
hash< UpdateOperatorInfo > uop_minus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "-" operator with the given arguments
const DefaultUopMap
Definition SqlUtil.qm.dox.h:3629
Qore AbstractDatabase class definition.
Definition AbstractDatabase.qc.dox.h:26
sqlutil_register_ds_deserializer(*code new_ds_get)
registers a closure or call reference taking a string type and string datasource configuration that w...
sqlutil_register_ds_serializer(*code new_ds_do)
registers a closure or call reference taking a string type and string datasource configuration that w...
const SqlUtilDrivers
known drivers
Definition SqlUtil.qm.dox.h:4839
column operator info hash as returned by all column operator functions
Definition SqlUtil.qm.dox.h:2360
string cop
the column operator string code
Definition SqlUtil.qm.dox.h:2361
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2363
auto column
column sopecifier, may be a string or a complex hash
Definition SqlUtil.qm.dox.h:2362
generic column description hash in schema descriptions
Definition SqlUtil.qm.dox.h:2330
bool notnull
if the column should have a "not null" constraint on it; if missing the default value is False
Definition SqlUtil.qm.dox.h:2346
hash< string, hash > driver
this key can optionally contain a hash keyed by driver name which contains a hash of values that will...
Definition SqlUtil.qm.dox.h:2348
auto default_value
the default value for the column
Definition SqlUtil.qm.dox.h:2340
softint scale
for numeric data types, this value gives the scale
Definition SqlUtil.qm.dox.h:2338
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition SqlUtil.qm.dox.h:2336
bool default_value_native
a boolean flag to say if a default_value should be validated against table column type (False) or use...
Definition SqlUtil.qm.dox.h:2342
*string comment
an optional comment for the column
Definition SqlUtil.qm.dox.h:2344
string qore_type
a qore type string that will be converted to a native DB type with some default conversion
Definition SqlUtil.qm.dox.h:2332
string native_type
the native database column type; if both native_type and qore_type are given then native_type is used
Definition SqlUtil.qm.dox.h:2334
*bool auto_increment
True for DBs that support an auto-increment column
Definition SqlUtil.qm.dox.h:2350
insert operator info hash as returned by all insert operator functions
Definition SqlUtil.qm.dox.h:2367
string _iop
the insert operator string code
Definition SqlUtil.qm.dox.h:2368
any arg
optional argument
Definition SqlUtil.qm.dox.h:2369
join operator info hash as returned by all join operator functions
Definition SqlUtil.qm.dox.h:2380
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition SqlUtil.qm.dox.h:2385
*string alias
optional alias for table in the query
Definition SqlUtil.qm.dox.h:2383
*string ta
optional table name or alias of the other table to join with when not joining with the primary table
Definition SqlUtil.qm.dox.h:2386
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition SqlUtil.qm.dox.h:2382
*hash jcols
the columns to use for the join, the keys will be columns in the source table and the values are colu...
Definition SqlUtil.qm.dox.h:2384
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition SqlUtil.qm.dox.h:2387
string jop
the join operator string code
Definition SqlUtil.qm.dox.h:2381
SQL operator info hash as returned by all operator functions.
Definition SqlUtil.qm.dox.h:2354
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2356
string op
the operator string code
Definition SqlUtil.qm.dox.h:2355
Query information.
Definition SqlUtil.qm.dox.h:2694
*hash< auto > expression_map
The expression map.
Definition SqlUtil.qm.dox.h:2714
*hash< string, AbstractTable > join_map
Tables in this join; table alias -> table.
Definition SqlUtil.qm.dox.h:2705
*hash< auto > pseudo_column_map
Any valid pseudocolumns or aliases generated in th query.
Definition SqlUtil.qm.dox.h:2711
*hash< auto > where_operator_map
The old-style backwards-compatible "where operator" map.
Definition SqlUtil.qm.dox.h:2717
object table
The primary table object.
Definition SqlUtil.qm.dox.h:2696
*hash< auto > query_hash
The original query hash.
Definition SqlUtil.qm.dox.h:2699
*hash< auto > column_operator_map
Any custom column operator map.
Definition SqlUtil.qm.dox.h:2720
list< auto > args
arguments to bind in the query generated
Definition SqlUtil.qm.dox.h:2723
*hash< auto > query_options
Any query options.
Definition SqlUtil.qm.dox.h:2702
*hash< string, bool > subquery_column_map
When executing a superquery, we can only reference colums in the subquery.
Definition SqlUtil.qm.dox.h:2708
A hash describing SQL and arguments for an SQL DML command.
Definition SqlUtil.qm.dox.h:2416
string sql
the SQL string for the update
Definition SqlUtil.qm.dox.h:2418
list< auto > args
the arguments for the string
Definition SqlUtil.qm.dox.h:2421
column data type options
Definition SqlUtil.qm.dox.h:2391
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition SqlUtil.qm.dox.h:2402
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition SqlUtil.qm.dox.h:2396
*softint maxlen
optional additional limit to the maximum length of the data
Definition SqlUtil.qm.dox.h:2410
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition SqlUtil.qm.dox.h:2399
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition SqlUtil.qm.dox.h:2405
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition SqlUtil.qm.dox.h:2393
update operator info hash as returned by all update operator functions
Definition SqlUtil.qm.dox.h:2373
*hash nest
option nested operation hash
Definition SqlUtil.qm.dox.h:2376
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2375
string uop
the update operator string code
Definition SqlUtil.qm.dox.h:2374