Qore SqlUtil Module Reference 1.9.3
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
2334namespace SqlUtil {
2336 public hashdecl GenericColumnInfo {
2342 softint size;
2344 softint scale;
2350 *string comment;
2352 bool notnull = False;
2354 hash<string, hash> driver;
2357 };
2358
2360 public hashdecl OperatorInfo {
2361 string op;
2362 auto arg;
2363 };
2364
2366 public hashdecl ColumnOperatorInfo {
2367 string cop;
2368 auto column;
2369 auto arg;
2370 };
2371
2373 public hashdecl InsertOperatorInfo {
2374 string _iop;
2375 any arg;
2376 };
2377
2379 public hashdecl UpdateOperatorInfo {
2380 string uop;
2381 auto arg;
2382 *hash nest;
2383 };
2384
2386 public hashdecl JoinOperatorInfo {
2387 string jop;
2388 auto table;
2389 *string alias;
2390 *hash jcols;
2391 *hash cond;
2392 *string ta;
2393 *hash<auto> opt;
2394 };
2395
2400
2402 *TimeZone data_timezone;
2403
2405 *TimeZone db_timezone;
2406
2409
2411 *softbool mandatory;
2412
2414
2416 *softint maxlen;
2417 };
2418
2420
2422 public hashdecl SqlCommandInfo {
2424 string sql;
2425
2427 list<auto> args;
2428 };
2429
2435
2437 const DB_FUNCTIONS = "functions";
2439 const DB_MVIEWS = "materialized views";
2441 const DB_PACKAGES = "packages";
2443 const DB_PROCEDURES = "procedures";
2445 const DB_SEQUENCES = "sequences";
2447 const DB_TABLES = "tables";
2449 const DB_TYPES = "named types";
2451 const DB_VIEWS = "views";
2453 const DB_SYNONYMS = "synonyms";
2455
2456 /* @defgroup SqlTypeConstants SQL Type Constants
2457 These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
2458 */
2461 const VARCHAR = "string";
2462
2464 const NUMERIC = "number";
2465
2467 const CHAR = "char";
2468
2470 const BLOB = "blob";
2471
2473 const CLOB = "clob";
2475
2481 const SZ_NONE = 0;
2482
2484 const SZ_MAND = 1;
2485
2487 const SZ_OPT = 2;
2488
2490 const SZ_NUM = 3;
2492
2498
2500 const COP_AS = "as";
2501
2503
2505 const COP_CAST = "cast";
2506
2508
2510 const COP_PREPEND = "prepend";
2511
2513
2515 const COP_APPEND = "append";
2516
2518
2520 const COP_VALUE = "value";
2521
2523
2525 const COP_UPPER = "upper";
2526
2528
2530 const COP_LOWER = "lower";
2531
2533
2535 const COP_DISTINCT = "distinct";
2536
2538
2540 const COP_MIN = "min";
2541
2543
2545 const COP_MAX = "max";
2546
2548
2550 const COP_AVG = "avg";
2551
2553
2555 const COP_SUM = "sum";
2556
2558
2560 const COP_COUNT = "count";
2561
2563
2565 const COP_OVER = "over";
2566
2568
2570 const COP_MINUS = "minus";
2571
2573
2575 const COP_PLUS = "plus";
2576
2578
2580 const COP_DIVIDE = "divide";
2581
2583
2585 const COP_MULTIPLY = "multiply";
2586
2588
2590 const COP_YEAR = "year";
2591
2593
2595 const COP_YEAR_MONTH = "year_month";
2596
2598
2600 const COP_YEAR_DAY = "year_day";
2601
2603
2605 const COP_YEAR_HOUR = "year_hour";
2606
2608
2610 const COP_SEQ = "seq";
2611
2613
2615 const COP_SEQ_CURRVAL = "seq_currval";
2616
2618
2620 const COP_COALESCE = "coalesce";
2621
2623
2625 const COP_SUBSTR = "substr";
2626
2628
2632 const COP_LENGTH = "length";
2633
2635
2641 const COP_TRUNC_DATE = "truncate_date";
2642
2644
2648 const COP_CUME_DIST = "cume_dist";
2649
2651
2655 const COP_DENSE_RANK = "dense_rank";
2656
2658
2662 const COP_FIRST_VALUE = "first_value";
2663
2665
2669 const COP_LAST_VALUE = "last_value";
2670
2672
2676 const COP_NTILE = "ntile";
2677
2679
2683 const COP_PERCENT_RANK = "percent_rank";
2684
2686
2690 const COP_RANK = "rank";
2691
2693
2697 const COP_ROW_NUMBER = "row_number";
2698
2700 public hashdecl QueryInfo {
2702 object table;
2703
2705 *hash<auto> query_hash;
2706
2708 *hash<auto> query_options;
2709
2711 *hash<string, AbstractTable> join_map;
2712
2714 *hash<string, bool> subquery_column_map;
2715
2718
2720 *hash<auto> expression_map;
2721
2724
2727
2729 list<auto> args;
2730 };
2731
2733 const DefaultCopMap = ...;
2734
2736
2779
2787 hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
2788
2789
2791
2803 hash<ColumnOperatorInfo> cop_as(auto column, string arg);
2804
2805
2807
2821 hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
2822
2823
2825
2835 hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
2836
2837
2839
2849 hash<ColumnOperatorInfo> cop_append(auto column, string arg);
2850
2851
2853
2981 hash<ColumnOperatorInfo> cop_value(auto arg);
2982
2983
2985
2994 hash<ColumnOperatorInfo> cop_upper(auto column);
2995
2996
2998
3007 hash<ColumnOperatorInfo> cop_lower(auto column);
3008
3009
3011
3020 hash<ColumnOperatorInfo> cop_distinct(auto column);
3021
3022
3024
3033 hash<ColumnOperatorInfo> cop_min(auto column);
3034
3035
3037
3046 hash<ColumnOperatorInfo> cop_max(auto column);
3047
3048
3050
3059 hash<ColumnOperatorInfo> cop_avg(auto column);
3060
3061
3063
3072 hash<ColumnOperatorInfo> cop_sum(auto column);
3073
3074
3076
3083 hash<ColumnOperatorInfo> cop_count(auto column = '');
3084
3085
3087
3094 hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
3095
3096
3098
3108 hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
3109
3110
3112
3122 hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
3123
3124
3126
3136 hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
3137
3138
3140
3150 hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
3151
3152
3154
3163 hash<ColumnOperatorInfo> cop_year(auto column);
3164
3165
3167
3176 hash<ColumnOperatorInfo> cop_year_month(auto column);
3177
3178
3180
3189 hash<ColumnOperatorInfo> cop_year_day(auto column);
3190
3191
3193
3202 hash<ColumnOperatorInfo> cop_year_hour(auto column);
3203
3204
3206
3216 hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
3217
3218
3220
3230 hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
3231
3232
3234
3246 hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
3247
3248
3250
3261 hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
3262
3263
3265
3276 hash<ColumnOperatorInfo> cop_length(auto column);
3277
3278
3280
3294 hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
3295
3296
3297
3299
3327 hash<ColumnOperatorInfo> cop_cume_dist();
3328
3329
3331
3359 hash<ColumnOperatorInfo> cop_dense_rank();
3360
3361
3363
3391 hash<ColumnOperatorInfo> cop_first_value(any column);
3392
3393
3395
3423 hash<ColumnOperatorInfo> cop_last_value(any column);
3424
3425
3427
3457 hash<ColumnOperatorInfo> cop_ntile(int value);
3458
3459
3461
3489 hash<ColumnOperatorInfo> cop_percent_rank();
3490
3491
3493
3521 hash<ColumnOperatorInfo> cop_rank();
3522
3523
3525
3553 hash<ColumnOperatorInfo> cop_row_number();
3554
3555
3557
3609 const DT_YEAR = "Y";
3610
3612 const DT_MONTH = "M";
3613
3615 const DT_DAY = "D";
3616
3618 const DT_HOUR = "H";
3619
3621 const DT_MINUTE = "m";
3622
3624 const DT_SECOND = "S";
3625
3626 // let's simulate and enum here'
3627 const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
3629
3635 const DefaultUopMap = ...;
3636
3638
3661
3669 hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
3670
3671
3673
3683 hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
3684
3685
3687
3697 hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
3698
3699
3701
3710 hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
3711
3712
3714
3723 hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
3724
3725
3727
3738 hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
3739
3740
3742
3752 hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
3753
3754
3756
3766 hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
3767
3768
3770
3780 hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
3781
3782
3784
3794 hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
3795
3796
3798
3807 hash<UpdateOperatorInfo> uop_seq(string seq);
3808
3809
3811
3820 hash<UpdateOperatorInfo> uop_seq_currval(string seq);
3821
3823
3831
3833 const JOP_INNER = "inner";
3834
3836
3838 const JOP_LEFT = "left";
3839
3841
3843 const JOP_RIGHT = "right";
3844
3846 const JopMap = ...;
3847
3849
3860
3863 hash<string, hash<JoinOperatorInfo>> make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3864
3865
3867
3871 hash<string, hash<JoinOperatorInfo>> make_jop(string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3872
3873
3875
3894 hash<string, hash<JoinOperatorInfo>> join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3895
3896
3898
3917 hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3918
3919
3921
3940 hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3941
3942
3944
3966 hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3967
3968
3970
3990 hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3991
3992
3994
4016 hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4017
4018
4020
4039 hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4040
4041
4043
4062 hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4063
4064
4066
4087 hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4088
4089
4091
4111 hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4112
4113
4115
4135 hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4136
4137
4139
4161 hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4162
4163
4165
4184 hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4185
4186
4188
4207 hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4208
4209
4211
4232 hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4233
4234
4236
4256 hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4257
4258
4260
4280 hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4281
4282
4284
4306 hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4307
4309
4315
4317 const OP_LIKE = "like";
4318
4320
4322 const OP_LT = "<";
4323
4325
4327 const OP_LE = "<=";
4328
4330
4332 const OP_GT = ">";
4333
4335
4337 const OP_GE = ">=";
4338
4340
4342 const OP_NE = "!=";
4343
4345
4347 const OP_EQ = "=";
4348
4350
4352 const OP_CLT = "C<";
4353
4355
4357 const OP_CLE = "C<=";
4358
4360
4362 const OP_CGT = "C>";
4363
4365
4367 const OP_CGE = "C>=";
4368
4370
4372 const OP_CNE = "C!=";
4373
4375
4377 const OP_CEQ = "C=";
4378
4380
4382 const OP_BETWEEN = "between";
4383
4385
4387 const OP_IN = "in";
4388
4390
4392 const OP_NOT = "not";
4393
4395
4397 const OP_SUBSTR = "substr";
4398
4400
4402 const OP_OR = "or";
4403
4405
4407 const OP_IN_SELECT = "in_select";
4408
4411
4412
4414 const DefaultOpMap = ...;
4415
4417
4442 hash<OperatorInfo> make_op(string op, auto arg);
4443
4444
4446
4455 hash<OperatorInfo> op_like(string str);
4456
4457
4459
4470 hash<OperatorInfo> op_lt(auto arg);
4471
4472
4474
4485 hash<OperatorInfo> op_le(auto arg);
4486
4487
4489
4500 hash<OperatorInfo> op_gt(auto arg);
4501
4502
4504
4515 hash<OperatorInfo> op_ge(auto arg);
4516
4517
4519
4532 hash<OperatorInfo> op_ne(auto arg);
4533
4534
4536
4549 hash<OperatorInfo> op_eq(auto arg);
4550
4551
4553
4565 hash<OperatorInfo> op_between(auto l, auto r);
4566
4567
4569
4578 hash<OperatorInfo> op_in();
4579
4580
4582
4589 hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
4590
4591
4593
4600 hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
4601
4602
4604
4611 hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
4612
4613
4615
4626 hash<OperatorInfo> op_in(list<auto> args);
4627
4628
4630
4637 hash<OperatorInfo> op_not(hash arg);
4638
4639
4641
4652 hash<OperatorInfo> op_clt(string arg);
4653
4654
4656
4667 hash<OperatorInfo> op_cle(string arg);
4668
4669
4671
4682 hash<OperatorInfo> op_cgt(string arg);
4683
4684
4686
4697 hash<OperatorInfo> op_cge(string arg);
4698
4699
4701
4712 hash<OperatorInfo> op_cne(string arg);
4713
4714
4716
4727 hash<OperatorInfo> op_ceq(string arg);
4728
4729
4731
4742 hash<OperatorInfo> op_substr(int start, *int count, string text);
4743
4744
4746
4756 hash<OperatorInfo> op_substr(int start, string text);
4757
4758
4760
4777 hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
4778
4780
4788
4790 const IOP_SEQ = "seq";
4791
4793
4795 const IOP_SEQ_CURRVAL = "seq_currval";
4796
4798 const DefaultIopMap = {};
4800
4807
4814 hash<InsertOperatorInfo> make_iop(string iop, auto arg);
4815
4816
4818
4827 hash<InsertOperatorInfo> iop_seq(string arg);
4828
4829
4831
4840 hash<InsertOperatorInfo> iop_seq_currval(string arg);
4841
4843
4845 const SqlUtilDrivers = ...;
4846
4847
4848 // private variable to store the closure used to deserialize datasources (if any)
4849 extern code ds_get;
4850
4851 // private variable to store the closure used to serialize datasources (if any)
4852 extern code ds_do;
4853
4856
4857
4860
4861
4862 // private function used to deserialize datasources
4863 AbstractDatasource sqlutil_get_ds(string type, string config);
4864
4865
4866 // private function used to serialize datasources
4867 hash<auto> sqlutil_ds(AbstractDatasource ds);
4868
4869
4872
4873public:
4874
4875
4876protected:
4878 *hash h;
4879
4880public:
4881
4883 constructor(*hash nh);
4884
4885
4888
4889
4892
4893
4895
4910 auto memberGate(string k);
4911
4912
4914
4921
4922
4924 abstract auto take(string k);
4925
4927 renameKey(string old_name, string new_name);
4928
4929
4931 *hash<auto> getHash();
4932
4933
4935
4944 bool matchKeys(hash h1);
4945
4946
4948
4957 bool matchKeys(list<auto> l);
4958
4959
4961
4971
4972
4974
4983 bool partialMatchKeys(hash<auto> h1);
4984
4985
4987
4996 bool partialMatchKeys(list<auto> l);
4997
4998
5000
5010
5011
5013
5022 bool val();
5023
5024
5026
5033 list<string> keys();
5034
5035
5037
5044 list<auto> values();
5045
5046
5048
5056
5057
5059
5067
5068
5070
5078
5079
5081 bool empty();
5082
5083
5085
5092 int size();
5093
5094
5096
5105 bool hasKey(string k);
5106
5107
5109
5118 bool hasKeyValue(string k);
5119
5120
5122
5131 *string firstKey();
5132
5133
5135
5144 *string lastKey();
5145
5146
5148 abstract string getElementName();
5149 };
5150
5153
5154public:
5155
5156
5157protected:
5158 softlist l;
5159
5160public:
5161
5163 constructor(softlist nl);
5164
5165
5167
5178 abstract auto get(softint i);
5179
5181 add(auto val);
5182
5183
5185 auto take(int i);
5186
5187
5189 list<auto> getList();
5190
5191
5193
5202 bool val();
5203
5204
5206
5214
5215
5217 bool empty();
5218
5219
5221
5228 int size();
5229
5230
5232 abstract string getElementName();
5233
5234protected:
5235 checkIndex(int i);
5236public:
5237
5238 };
5239
5242
5243public:
5246
5247
5249 constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
5250
5251
5253 constructor(AbstractDatasource ds);
5254
5255
5257 add(string k, Table val);
5258
5259
5262
5263
5266
5267
5270
5271
5274
5275
5277 populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
5278
5279
5281 populate(AbstractDatasource ds);
5282
5283
5285
5301 *list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
5302
5303
5305
5321
5322
5325
5326
5328 *AbstractTable getIfExists(AbstractDatasource ds, string name);
5329
5330
5332 AbstractTable get(AbstractDatasource ds, string name);
5333
5334
5336
5351 *string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
5352
5353
5355
5366 bool tableRenamed(string old_name, string new_name, string old_sql_name);
5367
5368
5369protected:
5370 tableRenamedIntern(string old_name, string new_name, string oldsn);
5371public:
5372
5373
5375
5390 *string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
5391
5392
5393 list<auto> getCreateList();
5394
5395
5396 Qore::AbstractIterator createIterator();
5397
5398
5400
5408 list<auto> getDropList();
5409
5410
5412
5420
5421
5422protected:
5423 getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
5424public:
5425
5426 };
5427
5430
5431public:
5433 constructor(*hash c) ;
5434
5435
5438
5439
5442
5443
5446
5447
5449
5465
5466
5468 Columns subset(softlist l);
5469
5470
5473
5474
5476 bool equal(Columns cols);
5477
5478
5480 AbstractIterator getSqlColumnNameIterator();
5481
5482 };
5483
5486
5487public:
5489 string name;
5490
5492 string ddl_name;
5493
5495protected:
5497public:
5498
5499
5502
5503
5505
5507 abstract string getDdlName(string name);
5508 };
5509
5512
5513public:
5516
5518 *string qore_type;
5519
5521 int size;
5522
5525
5527 *string def_val;
5528
5530 *string comment;
5531
5533 *int scale;
5534
5537
5539protected:
5541public:
5542
5543
5544 constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c, *int scale) ;
5545
5546
5548
5552 hash<GenericColumnInfo> getDescriptionHash();
5553
5554
5556
5559
5560
5563
5564
5566
5575 abstract list<auto> getAddColumnSql(AbstractTable t);
5576
5578 string getDropSql(string table_name);
5579
5580
5582
5595 list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5596
5597
5599
5609 abstract string getRenameSql(AbstractTable t, string new_name);
5610
5613
5614
5616protected:
5617 abstract bool equalImpl(AbstractColumn c);
5618public:
5619
5621
5637protected:
5638 abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5639public:
5640 };
5641
5644
5645public:
5646 constructor(*hash c) ;
5647
5648
5651
5652
5655
5656
5659
5660
5663
5664
5666
5682
5683
5684 string getElementName();
5685
5686 };
5687
5690
5691public:
5693 string name;
5694
5697
5700
5701protected:
5704
5707
5708public:
5709
5711 constructor(string n, bool u, hash c);
5712
5713
5715 string getName();
5716
5717
5719 bool hasColumn(string cname);
5720
5721
5723 abstract string getCreateSql(string table_name, *hash<auto> opt);
5724
5726 string getDropSql(string table_name);
5727
5728
5731
5732
5735
5736
5738 abstract bool equalImpl(AbstractIndex ix);
5739
5741 abstract string getRenameSql(string table_name, string new_name);
5742
5745
5746
5749
5750
5753
5754
5757
5758
5761
5762
5765
5766
5768 *list<AbstractColumnConstraint> getAllSupportingConstraints();
5769
5770
5772 list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
5773
5774 };
5775
5778
5779public:
5780 constructor(*hash c) ;
5781
5782
5785
5786
5789
5790
5793
5794
5796
5812
5813
5814 string getElementName();
5815
5816 };
5817
5820
5821public:
5822
5823
5824protected:
5826 string name;
5827
5828public:
5829
5831 constructor(string n);
5832
5833
5835 string getName();
5836
5837
5839 rename(string n);
5840
5841
5843 abstract string getCreateSql(string table_name, *hash<auto> opt);
5844
5846 string getDropSql(string table_name);
5847
5848
5850 abstract list<auto> getRenameSql(string table_name, string new_name);
5851
5853 string getDisableSql(string table_name);
5854
5855
5857 string getEnableSql(string table_name, *hash<auto> opt);
5858
5859
5862
5863
5865protected:
5867public:
5868
5870 abstract bool setIndexBase(string ix);
5871
5873 abstract clearIndex();
5874
5876 bool hasColumn(string cname);
5877
5878 };
5879
5882
5883public:
5885 string src;
5886
5888 constructor(string n, string n_src) ;
5889
5890
5892protected:
5894public:
5895
5896
5898 bool setIndexBase(string ix);
5899
5900
5903
5904 };
5905
5908
5909public:
5910protected:
5912 *string index;
5913
5914public:
5915
5917 constructor(string name, *hash<auto> cols, *string index) ;
5918
5919
5921 constructor(string name, Columns cols, *string index) ;
5922
5923
5925 bool setIndexBase(string ix);
5926
5927
5929 bool hasColumn(string cname);
5930
5931
5934
5935 };
5936
5939
5940public:
5941protected:
5943 *hash<string, hash<string, AbstractForeignConstraint>> sourceConstraints;
5944
5945public:
5946
5948 constructor(string name, *hash<auto> cols, *string index) ;
5949
5950
5952 constructor(string name, Columns cols, *string index) ;
5953
5954
5956
5961
5962
5964 hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
5965
5966
5969
5970
5972
5983
5984
5986 removeSourceConstraint(string tname, list<auto> cols);
5987
5988
5990 renameSourceConstraintTable(string old_name, string new_name);
5991
5992
5994 bool hasColumn(string cname);
5995
5996
5998 *string getIndex();
5999
6000
6002protected:
6004public:
6005
6006
6008 abstract string getCreateSql(string table_name, *hash<auto> opts);
6009 };
6010
6013
6014public:
6016 constructor(string n, *hash<auto> c, *string n_index) ;
6017
6018 };
6019
6022
6023public:
6024 constructor() ;
6025
6026
6027 constructor(string n, *hash<auto> c) ;
6028
6029 };
6030
6033
6034public:
6035 constructor(*hash<auto> c) ;
6036
6037
6040
6041
6044
6045
6048
6049
6051
6067
6068
6070 *hash<auto> findConstraintOn(string table, softlist<auto> cols);
6071
6072
6075
6076 };
6077
6080
6081public:
6083 string table;
6084
6087
6089 constructor(string t, Columns c);
6090
6091
6093 bool hasColumn(string cname);
6094
6095
6098
6099 };
6100
6103
6104public:
6107
6109
6110
6112 bool hasTargetColumn(string col);
6113
6114
6116protected:
6118public:
6119
6120 };
6121
6124
6125public:
6127 string name;
6128
6130 number start;
6131
6134
6136 *number max;
6137
6139 constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
6140
6141
6143 abstract string getCreateSql(*hash<auto> opt);
6144
6146
6148 string getDropSql(*hash<auto> opt);
6149
6150
6152
6155 abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6156 };
6157
6160
6161public:
6162 // ! potential object schema
6163 *string schema;
6164
6166 string name;
6167
6169 string src;
6170
6173
6175 constructor(string n_name, string n_src);
6176
6177
6179 abstract string getCreateSql(*hash<auto> opt);
6180
6182
6184 string getDropSql(*hash<auto> opt);
6185
6186
6188
6191 abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6192 };
6193
6196
6197public:
6199 string name;
6200
6202 string type;
6203
6205 string src;
6206
6208
6212 constructor(string n, string n_type, string n_src);
6213
6214
6216 string getType();
6217
6218
6220
6222 string getDropSql(*hash<auto> opt);
6223
6224
6227
6228
6230 string getNormalizedSource(string src);
6231
6232
6234protected:
6236public:
6237 };
6238
6241
6242public:
6244
6248 constructor(string n, string n_type, string n_src) ;
6249
6250
6252 abstract list<auto> getCreateSql(*hash<auto> opt);
6253
6255
6258 abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6259
6261 setName(string new_name);
6262
6263 };
6264
6267
6268public:
6269 constructor(*hash c) ;
6270
6271
6274
6275
6278
6279
6281
6297
6298
6299 string getElementName();
6300
6301 };
6302
6305
6306public:
6308 constructor(string n, string n_src) ;
6309
6310
6312 abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
6313
6315 abstract softlist<auto> getRenameSql(string table_name, string new_name);
6316
6318 abstract list<auto> getDropSql(string table_name);
6319 };
6320
6323
6324public:
6325 constructor(*hash c) ;
6326
6327
6330
6331
6334
6335
6337
6353
6354
6355 string getElementName();
6356
6357 };
6358};
abstract class for check constraints
Definition SqlUtil.qm.dox.h:5881
string src
the source of the check clause
Definition SqlUtil.qm.dox.h:5885
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:5907
*string index
the index supporting the constraint
Definition SqlUtil.qm.dox.h:5912
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:5511
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:5515
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:5530
*string def_val
default value for column
Definition SqlUtil.qm.dox.h:5527
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:5518
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:5524
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:5536
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:5521
*int scale
the scale for numeric columns
Definition SqlUtil.qm.dox.h:5533
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:5938
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:5943
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:5819
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:5826
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:5485
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:5492
string name
the name of the object
Definition SqlUtil.qm.dox.h:5489
constructor(string name)
creates the object from the name
the base class for foreign key constraint information
Definition SqlUtil.qm.dox.h:6102
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:6106
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:6195
string getNormalizedSource(string src)
returns normalized source for comparisons
string name
the name of the object
Definition SqlUtil.qm.dox.h:6199
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:6205
string type
the type of object
Definition SqlUtil.qm.dox.h:6202
string getType()
returns the type of object
base class for functions
Definition SqlUtil.qm.dox.h:6240
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:4871
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:4878
abstract string getElementName()
must return the name of the contained element
list< string > keys()
Returns a list of key names of the contained hash.
bool partialMatchKeys(hash< auto > h1)
returns True if the hash argument has at least the same keys (in any order, can have more keys),...
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:5689
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:5706
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:5693
*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:5696
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition SqlUtil.qm.dox.h:5703
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:5699
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:5152
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:6021
base class for sequences
Definition SqlUtil.qm.dox.h:6123
*number max
the ending number
Definition SqlUtil.qm.dox.h:6136
string name
the name of the sequence
Definition SqlUtil.qm.dox.h:6127
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:6130
number increment
the increment
Definition SqlUtil.qm.dox.h:6133
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:6304
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:6012
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:6159
bool updatable
Flag showing if is the view updatable with DML commands.
Definition SqlUtil.qm.dox.h:6172
string name
the name of the sequence
Definition SqlUtil.qm.dox.h:6166
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:6169
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:5429
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:5777
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:6079
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:6086
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:6083
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:6032
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:6266
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:5643
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:5241
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:6322
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:2481
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition SqlUtil.qm.dox.h:2490
const SZ_MAND
the data type takes a mandatory size parameter
Definition SqlUtil.qm.dox.h:2484
const SZ_OPT
the data type takes an optional size parameter
Definition SqlUtil.qm.dox.h:2487
const CLOB
specifies a large variable-length character column (ie CLOB or TEXT, etc)
Definition SqlUtil.qm.dox.h:2473
const DB_SYNONYMS
Feature: synonyms.
Definition SqlUtil.qm.dox.h:2453
const DB_PACKAGES
Feature: packages.
Definition SqlUtil.qm.dox.h:2441
const VARCHAR
Definition SqlUtil.qm.dox.h:2461
const DB_MVIEWS
Feature: materialized views / snapshots.
Definition SqlUtil.qm.dox.h:2439
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition SqlUtil.qm.dox.h:2470
const DB_PROCEDURES
Feature: procedures.
Definition SqlUtil.qm.dox.h:2443
const DB_TABLES
Feature: tables.
Definition SqlUtil.qm.dox.h:2447
const DB_VIEWS
Feature: views.
Definition SqlUtil.qm.dox.h:2451
const CHAR
specifies a CHAR column
Definition SqlUtil.qm.dox.h:2467
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition SqlUtil.qm.dox.h:2464
const DB_FUNCTIONS
Feature: functions.
Definition SqlUtil.qm.dox.h:2437
const DB_SEQUENCES
Feature: sequences.
Definition SqlUtil.qm.dox.h:2445
const DB_TYPES
Feature: named types.
Definition SqlUtil.qm.dox.h:2449
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:3609
const DT_MINUTE
Format unit: minute.
Definition SqlUtil.qm.dox.h:3621
const DT_SECOND
Format unit: hour.
Definition SqlUtil.qm.dox.h:3624
const DT_MONTH
Format unit: month.
Definition SqlUtil.qm.dox.h:3612
const DT_HOUR
Format unit: hour.
Definition SqlUtil.qm.dox.h:3618
const DT_DAY
Format unit: day.
Definition SqlUtil.qm.dox.h:3615
const COP_MAX
to return the maximum value
Definition SqlUtil.qm.dox.h:2545
const COP_OVER
the SQL "over" clause
Definition SqlUtil.qm.dox.h:2565
const COP_SEQ_CURRVAL
to return the last value of a sequence issued in the same session
Definition SqlUtil.qm.dox.h:2615
const COP_LENGTH
to get the length of a text field
Definition SqlUtil.qm.dox.h:2632
const COP_RANK
Analytic (window) function: RANK.
Definition SqlUtil.qm.dox.h:2690
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition SqlUtil.qm.dox.h:2520
const COP_COALESCE
to return the first non-null argument in the list
Definition SqlUtil.qm.dox.h:2620
const COP_MIN
to return the minimum value
Definition SqlUtil.qm.dox.h:2540
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition SqlUtil.qm.dox.h:2605
const COP_DIVIDE
the SQL "divide" operator
Definition SqlUtil.qm.dox.h:2580
const COP_YEAR
to return a date value with year information only
Definition SqlUtil.qm.dox.h:2590
const COP_COUNT
to return the row count
Definition SqlUtil.qm.dox.h:2560
const COP_MULTIPLY
the SQL "multiply" operator
Definition SqlUtil.qm.dox.h:2585
const COP_AVG
to return the average value
Definition SqlUtil.qm.dox.h:2550
const COP_PLUS
the SQL "plus" operator
Definition SqlUtil.qm.dox.h:2575
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition SqlUtil.qm.dox.h:2648
const COP_SUBSTR
to extract a substring from a column
Definition SqlUtil.qm.dox.h:2625
const COP_SEQ
to return the next value of a sequence
Definition SqlUtil.qm.dox.h:2610
const COP_APPEND
to append a string to a column on output
Definition SqlUtil.qm.dox.h:2515
const COP_PERCENT_RANK
Analytic (window) function: PERCENT_RANK.
Definition SqlUtil.qm.dox.h:2683
const COP_NTILE
Analytic (window) function: NTILE.
Definition SqlUtil.qm.dox.h:2676
const COP_YEAR_MONTH
to return a date value with year to month information
Definition SqlUtil.qm.dox.h:2595
const COP_PREPEND
to prepend a string to a column on output
Definition SqlUtil.qm.dox.h:2510
const COP_LOWER
to return column value in lower case
Definition SqlUtil.qm.dox.h:2530
const COP_AS
Definition SqlUtil.qm.dox.h:2500
const COP_CAST
to convert column value into another datatype
Definition SqlUtil.qm.dox.h:2505
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition SqlUtil.qm.dox.h:2697
const COP_YEAR_DAY
to return a date value with year to day information
Definition SqlUtil.qm.dox.h:2600
const COP_UPPER
to return column value in upper case
Definition SqlUtil.qm.dox.h:2525
const COP_DENSE_RANK
Analytic (window) function: DENSE_RANK.
Definition SqlUtil.qm.dox.h:2655
const COP_TRUNC_DATE
to return the date with truncated value
Definition SqlUtil.qm.dox.h:2641
const COP_MINUS
the SQL "minus" operator
Definition SqlUtil.qm.dox.h:2570
const COP_LAST_VALUE
Analytic (window) function: LAST_VALUE.
Definition SqlUtil.qm.dox.h:2669
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition SqlUtil.qm.dox.h:2662
const DefaultCopMap
a hash of default column operator descriptions
Definition SqlUtil.qm.dox.h:2733
const COP_DISTINCT
to return distinct values
Definition SqlUtil.qm.dox.h:2535
const COP_SUM
to return the sum value
Definition SqlUtil.qm.dox.h:2555
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:4790
const DefaultIopMap
a hash of default insert operator descriptions (currently empty, all operators are driver-dependent)
Definition SqlUtil.qm.dox.h:4798
const IOP_SEQ_CURRVAL
for using the last value of a sequence issued in the current session
Definition SqlUtil.qm.dox.h:4795
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:3846
const JOP_INNER
Definition SqlUtil.qm.dox.h:3833
const JOP_RIGHT
for right outer joins
Definition SqlUtil.qm.dox.h:3843
const JOP_LEFT
for left outer joins
Definition SqlUtil.qm.dox.h:3838
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:4337
const OP_NE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4342
const OP_LE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4327
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4347
const OP_IN
the SQL "in" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4387
const OP_NOT
the SQL "not" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4392
const DefaultExpressionMap
Default expressions to be supported by all SqlUtil modules.
Definition SqlUtil.qm.dox.h:4410
const DefaultOpMap
a hash of valid operators for use in Where Clauses
Definition SqlUtil.qm.dox.h:4414
const OP_SUBSTR
the SQL "substr" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4397
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4367
const OP_LT
the SQL less than (<) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4322
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4357
const OP_BETWEEN
the SQL "between" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4382
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4332
const OP_CNE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4372
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition SqlUtil.qm.dox.h:4352
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition SqlUtil.qm.dox.h:4402
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition SqlUtil.qm.dox.h:4407
const OP_CGT
the SQL greater than operator (>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4362
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4377
const OP_LIKE
Definition SqlUtil.qm.dox.h:4317
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:3635
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:4845
column operator info hash as returned by all column operator functions
Definition SqlUtil.qm.dox.h:2366
string cop
the column operator string code
Definition SqlUtil.qm.dox.h:2367
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2369
auto column
column sopecifier, may be a string or a complex hash
Definition SqlUtil.qm.dox.h:2368
generic column description hash in schema descriptions
Definition SqlUtil.qm.dox.h:2336
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:2352
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:2354
auto default_value
the default value for the column
Definition SqlUtil.qm.dox.h:2346
softint scale
for numeric data types, this value gives the scale
Definition SqlUtil.qm.dox.h:2344
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition SqlUtil.qm.dox.h:2342
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:2348
*string comment
an optional comment for the column
Definition SqlUtil.qm.dox.h:2350
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:2338
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:2340
*bool auto_increment
True for DBs that support an auto-increment column
Definition SqlUtil.qm.dox.h:2356
insert operator info hash as returned by all insert operator functions
Definition SqlUtil.qm.dox.h:2373
string _iop
the insert operator string code
Definition SqlUtil.qm.dox.h:2374
any arg
optional argument
Definition SqlUtil.qm.dox.h:2375
join operator info hash as returned by all join operator functions
Definition SqlUtil.qm.dox.h:2386
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition SqlUtil.qm.dox.h:2391
*string alias
optional alias for table in the query
Definition SqlUtil.qm.dox.h:2389
*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:2392
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition SqlUtil.qm.dox.h:2388
*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:2390
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition SqlUtil.qm.dox.h:2393
string jop
the join operator string code
Definition SqlUtil.qm.dox.h:2387
SQL operator info hash as returned by all operator functions.
Definition SqlUtil.qm.dox.h:2360
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2362
string op
the operator string code
Definition SqlUtil.qm.dox.h:2361
Query information.
Definition SqlUtil.qm.dox.h:2700
*hash< auto > expression_map
The expression map.
Definition SqlUtil.qm.dox.h:2720
*hash< string, AbstractTable > join_map
Tables in this join; table alias -> table.
Definition SqlUtil.qm.dox.h:2711
*hash< auto > pseudo_column_map
Any valid pseudocolumns or aliases generated in th query.
Definition SqlUtil.qm.dox.h:2717
*hash< auto > where_operator_map
The old-style backwards-compatible "where operator" map.
Definition SqlUtil.qm.dox.h:2723
object table
The primary table object.
Definition SqlUtil.qm.dox.h:2702
*hash< auto > query_hash
The original query hash.
Definition SqlUtil.qm.dox.h:2705
*hash< auto > column_operator_map
Any custom column operator map.
Definition SqlUtil.qm.dox.h:2726
list< auto > args
arguments to bind in the query generated
Definition SqlUtil.qm.dox.h:2729
*hash< auto > query_options
Any query options.
Definition SqlUtil.qm.dox.h:2708
*hash< string, bool > subquery_column_map
When executing a superquery, we can only reference colums in the subquery.
Definition SqlUtil.qm.dox.h:2714
A hash describing SQL and arguments for an SQL DML command.
Definition SqlUtil.qm.dox.h:2422
string sql
the SQL string for the update
Definition SqlUtil.qm.dox.h:2424
list< auto > args
the arguments for the string
Definition SqlUtil.qm.dox.h:2427
column data type options
Definition SqlUtil.qm.dox.h:2397
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition SqlUtil.qm.dox.h:2408
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition SqlUtil.qm.dox.h:2402
*softint maxlen
optional additional limit to the maximum length of the data
Definition SqlUtil.qm.dox.h:2416
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition SqlUtil.qm.dox.h:2405
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition SqlUtil.qm.dox.h:2411
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition SqlUtil.qm.dox.h:2399
update operator info hash as returned by all update operator functions
Definition SqlUtil.qm.dox.h:2379
*hash nest
option nested operation hash
Definition SqlUtil.qm.dox.h:2382
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2381
string uop
the update operator string code
Definition SqlUtil.qm.dox.h:2380