Qore SqlUtil Module Reference  1.8.1
SqlUtil.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SqlUtil.qm Copyright (C) 2013 - 2022 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 
2301 namespace SqlUtil {
2303  public struct GenericColumnInfo {
2305  string qore_type;
2307  string native_type;
2309  softint size;
2311  softint scale;
2317  *string comment;
2319  bool notnull = False;
2321  hash<string, hash> driver;
2324  };
2325 
2327  public struct OperatorInfo {
2328  string op;
2329  auto arg;
2330  };
2331 
2333  public struct ColumnOperatorInfo {
2334  string cop;
2335  auto column;
2336  auto arg;
2337  };
2338 
2340  public struct InsertOperatorInfo {
2341  string _iop;
2342  any arg;
2343  };
2344 
2346  public struct UpdateOperatorInfo {
2347  string uop;
2348  auto arg;
2350  };
2351 
2353  public struct JoinOperatorInfo {
2354  string jop;
2355  auto table;
2356  *string alias;
2359  *string ta;
2360  *hash<auto> opt;
2361  };
2362 
2366  *string date_format;
2367 
2369  *TimeZone data_timezone;
2370 
2372  *TimeZone db_timezone;
2373 
2375  *string number_format;
2376 
2378  *softbool mandatory;
2379 
2381 
2383  *softint maxlen;
2384  };
2385 
2387 
2389  public struct SqlCommandInfo {
2391  string sql;
2392 
2394  list<auto> args;
2395  };
2396 
2402 
2404  const DB_FUNCTIONS = "functions";
2406  const DB_MVIEWS = "materialized views";
2408  const DB_PACKAGES = "packages";
2410  const DB_PROCEDURES = "procedures";
2412  const DB_SEQUENCES = "sequences";
2414  const DB_TABLES = "tables";
2416  const DB_TYPES = "named types";
2418  const DB_VIEWS = "views";
2420  const DB_SYNONYMS = "synonyms";
2422 
2423  /* @defgroup SqlTypeConstants SQL Type Constants
2424  These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
2425  */
2427  const VARCHAR = "string";
2429 
2431  const NUMERIC = "number";
2432 
2434  const CHAR = "char";
2435 
2437  const BLOB = "blob";
2438 
2440  const CLOB = "clob";
2442 
2448  const SZ_NONE = 0;
2449 
2451  const SZ_MAND = 1;
2452 
2454  const SZ_OPT = 2;
2455 
2457  const SZ_NUM = 3;
2459 
2465 
2467  const COP_AS = "as";
2468 
2470 
2472  const COP_CAST = "cast";
2473 
2475 
2477  const COP_PREPEND = "prepend";
2478 
2480 
2482  const COP_APPEND = "append";
2483 
2485 
2487  const COP_VALUE = "value";
2488 
2490 
2492  const COP_UPPER = "upper";
2493 
2495 
2497  const COP_LOWER = "lower";
2498 
2500 
2502  const COP_DISTINCT = "distinct";
2503 
2505 
2507  const COP_MIN = "min";
2508 
2510 
2512  const COP_MAX = "max";
2513 
2515 
2517  const COP_AVG = "avg";
2518 
2520 
2522  const COP_SUM = "sum";
2523 
2525 
2527  const COP_COUNT = "count";
2528 
2530 
2532  const COP_OVER = "over";
2533 
2535 
2537  const COP_MINUS = "minus";
2538 
2540 
2542  const COP_PLUS = "plus";
2543 
2545 
2547  const COP_DIVIDE = "divide";
2548 
2550 
2552  const COP_MULTIPLY = "multiply";
2553 
2555 
2557  const COP_YEAR = "year";
2558 
2560 
2562  const COP_YEAR_MONTH = "year_month";
2563 
2565 
2567  const COP_YEAR_DAY = "year_day";
2568 
2570 
2572  const COP_YEAR_HOUR = "year_hour";
2573 
2575 
2577  const COP_SEQ = "seq";
2578 
2580 
2582  const COP_SEQ_CURRVAL = "seq_currval";
2583 
2585 
2587  const COP_COALESCE = "coalesce";
2588 
2590 
2592  const COP_SUBSTR = "substr";
2593 
2595 
2599  const COP_LENGTH = "length";
2600 
2602 
2608  const COP_TRUNC_DATE = "truncate_date";
2609 
2611 
2615  const COP_CUME_DIST = "cume_dist";
2616 
2618 
2622  const COP_DENSE_RANK = "dense_rank";
2623 
2625 
2629  const COP_FIRST_VALUE = "first_value";
2630 
2632 
2636  const COP_LAST_VALUE = "last_value";
2637 
2639 
2643  const COP_NTILE = "ntile";
2644 
2646 
2650  const COP_PERCENT_RANK = "percent_rank";
2651 
2653 
2657  const COP_RANK = "rank";
2658 
2660 
2664  const COP_ROW_NUMBER = "row_number";
2665 
2667  public struct QueryInfo {
2669  object table;
2670 
2672  *hash<auto> query_hash;
2673 
2675  *hash<auto> query_options;
2676 
2678  *hash<string, AbstractTable> join_map;
2679 
2681  *hash<string, bool> subquery_column_map;
2682 
2684  *hash<auto> pseudo_column_map;
2685 
2687  *hash<auto> expression_map;
2688 
2690  *hash<auto> where_operator_map;
2691 
2693  *hash<auto> column_operator_map;
2694 
2696  list<auto> args;
2697  };
2698 
2700  const DefaultCopMap = ...;
2701 
2703 
2746 
2754  hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
2755 
2756 
2758 
2770  hash<ColumnOperatorInfo> cop_as(auto column, string arg);
2771 
2772 
2774 
2788  hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
2789 
2790 
2792 
2802  hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
2803 
2804 
2806 
2816  hash<ColumnOperatorInfo> cop_append(auto column, string arg);
2817 
2818 
2820 
2948  hash<ColumnOperatorInfo> cop_value(auto arg);
2949 
2950 
2952 
2961  hash<ColumnOperatorInfo> cop_upper(auto column);
2962 
2963 
2965 
2974  hash<ColumnOperatorInfo> cop_lower(auto column);
2975 
2976 
2978 
2987  hash<ColumnOperatorInfo> cop_distinct(auto column);
2988 
2989 
2991 
3000  hash<ColumnOperatorInfo> cop_min(auto column);
3001 
3002 
3004 
3013  hash<ColumnOperatorInfo> cop_max(auto column);
3014 
3015 
3017 
3026  hash<ColumnOperatorInfo> cop_avg(auto column);
3027 
3028 
3030 
3039  hash<ColumnOperatorInfo> cop_sum(auto column);
3040 
3041 
3043 
3050  hash<ColumnOperatorInfo> cop_count(auto column = '');
3051 
3052 
3054 
3061  hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
3062 
3063 
3065 
3075  hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
3076 
3077 
3079 
3089  hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
3090 
3091 
3093 
3103  hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
3104 
3105 
3107 
3117  hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
3118 
3119 
3121 
3130  hash<ColumnOperatorInfo> cop_year(auto column);
3131 
3132 
3134 
3143  hash<ColumnOperatorInfo> cop_year_month(auto column);
3144 
3145 
3147 
3156  hash<ColumnOperatorInfo> cop_year_day(auto column);
3157 
3158 
3160 
3169  hash<ColumnOperatorInfo> cop_year_hour(auto column);
3170 
3171 
3173 
3183  hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
3184 
3185 
3187 
3197  hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
3198 
3199 
3201 
3213  hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
3214 
3215 
3217 
3228  hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
3229 
3230 
3232 
3243  hash<ColumnOperatorInfo> cop_length(auto column);
3244 
3245 
3247 
3261  hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
3262 
3263 
3264 
3266 
3294  hash<ColumnOperatorInfo> cop_cume_dist();
3295 
3296 
3298 
3326  hash<ColumnOperatorInfo> cop_dense_rank();
3327 
3328 
3330 
3358  hash<ColumnOperatorInfo> cop_first_value(any column);
3359 
3360 
3362 
3390  hash<ColumnOperatorInfo> cop_last_value(any column);
3391 
3392 
3394 
3424  hash<ColumnOperatorInfo> cop_ntile(int value);
3425 
3426 
3428 
3456  hash<ColumnOperatorInfo> cop_percent_rank();
3457 
3458 
3460 
3488  hash<ColumnOperatorInfo> cop_rank();
3489 
3490 
3492 
3520  hash<ColumnOperatorInfo> cop_row_number();
3521 
3522 
3524 
3576  const DT_YEAR = "Y";
3577 
3579  const DT_MONTH = "M";
3580 
3582  const DT_DAY = "D";
3583 
3585  const DT_HOUR = "H";
3586 
3588  const DT_MINUTE = "m";
3589 
3591  const DT_SECOND = "S";
3592 
3593  // let's simulate and enum here'
3594  const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
3596 
3602  const DefaultUopMap = ...;
3603 
3605 
3628 
3636  hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
3637 
3638 
3640 
3650  hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
3651 
3652 
3654 
3664  hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
3665 
3666 
3668 
3677  hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
3678 
3679 
3681 
3690  hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
3691 
3692 
3694 
3705  hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
3706 
3707 
3709 
3719  hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
3720 
3721 
3723 
3733  hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
3734 
3735 
3737 
3747  hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
3748 
3749 
3751 
3761  hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
3762 
3763 
3765 
3774  hash<UpdateOperatorInfo> uop_seq(string seq);
3775 
3776 
3778 
3787  hash<UpdateOperatorInfo> uop_seq_currval(string seq);
3788 
3790 
3798 
3800  const JOP_INNER = "inner";
3801 
3803 
3805  const JOP_LEFT = "left";
3806 
3808 
3810  const JOP_RIGHT = "right";
3811 
3813  const JopMap = {
3814  JOP_INNER: "inner",
3815  JOP_LEFT: "left outer",
3816  JOP_RIGHT: "right outer",
3817  };
3819 
3830 
3833  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3834 
3835 
3837 
3841  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3842 
3843 
3845 
3864  hash<string, hash<JoinOperatorInfo>> join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3865 
3866 
3868 
3887  hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3888 
3889 
3891 
3910  hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3911 
3912 
3914 
3936  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3937 
3938 
3940 
3960  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3961 
3962 
3964 
3986  hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3987 
3988 
3990 
4009  hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4010 
4011 
4013 
4032  hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4033 
4034 
4036 
4057  hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4058 
4059 
4061 
4081  hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4082 
4083 
4085 
4105  hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4106 
4107 
4109 
4131  hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4132 
4133 
4135 
4154  hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4155 
4156 
4158 
4177  hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4178 
4179 
4181 
4202  hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4203 
4204 
4206 
4226  hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4227 
4228 
4230 
4250  hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4251 
4252 
4254 
4276  hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4277 
4279 
4285 
4287  const OP_LIKE = "like";
4288 
4290 
4292  const OP_LT = "<";
4293 
4295 
4297  const OP_LE = "<=";
4298 
4300 
4302  const OP_GT = ">";
4303 
4305 
4307  const OP_GE = ">=";
4308 
4310 
4312  const OP_NE = "!=";
4313 
4315 
4317  const OP_EQ = "=";
4318 
4320 
4322  const OP_CLT = "C<";
4323 
4325 
4327  const OP_CLE = "C<=";
4328 
4330 
4332  const OP_CGT = "C>";
4333 
4335 
4337  const OP_CGE = "C>=";
4338 
4340 
4342  const OP_CNE = "C!=";
4343 
4345 
4347  const OP_CEQ = "C=";
4348 
4350 
4352  const OP_BETWEEN = "between";
4353 
4355 
4357  const OP_IN = "in";
4358 
4360 
4362  const OP_NOT = "not";
4363 
4365 
4367  const OP_SUBSTR = "substr";
4368 
4370 
4372  const OP_OR = "or";
4373 
4375 
4377  const OP_IN_SELECT = "in_select";
4378 
4381  // first the "AND" and "OR" "operators"
4382  DP_OP_AND: {
4383  "exp": AbstractDataProvider::GenericExpressions{DP_OP_AND},
4384  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4385  return "("
4386  + (foldl $1 + " and " + $2,
4387  (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap."bool"), args))
4388  + ")";
4389  },
4390  },
4391  DP_OP_OR: {
4392  "exp": AbstractDataProvider::GenericExpressions{DP_OP_OR},
4393  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4394  return "("
4395  + (foldl $1 + " or " + $2,
4396  (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap."bool"), args))
4397  + ")";
4398  },
4399  },
4400  OP_LIKE: {
4401  "exp": <DataProviderExpressionInfo>{
4402  "type": DET_Operator,
4403  "label": "like",
4404  "name": "like",
4405  "desc": "The value to bind as the 'like' value (ex: '%some string%')",
4406  "symbol": "like",
4407  "args": (
4408  DataProviderSignatureStringType,
4409  DataProviderSignatureStringValueType,
4410  ),
4411  "return_type": AbstractDataProviderTypeMap."bool",
4412  },
4413  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4414  return sprintf("%s like %s",
4415  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."string"),
4416  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."string"));
4417  },
4418  },
4419  OP_LT: {
4420  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LT},
4421  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4422  return sprintf("%s < %s",
4423  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4424  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4425  },
4426  },
4427  OP_LE: {
4428  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LE},
4429  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4430  return sprintf("%s <= %s",
4431  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4432  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4433  },
4434  },
4435  OP_GT: {
4436  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GT},
4437  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4438  return sprintf("%s > %s",
4439  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4440  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4441  },
4442  },
4443  OP_GE: {
4444  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GE},
4445  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4446  return sprintf("%s >= %s",
4447  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4448  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4449  },
4450  },
4451  OP_NE: {
4452  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NE},
4453  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4454  bool null0 = (args[0] === NULL || !exists args[0]);
4455  bool null1 = (args[1] === NULL || !exists args[1]);
4456  if (null0 && null1) {
4457  return "1 = 0";
4458  }
4459  if (null0) {
4460  return sprintf("%s is not null",
4461  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4462  }
4463  if (null1) {
4464  return sprintf("%s is not null",
4465  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"));
4466  }
4467  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4468  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4469  return sprintf("%s != %s", exp0, exp1);
4470  },
4471  },
4472  OP_EQ: {
4473  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_EQ},
4474  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4475  bool null0 = (args[0] === NULL || !exists args[0]);
4476  bool null1 = (args[1] === NULL || !exists args[1]);
4477  if (null0 && null1) {
4478  return "1 = 1";
4479  }
4480  if (null0) {
4481  return sprintf("%s is null",
4482  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4483  }
4484  if (null1) {
4485  return sprintf("%s is null",
4486  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"));
4487  }
4488  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4489  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4490  return sprintf("%s = %s", exp0, exp1);
4491  },
4492  },
4493  OP_BETWEEN: {
4494  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_BETWEEN},
4495  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4496  return sprintf("%s between %s and %s",
4497  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4498  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"),
4499  info.table.getExpressionArg(\info, role, args[2], AbstractDataProviderTypeMap."any"));
4500  },
4501  },
4502  OP_IN: {
4503  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_IN},
4504  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4505  string exp0 = info.table.getExpressionArg(\info, role, shift args, AbstractDataProviderTypeMap."any");
4506  *string ins = (foldl $1 + "," + $2, (map info.table.getExpressionArg(\info, role, $1,
4507  AbstractDataProviderTypeMap."any"), args));
4508  return exists ins ? sprintf("%s in (%s)", exp0, ins) : "1 != 1";
4509  },
4510  },
4511  OP_NOT: {
4512  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NOT},
4513  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4514  return sprintf("not (%s)", info.table.getExpressionArg(\info, role, args[0],
4515  AbstractDataProviderTypeMap."bool"));
4516  },
4517  },
4518  OP_SUBSTR: {
4519  "exp": <DataProviderExpressionInfo>{
4520  "type": DET_Operator,
4521  "label": "substr",
4522  "name": "substr",
4523  "desc": "returns a substring from a string; args: string, int start char, [int length]",
4524  "symbol": "substr",
4525  "args": (
4526  DataProviderSignatureStringType,
4527  DataProviderSignatureIntValueType,
4528  DataProviderSignatureOptionalIntValueType,
4529  ),
4530  "return_type": AbstractDataProviderTypeMap."string",
4531  },
4532  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4533  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."string");
4534  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."int");
4535  if (!exists args[2]) {
4536  return sprintf("substring(%s from %s)", exp0, exp1);
4537  }
4538  return sprintf("substring(%s from %s for %s)", exp0, exp1,
4539  info.table.getExpressionArg(\info, role, args[2], AbstractDataProviderTypeMap."int"));
4540  },
4541  },
4542  OP_IN_SELECT: {
4543  "exp": <DataProviderExpressionInfo>{
4544  "type": DET_Operator,
4545  "label": "in_select",
4546  "name": "in_select",
4547  "desc": "check if a value is in a sub-select; args: value, table name for the subselect, subselect "
4548  "query hash",
4549  "symbol": "in_select",
4550  "args": (
4551  DataProviderSignatureAnyType, # any value, expression, or field reference
4552  DataProviderSignatureStringValueType, # table name
4553  DataProviderSignatureHashValueType, # query hash
4554  ),
4555  "return_type": AbstractDataProviderTypeMap."bool",
4556  },
4557  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4558  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4559  object subtable = info.table.getSubtableFromString(args[1], info.query_options);
4560  list<auto> subargs;
4561  string subsql = subtable.getSelectSql(args[2], \subargs);
4562  args += subargs;
4563  return sprintf("%s in (%s)", exp0, subsql);
4564  },
4565  },
4566  COP_AS: {
4567  "exp": <DataProviderExpressionInfo>{
4568  "type": DET_Operator,
4569  "label": "as",
4570  "name": "as",
4571  "desc": "aliases a result; args: expression or value, string label",
4572  "symbol": "as",
4573  "role": ER_Field,
4574  "args": (
4575  DataProviderSignatureAnyType,
4576  DataProviderSignatureStringValueType,
4577  ),
4578  "return_type": AbstractDataProviderTypeMap."any",
4579  },
4580  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4581  string exp = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4582  string arg = args[1];
4583  info.pseudo_column_map{arg} = exp;
4584  return sprintf("%s as %s", exp, info.table.getColumnSqlName(arg));
4585  },
4586  },
4587  COP_PREPEND: {
4588  "exp": <DataProviderExpressionInfo>{
4589  "type": DET_Operator,
4590  "label": COP_PREPEND,
4591  "name": COP_PREPEND,
4592  "desc": "prepends a string to another string; args: string to be prepended, string to prepend to the "
4593  "first string",
4594  "symbol": COP_PREPEND,
4595  "args": (
4596  DataProviderSignatureStringType,
4597  DataProviderSignatureStringType,
4598  ),
4599  "return_type": AbstractDataProviderTypeMap."string",
4600  },
4601  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4602  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."string");
4603  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."string");
4604  return sprintf("%s || %s", exp1, exp0);
4605  },
4606  },
4607  COP_APPEND: {
4608  "exp": <DataProviderExpressionInfo>{
4609  "type": DET_Operator,
4610  "label": COP_APPEND,
4611  "name": COP_APPEND,
4612  "desc": "appends or catenates a string to another string; args: string to be appended, string to "
4613  "append or concatenate to the first string",
4614  "symbol": COP_APPEND,
4615  "args": (
4616  DataProviderSignatureStringType,
4617  DataProviderSignatureStringType,
4618  ),
4619  "return_type": AbstractDataProviderTypeMap."string",
4620  },
4621  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4622  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."string");
4623  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."string");
4624  return sprintf("%s || %s", exp0, exp1);
4625  },
4626  },
4627  COP_UPPER: {
4628  "exp": <DataProviderExpressionInfo>{
4629  "type": DET_Operator,
4630  "label": COP_UPPER,
4631  "name": COP_UPPER,
4632  "desc": "converts a string to all upper case; arg: string",
4633  "symbol": COP_UPPER,
4634  "args": (
4635  DataProviderSignatureStringType,
4636  ),
4637  "return_type": AbstractDataProviderTypeMap."string",
4638  },
4639  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4640  return sprintf("upper(%s)", info.table.getExpressionArg(\info, role, args[0],
4641  AbstractDataProviderTypeMap."string"));
4642  },
4643  },
4644  COP_LOWER: {
4645  "exp": <DataProviderExpressionInfo>{
4646  "type": DET_Operator,
4647  "label": COP_LOWER,
4648  "name": COP_LOWER,
4649  "desc": "converts a string to all lower case; arg: string",
4650  "symbol": COP_LOWER,
4651  "args": (
4652  DataProviderSignatureStringType,
4653  ),
4654  "return_type": AbstractDataProviderTypeMap."string",
4655  },
4656  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4657  return sprintf("lower(%s)", info.table.getExpressionArg(\info, role, args[0],
4658  AbstractDataProviderTypeMap."string"));
4659  },
4660  },
4661  COP_DISTINCT: {
4662  "exp": <DataProviderExpressionInfo>{
4663  "type": DET_Operator,
4664  "label": COP_DISTINCT,
4665  "name": COP_DISTINCT,
4666  "desc": "indicates that only records with distinct values of the given field should be returned",
4667  "symbol": COP_DISTINCT,
4668  "role": ER_Field,
4669  "args": (
4670  DataProviderSignatureAnyType,
4671  ),
4672  "return_type": AbstractDataProviderTypeMap."any",
4673  },
4674  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4675  return sprintf("distinct %s", info.table.getExpressionArg(\info, role, args[0],
4676  AbstractDataProviderTypeMap."any"));
4677  },
4678  },
4679  COP_MIN: {
4680  "exp": <DataProviderExpressionInfo>{
4681  "type": DET_Operator,
4682  "label": COP_MIN,
4683  "name": COP_MIN,
4684  "desc": "Returns the minimum value in the group",
4685  "symbol": COP_MIN,
4686  "role": ER_Field,
4687  "args": (
4688  DataProviderSignatureAnyType,
4689  ),
4690  "return_type": AbstractDataProviderTypeMap."any",
4691  },
4692  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4693  return sprintf("min(%s)", info.table.getExpressionArg(\info, role, args[0],
4694  AbstractDataProviderTypeMap."any"));
4695  },
4696  "group": True,
4697  },
4698  COP_MAX: {
4699  "exp": <DataProviderExpressionInfo>{
4700  "type": DET_Operator,
4701  "label": COP_MAX,
4702  "name": COP_MAX,
4703  "desc": "Returns the maximum value in the group",
4704  "symbol": COP_MAX,
4705  "role": ER_Field,
4706  "args": (
4707  DataProviderSignatureAnyType,
4708  ),
4709  "return_type": AbstractDataProviderTypeMap."any",
4710  },
4711  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4712  return sprintf("max(%s)", info.table.getExpressionArg(\info, role, args[0],
4713  AbstractDataProviderTypeMap."any"));
4714  },
4715  "group": True,
4716  },
4717  COP_AVG: {
4718  "exp": <DataProviderExpressionInfo>{
4719  "type": DET_Operator,
4720  "label": COP_AVG,
4721  "name": COP_AVG,
4722  "desc": "Returns the average of the given values in the group",
4723  "symbol": COP_AVG,
4724  "role": ER_Field,
4725  "args": (
4726  DataProviderSignatureAnyType,
4727  ),
4728  "return_type": AbstractDataProviderTypeMap."any",
4729  },
4730  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4731  return sprintf("avg(%s)", info.table.getExpressionArg(\info, role, args[0],
4732  AbstractDataProviderTypeMap."any"));
4733  },
4734  "group": True,
4735  },
4736  COP_SUM: {
4737  "exp": <DataProviderExpressionInfo>{
4738  "type": DET_Operator,
4739  "label": COP_SUM,
4740  "name": COP_SUM,
4741  "desc": "Returns the sum of the given values",
4742  "symbol": COP_SUM,
4743  "role": ER_Field,
4744  "args": (
4745  DataProviderSignatureAnyType,
4746  ),
4747  "return_type": AbstractDataProviderTypeMap."any",
4748  },
4749  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4750  return sprintf("sum(%s)", info.table.getExpressionArg(\info, role, args[0],
4751  AbstractDataProviderTypeMap."any"));
4752  },
4753  "group": True,
4754  },
4755  COP_COUNT: {
4756  "exp": <DataProviderExpressionInfo>{
4757  "type": DET_Operator,
4758  "label": COP_COUNT,
4759  "name": COP_COUNT,
4760  "desc": "Count the number of rows in the group",
4761  "symbol": COP_COUNT,
4762  "role": ER_Field,
4763  "args": (
4764  DataProviderSignatureAnyType,
4765  ),
4766  "return_type": AbstractDataProviderTypeMap."int",
4767  },
4768  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4769  if (exists args[0] && args[0] != NULL) {
4770  return sprintf("count(%s)", info.table.getExpressionArg(\info, role, args[0],
4771  AbstractDataProviderTypeMap."any"));
4772  }
4773  return "count(1)";
4774  },
4775  },
4776  COP_MINUS: {
4777  "exp": <DataProviderExpressionInfo>{
4778  "type": DET_Operator,
4779  "label": COP_MINUS,
4780  "name": COP_MINUS,
4781  "desc": "Subtracts one number from another",
4782  "symbol": COP_MINUS,
4783  "args": (
4784  DataProviderSignatureAnyType,
4785  DataProviderSignatureAnyType,
4786  ),
4787  "return_type": AbstractDataProviderTypeMap."any",
4788  },
4789  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4790  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4791  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4792  return sprintf("%s - %s", exp0, exp1);
4793  },
4794  },
4795  COP_PLUS: {
4796  "exp": <DataProviderExpressionInfo>{
4797  "type": DET_Operator,
4798  "label": COP_PLUS,
4799  "name": COP_PLUS,
4800  "desc": "Adds two numbers",
4801  "symbol": COP_PLUS,
4802  "args": (
4803  DataProviderSignatureAnyType,
4804  DataProviderSignatureAnyType,
4805  ),
4806  "return_type": AbstractDataProviderTypeMap."any",
4807  },
4808  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4809  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4810  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4811  return sprintf("%s + %s", exp0, exp1);
4812  },
4813  },
4814  COP_DIVIDE: {
4815  "exp": <DataProviderExpressionInfo>{
4816  "type": DET_Operator,
4817  "label": COP_DIVIDE,
4818  "name": COP_DIVIDE,
4819  "desc": "Divides one number by another",
4820  "symbol": COP_DIVIDE,
4821  "args": (
4822  DataProviderSignatureAnyType,
4823  DataProviderSignatureAnyType,
4824  ),
4825  "return_type": AbstractDataProviderTypeMap."any",
4826  },
4827  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4828  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4829  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4830  return sprintf("%s / %s", exp0, exp1);
4831  },
4832  },
4833  COP_MULTIPLY: {
4834  "exp": <DataProviderExpressionInfo>{
4835  "type": DET_Operator,
4836  "label": COP_MULTIPLY,
4837  "name": COP_MULTIPLY,
4838  "desc": "Multiplies two numbers",
4839  "symbol": COP_MULTIPLY,
4840  "args": (
4841  DataProviderSignatureAnyType,
4842  DataProviderSignatureAnyType,
4843  ),
4844  "return_type": AbstractDataProviderTypeMap."any",
4845  },
4846  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4847  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4848  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4849  return sprintf("%s * %s", exp0, exp1);
4850  },
4851  },
4852  COP_COALESCE: {
4853  "exp": <DataProviderExpressionInfo>{
4854  "type": DET_Operator,
4855  "label": COP_COALESCE,
4856  "name": COP_COALESCE,
4857  "desc": "Returns the value of the first expression with a value",
4858  "symbol": COP_COALESCE,
4859  "args": (
4860  DataProviderSignatureAnyType,
4861  ),
4862  "varargs": True,
4863  "return_type": AbstractDataProviderTypeMap."any",
4864  },
4865  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4866  return sprintf("coalesce(%s)", (foldl $1 + "," + $2,
4867  (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap."any"), args)));
4868  }
4869  },
4870  COP_LENGTH: {
4871  "exp": <DataProviderExpressionInfo>{
4872  "type": DET_Operator,
4873  "label": COP_LENGTH,
4874  "name": COP_LENGTH,
4875  "desc": "Returns the length of the argument",
4876  "symbol": COP_LENGTH,
4877  "args": (
4878  DataProviderSignatureAnyType,
4879  ),
4880  "return_type": AbstractDataProviderTypeMap."int",
4881  },
4882  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4883  return sprintf("length(%s)", info.table.getExpressionArg(\info, role, args[0],
4884  AbstractDataProviderTypeMap."any"));
4885  },
4886  },
4887  COP_SEQ: {
4888  "exp": <DataProviderExpressionInfo>{
4889  "type": DET_Operator,
4890  "label": COP_SEQ,
4891  "name": COP_SEQ,
4892  "desc": "returns the next value in the given sequence; args: sequence name",
4893  "symbol": COP_SEQ,
4894  "args": (
4895  DataProviderSignatureStringValueType,
4896  ),
4897  "return_type": AbstractDataProviderTypeMap."int",
4898  },
4899  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4900  throw "SEQUENCE-ERROR", sprintf("cannot select sequence %y because this database does not support "
4901  "sequences", args[0]);
4902  }
4903  },
4904  COP_SEQ_CURRVAL: {
4905  "exp": <DataProviderExpressionInfo>{
4906  "type": DET_Operator,
4907  "label": COP_SEQ_CURRVAL,
4908  "name": COP_SEQ_CURRVAL,
4909  "desc": "returns the current value in the given sequence; args: sequence name",
4910  "symbol": COP_SEQ_CURRVAL,
4911  "args": (
4912  DataProviderSignatureStringValueType,
4913  ),
4914  "return_type": AbstractDataProviderTypeMap."int",
4915  },
4916  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4917  throw "SEQUENCE-ERROR", sprintf("cannot select the current value of sequence %y because this "
4918  "database does not support sequences", args[0]);
4919  }
4920  },
4921  COP_OVER: {
4922  "exp": <DataProviderExpressionInfo>{
4923  "type": DET_Operator,
4924  "label": COP_OVER,
4925  "name": COP_OVER,
4926  "desc": "returns the output of the SQL window given by the arguments; args: *string partiion by, "
4927  "*string order by",
4928  "symbol": COP_OVER,
4929  "args": (
4930  DataProviderSignatureFieldType,
4931  DataProviderSignatureOptionalStringValueType,
4932  DataProviderSignatureOptionalStringValueType,
4933  ),
4934  "role": ER_Field,
4935  "return_type": AbstractDataProviderTypeMap."any",
4936  },
4937  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4938  string column_name = args[0];
4939  *string partitionby = args[1];
4940  *string orderby = args[2];
4941  if (!exists partitionby && exists orderby) {
4942  throw "OVER-ERROR", "Argument 2 (partition by) must be given in case of usage of argument 3 "
4943  "(order by)";
4944  }
4945  string sql = column_name + " over (";
4946  Columns cols;
4947  if (exists partitionby) {
4948  if (!info.pseudo_column_map{partitionby}) {
4949  cols = info.table.describe();
4950  if (!exists cols{partitionby}) {
4951  throw "OVER-ERROR", sprintf("Argument 2 (partition by) %y is not an alias or an "
4952  "accessible column", partitionby);
4953  }
4954  }
4955  sql += sprintf("partition by %s", partitionby);
4956  }
4957  if (exists orderby) {
4958  if (!info.pseudo_column_map{orderby}) {
4959  if (!cols) {
4960  cols = info.table.describe();
4961  if (!exists cols{orderby}) {
4962  throw "OVER-ERROR", sprintf("Argument 3 (order by) %y is not an alias or an "
4963  "accessible column", orderby);
4964  }
4965  }
4966  }
4967  sql += sprintf(" order by %s", orderby);
4968  }
4969  sql += ")";
4970  return sql;
4971  }
4972  },
4973  COP_DENSE_RANK: (
4974  "exp": <DataProviderExpressionInfo>{
4975  "type": DET_Operator,
4976  "label": COP_DENSE_RANK,
4977  "name": COP_DENSE_RANK,
4978  "desc": "Returns the rank of a row in an ordered group of rows as a number",
4979  "symbol": COP_DENSE_RANK,
4980  "args": (),
4981  "role": ER_Field,
4982  "return_type": AbstractDataProviderTypeMap."any",
4983  },
4984  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4985  return "dense_rank()";
4986  },
4987  ),
4988  COP_FIRST_VALUE: (
4989  "exp": <DataProviderExpressionInfo>{
4990  "type": DET_Operator,
4991  "label": COP_FIRST_VALUE,
4992  "name": COP_FIRST_VALUE,
4993  "desc": "Returns the first value in an ordered group of rows",
4994  "symbol": COP_FIRST_VALUE,
4995  "args": (
4996  DataProviderSignatureFieldType,
4997  ),
4998  "role": ER_Field,
4999  "return_type": AbstractDataProviderTypeMap."any",
5000  },
5001  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5002  return sprintf("first_value(%s)", args[0]);
5003  },
5004  ),
5005  COP_LAST_VALUE: (
5006  "exp": <DataProviderExpressionInfo>{
5007  "type": DET_Operator,
5008  "label": COP_LAST_VALUE,
5009  "name": COP_LAST_VALUE,
5010  "desc": "Returns the last value in an ordered group of rows",
5011  "symbol": COP_LAST_VALUE,
5012  "args": (
5013  DataProviderSignatureFieldType,
5014  ),
5015  "role": ER_Field,
5016  "return_type": AbstractDataProviderTypeMap."any",
5017  },
5018  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5019  return sprintf("last_value(%s)", args[0]);
5020  },
5021  ),
5022  COP_NTILE: (
5023  "exp": <DataProviderExpressionInfo>{
5024  "type": DET_Operator,
5025  "label": COP_NTILE,
5026  "name": COP_NTILE,
5027  "desc": "Returns the group number of an ordered group of rows",
5028  "symbol": COP_NTILE,
5029  "args": (
5030  DataProviderSignatureIntValueType,
5031  ),
5032  "role": ER_Field,
5033  "return_type": AbstractDataProviderTypeMap."int",
5034  },
5035  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5036  return sprintf("ntile(%d)", args[0]);
5037  },
5038  ),
5039  COP_PERCENT_RANK: (
5040  "exp": <DataProviderExpressionInfo>{
5041  "type": DET_Operator,
5042  "label": COP_PERCENT_RANK,
5043  "name": COP_PERCENT_RANK,
5044  "desc": "Returns the percent rank of a row in an ordered group of rows",
5045  "symbol": COP_PERCENT_RANK,
5046  "args": (),
5047  "role": ER_Field,
5048  "return_type": AbstractDataProviderTypeMap."int",
5049  },
5050  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5051  return "percent_rank()";
5052  },
5053  ),
5054  COP_RANK: (
5055  "exp": <DataProviderExpressionInfo>{
5056  "type": DET_Operator,
5057  "label": COP_PERCENT_RANK,
5058  "name": COP_PERCENT_RANK,
5059  "desc": "Returns the row number of a row in an ordered group of rows",
5060  "symbol": COP_PERCENT_RANK,
5061  "args": (),
5062  "role": ER_Field,
5063  "return_type": AbstractDataProviderTypeMap."int",
5064  },
5065  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5066  return "rank()";
5067  },
5068  ),
5069  COP_ROW_NUMBER: (
5070  "exp": <DataProviderExpressionInfo>{
5071  "type": DET_Operator,
5072  "label": COP_ROW_NUMBER,
5073  "name": COP_ROW_NUMBER,
5074  "desc": "Returns the row number of a result set",
5075  "symbol": COP_ROW_NUMBER,
5076  "args": (),
5077  "role": ER_Field,
5078  "return_type": AbstractDataProviderTypeMap."int",
5079  },
5080  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5081  return "row_number()";
5082  },
5083  ),
5084  };
5085 
5087  const DefaultOpMap = {
5088  OP_LIKE: {
5089  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5090  info.args += arg;
5091  return sprintf("%s like %v", cn);
5092  },
5093  "name": "like",
5094  "args": (DataProviderSignatureStringType, DataProviderSignatureStringValueType),
5095  "return_type": AbstractDataProviderTypeMap."bool",
5096  "desc": "The value to bind as the 'like' value (ex: '%some string%')",
5097  },
5098  OP_LT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LT} + (
5099  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5100  info.args += arg;
5101  return sprintf("%s < %v", cn);
5102  },
5103  ),
5104  OP_LE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LE} + (
5105  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5106  info.args += arg;
5107  return sprintf("%s <= %v", cn);
5108  },
5109  ),
5110  OP_GT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GT} + (
5111  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5112  info.args += arg;
5113  return sprintf("%s > %v", cn);
5114  },
5115  ),
5116  OP_GE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GE} + (
5117  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5118  info.args += arg;
5119  return sprintf("%s >= %v", cn);
5120  },
5121  ),
5122  OP_NE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NE} + (
5123  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5124  if (arg === NULL || !exists arg)
5125  return sprintf("%s is not null", cn);
5126  info.args += arg;
5127  return sprintf("(%s != %v or %s is null)", cn, cn);
5128  },
5129  ),
5130  OP_EQ: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_EQ} + (
5131  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5132  if (arg === NULL || !exists arg)
5133  return sprintf("%s is null", cn);
5134  info.args += arg;
5135  return sprintf("%s = %v", cn);
5136  },
5137  ),
5138  OP_BETWEEN: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_BETWEEN} + (
5139  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5140  info.args += arg[0];
5141  info.args += arg[1];
5142  return sprintf("%s between %v and %v", cn);
5143  },
5144  ),
5145  OP_IN: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_IN} + (
5146  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5147  *string ins = (foldl $1 + "," + $2, (map info.table.getSqlValue($1), arg));
5148  return exists ins ? sprintf("%s in (%s)", cn, ins) : "1 != 1";
5149  },
5150  ),
5151  OP_IN_SELECT: {
5152  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg,
5153  *hash<auto> opt) {
5154  object subtable;
5155  if (arg.table.typeCode() == NT_STRING) {
5156  subtable = info.table.getSubtableFromString(arg.table, opt);
5157  } else {
5158  subtable = arg.table;
5159  }
5160 
5161  list<auto> subargs;
5162  string subsql = subtable.getSelectSql(arg.select_hash, \subargs);
5163  info.args += subargs;
5164  return sprintf("%s in (%s)", cn, subsql);
5165  },
5166  "withopt": True,
5167  },
5168  OP_NOT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NOT} + (
5169  "recursive": True,
5170  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5171  return sprintf("not (%s)", cn);
5172  },
5173  ),
5174  OP_CLT: (
5175  "argcolumn": True,
5176  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5177  return sprintf("%s < %s", cn, arg);
5178  },
5179  "name": "column <",
5180  "type": AbstractDataProviderType::get(StringType),
5181  "desc": "a column name for less than comparisons; if the field value is less than the column argument's "
5182  "value, then the operation returns true; the other column must have a compatible type",
5183  ),
5184  OP_CLE: (
5185  "argcolumn": True,
5186  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5187  return sprintf("%s <= %s", cn, arg);
5188  },
5189  "name": "column <=",
5190  "type": AbstractDataProviderType::get(StringType),
5191  "desc": "a column name for less than or equals comparisons; if the field value is less than or equal to "
5192  "the column argument's, then the operation returns true; the other column must have a compatible type",
5193  ),
5194  OP_CGT: (
5195  "argcolumn": True,
5196  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5197  return sprintf("%s > %s", cn, arg);
5198  },
5199  "name": "column >",
5200  "type": AbstractDataProviderType::get(StringType),
5201  "desc": "a column name for less than comparisons; if the field value is less than the column argument's, "
5202  "then the operation returns true; the other column must have a compatible type",
5203  ),
5204  OP_CGE: (
5205  "argcolumn": True,
5206  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5207  return sprintf("%s >= %s", cn, arg);
5208  },
5209  "name": "column >=",
5210  "type": AbstractDataProviderType::get(StringType),
5211  "desc": "a column name for greater than or equals comparisons; if the field value is greater than or "
5212  "equal to the column argument's, then the operation returns true; the other column must have a "
5213  "compatible type",
5214  ),
5215  OP_CNE: (
5216  "argcolumn": True,
5217  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5218  return sprintf("%s != %s", cn, arg);
5219  },
5220  "name": "column !=",
5221  "type": AbstractDataProviderType::get(StringType),
5222  "desc": "a column name for not=equals comparisons; the other column must have a compatible type",
5223  ),
5224  OP_CEQ: (
5225  "argcolumn": True,
5226  "code": string sub (reference<hash<QueryInfo>> info, string cn, string arg) {
5227  return sprintf("%s = %s", cn, arg);
5228  },
5229  "name": "column =",
5230  "type": AbstractDataProviderType::get(StringType),
5231  "desc": "a value for equality comparisons; the other column must have a compatible type",
5232  ),
5233  OP_SUBSTR: (
5234  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5235  info.args += arg[0]; // start
5236  if (!exists arg[1]) {
5237  info.args += arg[2]; # text
5238  return sprintf("substring(%s from %v) = %v", cn);
5239  }
5240  info.args += arg[1]; # count
5241  info.args += arg[2]; # text
5242  return sprintf("substring(%s from %v for %v) = %v", cn);
5243  },
5244  ),
5245  OP_OR: (
5246  "code": string sub (reference<hash<QueryInfo>> info, string cn, list<auto> arg) {
5247  return info.table.getOrClause(\info, arg);
5248  },
5249  ),
5250  };
5252 
5277  hash<OperatorInfo> make_op(string op, auto arg);
5278 
5279 
5281 
5290  hash<OperatorInfo> op_like(string str);
5291 
5292 
5294 
5305  hash<OperatorInfo> op_lt(auto arg);
5306 
5307 
5309 
5320  hash<OperatorInfo> op_le(auto arg);
5321 
5322 
5324 
5335  hash<OperatorInfo> op_gt(auto arg);
5336 
5337 
5339 
5350  hash<OperatorInfo> op_ge(auto arg);
5351 
5352 
5354 
5367  hash<OperatorInfo> op_ne(auto arg);
5368 
5369 
5371 
5384  hash<OperatorInfo> op_eq(auto arg);
5385 
5386 
5388 
5400  hash<OperatorInfo> op_between(auto l, auto r);
5401 
5402 
5404 
5413  hash<OperatorInfo> op_in();
5414 
5415 
5417 
5424  hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
5425 
5426 
5428 
5435  hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
5436 
5437 
5439 
5446  hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
5447 
5448 
5450 
5461  hash<OperatorInfo> op_in(list<auto> args);
5462 
5463 
5465 
5472  hash<OperatorInfo> op_not(hash arg);
5473 
5474 
5476 
5487  hash<OperatorInfo> op_clt(string arg);
5488 
5489 
5491 
5502  hash<OperatorInfo> op_cle(string arg);
5503 
5504 
5506 
5517  hash<OperatorInfo> op_cgt(string arg);
5518 
5519 
5521 
5532  hash<OperatorInfo> op_cge(string arg);
5533 
5534 
5536 
5547  hash<OperatorInfo> op_cne(string arg);
5548 
5549 
5551 
5562  hash<OperatorInfo> op_ceq(string arg);
5563 
5564 
5566 
5577  hash<OperatorInfo> op_substr(int start, *int count, string text);
5578 
5579 
5581 
5591  hash<OperatorInfo> op_substr(int start, string text);
5592 
5593 
5595 
5612  hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
5613 
5615 
5623 
5625  const IOP_SEQ = "seq";
5626 
5628 
5630  const IOP_SEQ_CURRVAL = "seq_currval";
5631 
5633  const DefaultIopMap = {};
5635 
5642 
5649  hash<InsertOperatorInfo> make_iop(string iop, auto arg);
5650 
5651 
5653 
5662  hash<InsertOperatorInfo> iop_seq(string arg);
5663 
5664 
5666 
5675  hash<InsertOperatorInfo> iop_seq_currval(string arg);
5676 
5678 
5680  const SqlUtilDrivers = ...;
5681 
5682 
5683  // private variable to store the closure used to deserialize datasources (if any)
5684  extern code ds_get;
5685 
5686  // private variable to store the closure used to serialize datasources (if any)
5687  extern code ds_do;
5688 
5691 
5692 
5695 
5696 
5697  // private function used to deserialize datasources
5698  AbstractDatasource sqlutil_get_ds(string type, string config);
5699 
5700 
5701  // private function used to serialize datasources
5702  hash<auto> sqlutil_ds(AbstractDatasource ds);
5703 
5704 
5706 class AbstractHashContainer : public Serializable {
5707 
5708 public:
5709 
5710 
5711 protected:
5714 
5715 public:
5716 
5719 
5720 
5723 
5724 
5727 
5728 
5730 
5745  auto memberGate(string k);
5746 
5747 
5749 
5756 
5757 
5759  abstract auto take(string k);
5760 
5762  renameKey(string old_name, string new_name);
5763 
5764 
5766  *hash<auto> getHash();
5767 
5768 
5770 
5779  bool matchKeys(hash h1);
5780 
5781 
5783 
5792  bool matchKeys(list<auto> l);
5793 
5794 
5796 
5806 
5807 
5809 
5819 
5820 
5822 
5831  bool partialMatchKeys(list<auto> l);
5832 
5833 
5835 
5845 
5846 
5848 
5857  bool val();
5858 
5859 
5861 
5868  list<string> keys();
5869 
5870 
5872 
5879  list<auto> values();
5880 
5881 
5883 
5891 
5892 
5894 
5902 
5903 
5905 
5913 
5914 
5916  bool empty();
5917 
5918 
5920 
5927  int size();
5928 
5929 
5931 
5940  bool hasKey(string k);
5941 
5942 
5944 
5953  bool hasKeyValue(string k);
5954 
5955 
5957 
5966  *string firstKey();
5967 
5968 
5970 
5979  *string lastKey();
5980 
5981 
5983  abstract string getElementName();
5984  };
5985 
5987 class AbstractListContainer : public Serializable {
5988 
5989 public:
5990 
5991 
5992 protected:
5993  softlist l;
5994 
5995 public:
5996 
5998  constructor(softlist nl);
5999 
6000 
6002 
6013  abstract auto get(softint i);
6014 
6016  add(auto val);
6017 
6018 
6020  auto take(int i);
6021 
6022 
6024  list<auto> getList();
6025 
6026 
6028 
6037  bool val();
6038 
6039 
6041 
6049 
6050 
6052  bool empty();
6053 
6054 
6056 
6063  int size();
6064 
6065 
6067  abstract string getElementName();
6068 
6069 protected:
6070  checkIndex(int i);
6071 public:
6072 
6073  };
6074 
6077 
6078 public:
6081 
6082 
6084  constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
6085 
6086 
6088  constructor(AbstractDatasource ds);
6089 
6090 
6092  add(string k, Table val);
6093 
6094 
6096  add(string k, AbstractTable val);
6097 
6098 
6101 
6102 
6105 
6106 
6108  AbstractTable take(string k);
6109 
6110 
6112  populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
6113 
6114 
6116  populate(AbstractDatasource ds);
6117 
6118 
6120 
6136  *list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
6137 
6138 
6140 
6156 
6157 
6159  string getElementName();
6160 
6161 
6163  *AbstractTable getIfExists(AbstractDatasource ds, string name);
6164 
6165 
6167  AbstractTable get(AbstractDatasource ds, string name);
6168 
6169 
6171 
6186  *string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
6187 
6188 
6190 
6201  bool tableRenamed(string old_name, string new_name, string old_sql_name);
6202 
6203 
6204 protected:
6205  tableRenamedIntern(string old_name, string new_name, string oldsn);
6206 public:
6207 
6208 
6210 
6225  *string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
6226 
6227 
6228  list<auto> getCreateList();
6229 
6230 
6231  Qore::AbstractIterator createIterator();
6232 
6233 
6235 
6243  list<auto> getDropList();
6244 
6245 
6247 
6255 
6256 
6257 protected:
6258  getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
6259 public:
6260 
6261  };
6262 
6265 
6266 public:
6269 
6270 
6273 
6274 
6276  add(string k, AbstractColumn val);
6277 
6278 
6281 
6282 
6284 
6300 
6301 
6303  Columns subset(softlist l);
6304 
6305 
6307  string getElementName();
6308 
6309 
6311  bool equal(Columns cols);
6312 
6313 
6315  AbstractIterator getSqlColumnNameIterator();
6316 
6317  };
6318 
6320 class AbstractDdlObject : public Serializable {
6321 
6322 public:
6324  string name;
6325 
6327  string ddl_name;
6328 
6330 protected:
6332 public:
6333 
6334 
6337 
6338 
6340 
6342  abstract string getDdlName(string name);
6343  };
6344 
6347 
6348 public:
6350  string native_type;
6351 
6353  *string qore_type;
6354 
6356  int size;
6357 
6359  bool nullable;
6360 
6362  *string def_val;
6363 
6365  *string comment;
6366 
6368  *int scale;
6369 
6372 
6374 protected:
6376 public:
6377 
6378 
6379  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c, *int scale)
6380  ;
6381 
6382 
6384 
6388  hash<GenericColumnInfo> getDescriptionHash();
6389 
6390 
6392 
6395 
6396 
6399 
6400 
6402 
6411  abstract list<auto> getAddColumnSql(AbstractTable t);
6412 
6414  string getDropSql(string table_name);
6415 
6416 
6418 
6431  list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
6432 
6433 
6435 
6445  abstract string getRenameSql(AbstractTable t, string new_name);
6446 
6449 
6450 
6452 protected:
6453  abstract bool equalImpl(AbstractColumn c);
6454 public:
6455 
6457 
6473 protected:
6474  abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
6475 public:
6476  };
6477 
6480 
6481 public:
6482  constructor(*hash c) ;
6483 
6484 
6486  add(string k, AbstractIndex val);
6487 
6488 
6491 
6492 
6494  AbstractIndex take(string k);
6495 
6496 
6499 
6500 
6502 
6518 
6519 
6520  string getElementName();
6521 
6522  };
6523 
6525 class AbstractIndex : public Serializable {
6526 
6527 public:
6529  string name;
6530 
6532  bool unique;
6533 
6536 
6537 protected:
6540 
6543 
6544 public:
6545 
6547  constructor(string n, bool u, hash c);
6548 
6549 
6551  string getName();
6552 
6553 
6555  bool hasColumn(string cname);
6556 
6557 
6559  abstract string getCreateSql(string table_name, *hash<auto> opt);
6560 
6562  string getDropSql(string table_name);
6563 
6564 
6567 
6568 
6571 
6572 
6574  abstract bool equalImpl(AbstractIndex ix);
6575 
6577  abstract string getRenameSql(string table_name, string new_name);
6578 
6581 
6582 
6585 
6586 
6589 
6590 
6593 
6594 
6597 
6598 
6601 
6602 
6604  *list<AbstractColumnConstraint> getAllSupportingConstraints();
6605 
6606 
6608  list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
6609 
6610  };
6611 
6614 
6615 public:
6616  constructor(*hash c) ;
6617 
6618 
6621 
6622 
6625 
6626 
6629 
6630 
6632 
6648 
6649 
6650  string getElementName();
6651 
6652  };
6653 
6655 class AbstractConstraint : public Serializable {
6656 
6657 public:
6658 
6659 
6660 protected:
6662  string name;
6663 
6664 public:
6665 
6667  constructor(string n);
6668 
6669 
6671  string getName();
6672 
6673 
6675  rename(string n);
6676 
6677 
6679  abstract string getCreateSql(string table_name, *hash<auto> opt);
6680 
6682  string getDropSql(string table_name);
6683 
6684 
6686  abstract list<auto> getRenameSql(string table_name, string new_name);
6687 
6689  string getDisableSql(string table_name);
6690 
6691 
6693  string getEnableSql(string table_name, *hash<auto> opt);
6694 
6695 
6698 
6699 
6701 protected:
6702  abstract bool equalImpl(AbstractConstraint c);
6703 public:
6704 
6706  abstract bool setIndexBase(string ix);
6707 
6709  abstract clearIndex();
6710 
6712  bool hasColumn(string cname);
6713 
6714  };
6715 
6718 
6719 public:
6721  string src;
6722 
6724  constructor(string n, string n_src) ;
6725 
6726 
6728 protected:
6730 public:
6731 
6732 
6734  bool setIndexBase(string ix);
6735 
6736 
6739 
6740  };
6741 
6744 
6745 public:
6746 protected:
6748  *string index;
6749 
6750 public:
6751 
6753  constructor(string name, *hash<auto> cols, *string index) ;
6754 
6755 
6757  constructor(string name, Columns cols, *string index) ;
6758 
6759 
6761  bool setIndexBase(string ix);
6762 
6763 
6766 
6767  };
6768 
6771 
6772 public:
6773 protected:
6775  *hash<string, hash<string, AbstractForeignConstraint>> sourceConstraints;
6776 
6777 public:
6778 
6780  constructor(string name, *hash<auto> cols, *string index) ;
6781 
6782 
6784  constructor(string name, Columns cols, *string index) ;
6785 
6786 
6788 
6793 
6794 
6796  hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
6797 
6798 
6801 
6802 
6804 
6815 
6816 
6818  removeSourceConstraint(string tname, list<auto> cols);
6819 
6820 
6822  renameSourceConstraintTable(string old_name, string new_name);
6823 
6824 
6826  bool hasColumn(string cname);
6827 
6828 
6830  *string getIndex();
6831 
6832 
6834 protected:
6836 public:
6837 
6838 
6840  abstract string getCreateSql(string table_name, *hash<auto> opts);
6841  };
6842 
6845 
6846 public:
6848  constructor(string n, *hash<auto> c, *string n_index) ;
6849 
6850  };
6851 
6854 
6855 public:
6856  constructor() ;
6857 
6858 
6859  constructor(string n, *hash<auto> c) ;
6860 
6861  };
6862 
6865 
6866 public:
6867  constructor(*hash<auto> c) ;
6868 
6869 
6872 
6873 
6876 
6877 
6880 
6881 
6883 
6899 
6900 
6902  *hash<auto> findConstraintOn(string table, softlist<auto> cols);
6903 
6904 
6906  string getElementName();
6907 
6908  };
6909 
6911 class ForeignConstraintTarget : public Serializable {
6912 
6913 public:
6915  string table;
6916 
6919 
6921  constructor(string t, Columns c);
6922 
6923 
6926 
6927  };
6928 
6931 
6932 public:
6935 
6936  constructor(string name, Columns cols, ForeignConstraintTarget t) ;
6937 
6938 
6940 protected:
6942 public:
6943 
6944  };
6945 
6947 class AbstractSequence : public Serializable {
6948 
6949 public:
6951  string name;
6952 
6955 
6958 
6961 
6963  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
6964 
6965 
6967  abstract string getCreateSql(*hash<auto> opt);
6968 
6970 
6972  string getDropSql(*hash<auto> opt);
6973 
6974 
6976 
6979  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6980  };
6981 
6983 class AbstractView : public Serializable {
6984 
6985 public:
6986  // ! potential object schema
6987  *string schema;
6988 
6990  string name;
6991 
6993  string src;
6994 
6997 
6999  constructor(string n_name, string n_src);
7000 
7001 
7003  abstract string getCreateSql(*hash<auto> opt);
7004 
7006 
7008  string getDropSql(*hash<auto> opt);
7009 
7010 
7012 
7015  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
7016  };
7017 
7019 class AbstractFunctionBase : public Serializable {
7020 
7021 public:
7023  string name;
7024 
7026  string type;
7027 
7029  string src;
7030 
7032 
7036  constructor(string n, string n_type, string n_src);
7037 
7038 
7040  string getType();
7041 
7042 
7044 
7046  string getDropSql(*hash<auto> opt);
7047 
7048 
7051 
7052 
7054  string getNormalizedSource(string src);
7055 
7056 
7058 protected:
7060 public:
7061  };
7062 
7065 
7066 public:
7068 
7072  constructor(string n, string n_type, string n_src) ;
7073 
7074 
7076  abstract list<auto> getCreateSql(*hash<auto> opt);
7077 
7079 
7082  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
7083 
7085  setName(string new_name);
7086 
7087  };
7088 
7091 
7092 public:
7093  constructor(*hash c) ;
7094 
7095 
7098 
7099 
7102 
7103 
7105 
7121 
7122 
7123  string getElementName();
7124 
7125  };
7126 
7129 
7130 public:
7132  constructor(string n, string n_src) ;
7133 
7134 
7136  abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
7137 
7139  abstract softlist<auto> getRenameSql(string table_name, string new_name);
7140 
7142  abstract list<auto> getDropSql(string table_name);
7143  };
7144 
7147 
7148 public:
7149  constructor(*hash c) ;
7150 
7151 
7154 
7155 
7158 
7159 
7161 
7177 
7178 
7179  string getElementName();
7180 
7181  };
7182 };
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:6717
string src
the source of the check clause
Definition: SqlUtil.qm.dox.h:6721
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:6743
*string index
the index supporting the constraint
Definition: SqlUtil.qm.dox.h:6748
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
the base class for column information
Definition: SqlUtil.qm.dox.h:6346
abstract list< auto > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
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
string native_type
the native type name of the column
Definition: SqlUtil.qm.dox.h:6350
*string comment
comment on the column
Definition: SqlUtil.qm.dox.h:6365
*string def_val
default value for column
Definition: SqlUtil.qm.dox.h:6362
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
hash< GenericColumnInfo > getDescriptionHash()
Returns a description hash of the column.
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 qore_type
the equivalent qore type name of the column if known
Definition: SqlUtil.qm.dox.h:6353
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:6359
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:6371
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:6356
*int scale
the scale for numeric columns
Definition: SqlUtil.qm.dox.h:6368
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:6770
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:6775
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:6655
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
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
bool hasColumn(string cname)
returns True if the constraint references the named column
rename(string n)
renames the constraint
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:6662
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:6320
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:6327
string name
the name of the object
Definition: SqlUtil.qm.dox.h:6324
constructor(string name)
creates the object from the name
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:6930
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:6934
base class for function or objects with code
Definition: SqlUtil.qm.dox.h:7019
string getNormalizedSource(string src)
returns normalized source for comparisons
string name
the name of the object
Definition: SqlUtil.qm.dox.h:7023
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:7029
string type
the type of object
Definition: SqlUtil.qm.dox.h:7026
string getType()
returns the type of object
base class for functions
Definition: SqlUtil.qm.dox.h:7064
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:5706
list< auto > values()
Returns a list of values of the contained hash.
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
list< string > keys()
Returns a list of key names of the contained hash.
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),...
*hash< auto > getHash()
returns the hash contained by this object
renameKey(string old_name, string new_name)
renames the given key; maintains the key order
*string lastKey()
Returns the last key name in the contained hash or NOTHING if the contained hash has no keys.
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:5713
abstract string getElementName()
must return the name of the contained element
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:6525
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:6542
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
*list< AbstractColumnConstraint > getAllSupportingConstraints()
returns all supporting constraints, 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:6529
*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:6532
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition: SqlUtil.qm.dox.h:6539
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
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
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,...
Columns columns
an object of class Columns representing the columns in the index
Definition: SqlUtil.qm.dox.h:6535
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:5987
bool empty()
returns True if the container is empty, False if not
list< auto > getList()
returns the list contained by this object
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:6853
base class for sequences
Definition: SqlUtil.qm.dox.h:6947
*number max
the ending number
Definition: SqlUtil.qm.dox.h:6960
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6951
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:6954
number increment
the increment
Definition: SqlUtil.qm.dox.h:6957
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:7128
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
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
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:6844
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:6983
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
bool updatable
Flag showing if is the view updatable with DML commands.
Definition: SqlUtil.qm.dox.h:6996
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6990
constructor(string n_name, string n_src)
creates the object from the arguments
string src
the source code
Definition: SqlUtil.qm.dox.h:6993
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:6264
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:6613
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
string getElementName()
must return the name of the contained element
a class describing a foreign constraint target
Definition: SqlUtil.qm.dox.h:6911
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:6918
string table
the name of the target table
Definition: SqlUtil.qm.dox.h:6915
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6864
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
*hash< auto > findConstraintOn(string table, softlist< auto > cols)
returns either a hash of AbstractColumn information or NOTHING if no foreign constraint can be found ...
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
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:7090
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
string getElementName()
must return the name of the contained element
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:6479
string getElementName()
must return the name of the contained element
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:6076
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
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
list< auto > getDropList()
returns a list of cached table names in the order that can be used to drop the tables,...
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...
*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...
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:7146
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
string getElementName()
must return the name of the contained element
const True
const False
number exp(number n)
bool exists(...)
const NULL
string sprintf(string fmt,...)
const NT_STRING
hash< auto > hash(object obj)
string type(auto arg)
number number(softnumber n)
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:26
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...
const COP_MAX
to return the maximum value
Definition: SqlUtil.qm.dox.h:2512
const DT_YEAR
Format unit: year.
Definition: SqlUtil.qm.dox.h:3576
const COP_OVER
the SQL "over" clause
Definition: SqlUtil.qm.dox.h:2532
hash< OperatorInfo > op_ge(auto arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
const COP_SEQ_CURRVAL
to return the last value of a sequence issued in the same session
Definition: SqlUtil.qm.dox.h:2582
const COP_LENGTH
to get the length of a text field
Definition: SqlUtil.qm.dox.h:2599
const COP_RANK
Analytic (window) function: RANK.
Definition: SqlUtil.qm.dox.h:2657
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition: SqlUtil.qm.dox.h:2487
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4307
const COP_COALESCE
to return the first non-null argument in the list
Definition: SqlUtil.qm.dox.h:2587
hash< ColumnOperatorInfo > cop_year_hour(auto column)
returns a ColumnOperatorInfo hash for the "year_hour" operator with the given argument
const OP_NE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4312
sqlutil_register_ds_deserializer(*code new_ds_get)
registers a closure or call reference taking a string type and string datasource configuration that w...
const CLOB
specifies a large variable-length character column (ie CLOB or TEXT, etc)
Definition: SqlUtil.qm.dox.h:2440
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_coalesce(auto col1, auto col2)
returns a ColumnOperatorInfo hash for the "coalesce" operator with the given column arguments; the fi...
hash< ColumnOperatorInfo > cop_percent_rank()
Analytic/window function: relative rank of the current row.
hash< UpdateOperatorInfo > uop_seq(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
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< ColumnOperatorInfo > cop_dense_rank()
Analytic/window function: rank of the current row without gaps.
const OP_LE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4297
const SZ_NONE
the data type does not take a size parameter
Definition: SqlUtil.qm.dox.h:2448
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4317
const COP_MIN
to return the minimum value
Definition: SqlUtil.qm.dox.h:2507
const DB_SYNONYMS
Feature: synonyms.
Definition: SqlUtil.qm.dox.h:2420
const DB_PACKAGES
Feature: packages.
Definition: SqlUtil.qm.dox.h:2408
const DefaultUopMap
a hash of valid update operators
Definition: SqlUtil.qm.dox.h:3602
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition: SqlUtil.qm.dox.h:2572
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...
sqlutil_register_ds_serializer(*code new_ds_do)
registers a closure or call reference taking a string type and string datasource configuration that w...
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...
const COP_DIVIDE
the SQL "divide" operator
Definition: SqlUtil.qm.dox.h:2547
const IOP_SEQ
for using the value of a sequence
Definition: SqlUtil.qm.dox.h:5625
hash< ColumnOperatorInfo > cop_prepend(auto column, string arg)
returns a ColumnOperatorInfo hash for the "prepend" operator with the given argument
hash< ColumnOperatorInfo > cop_ntile(int value)
Analytic/window function: integer ranging from 1 to the argument value, dividing the partition as equ...
const DT_MINUTE
Format unit: minute.
Definition: SqlUtil.qm.dox.h:3588
const VARCHAR
specifies a VARCHAR column (equivalent to Qore::Type::String)
Definition: SqlUtil.qm.dox.h:2428
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_ne(auto arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
const OP_IN
the SQL "in" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4357
const JopMap
a hash of valid join operators
Definition: SqlUtil.qm.dox.h:3813
hash< ColumnOperatorInfo > cop_avg(auto column)
returns a ColumnOperatorInfo hash for the "avg" operator; returns average column values
hash< ColumnOperatorInfo > cop_over(auto column, *string partitionby, *string orderby)
returns a ColumnOperatorInfo hash for the "over" clause
const OP_NOT
the SQL "not" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4362
hash< OperatorInfo > op_eq(auto arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
hash< ColumnOperatorInfo > cop_sum(auto column)
returns a ColumnOperatorInfo hash for the "sum" operator; returns the total sum of a numeric column.
const COP_YEAR
to return a date value with year information only
Definition: SqlUtil.qm.dox.h:2557
const DefaultExpressionMap
Default expressions to be supported by all SqlUtil modules.
Definition: SqlUtil.qm.dox.h:4380
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 DefaultOpMap
a hash of valid operators for use in Where Clauses
Definition: SqlUtil.qm.dox.h:5087
hash< UpdateOperatorInfo > uop_minus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "-" operator with the given arguments
hash< UpdateOperatorInfo > uop_plus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "+" operator with the given arguments
const SqlUtilDrivers
known drivers
Definition: SqlUtil.qm.dox.h:5680
hash< OperatorInfo > op_ceq(string arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
hash< ColumnOperatorInfo > cop_value(auto arg)
returns a ColumnOperatorInfo hash for the "value" (literal) operator with the given argument
hash< InsertOperatorInfo > iop_seq_currval(string arg)
returns an InsertOperatorInfo hash for retrieving the current value of the given sequence in insert q...
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
const DB_MVIEWS
Feature: materialized views / snapshots.
Definition: SqlUtil.qm.dox.h:2406
const COP_COUNT
to return the row count
Definition: SqlUtil.qm.dox.h:2527
hash< UpdateOperatorInfo > uop_seq_currval(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
const COP_MULTIPLY
the SQL "multiply" operator
Definition: SqlUtil.qm.dox.h:2552
hash< ColumnOperatorInfo > cop_rank()
Analytic/window function: rank of the current row with gaps.
const OP_SUBSTR
the SQL "substr" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4367
const COP_AVG
to return the average value
Definition: SqlUtil.qm.dox.h:2517
hash< ColumnOperatorInfo > cop_year_month(auto column)
returns a ColumnOperatorInfo hash for the "year_month" operator with the given argument
hash< ColumnOperatorInfo > cop_upper(auto column)
returns a ColumnOperatorInfo hash for the "upper" operator with the given argument; returns a column ...
const DT_SECOND
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3591
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4337
const COP_PLUS
the SQL "plus" operator
Definition: SqlUtil.qm.dox.h:2542
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition: SqlUtil.qm.dox.h:2615
hash< OperatorInfo > op_in()
returns an OperatorInfo hash for the "in" operator with all arguments passed to the function; for use...
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 DefaultIopMap
a hash of default insert operator descriptions (currently empty, all operators are driver-dependent)
Definition: SqlUtil.qm.dox.h:5633
hash< OperatorInfo > op_like(string str)
returns an OperatorInfo hash for the "like" operator with the given argument for use in where clauses
hash< ColumnOperatorInfo > cop_plus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "+" operator with the given arguments
const DT_MONTH
Format unit: month.
Definition: SqlUtil.qm.dox.h:3579
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition: SqlUtil.qm.dox.h:2457
const COP_SUBSTR
to extract a substring from a column
Definition: SqlUtil.qm.dox.h:2592
const COP_SEQ
to return the next value of a sequence
Definition: SqlUtil.qm.dox.h:2577
const SZ_MAND
the data type takes a mandatory size parameter
Definition: SqlUtil.qm.dox.h:2451
hash< ColumnOperatorInfo > cop_append(auto column, string arg)
returns a ColumnOperatorInfo hash for the "append" operator with the given argument
hash< UpdateOperatorInfo > uop_divide(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "/" operator with the given arguments
const COP_APPEND
to append a string to a column on output
Definition: SqlUtil.qm.dox.h:2482
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition: SqlUtil.qm.dox.h:2437
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< 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< ColumnOperatorInfo > cop_as(auto column, string arg)
returns a ColumnOperatorInfo hash for the "as" operator with the given argument
const DB_PROCEDURES
Feature: procedures.
Definition: SqlUtil.qm.dox.h:2410
hash< OperatorInfo > make_op(string op, auto arg)
returns an OperatorInfo hash
const COP_PERCENT_RANK
Analytic (window) function: PERCENT_RANK.
Definition: SqlUtil.qm.dox.h:2650
const COP_NTILE
Analytic (window) function: NTILE.
Definition: SqlUtil.qm.dox.h:2643
hash< ColumnOperatorInfo > cop_last_value(any column)
Analytic/window function: value evaluated at the row that is the last row of the window frame.
const OP_LT
the SQL less than (<) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4292
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4327
const COP_YEAR_MONTH
to return a date value with year to month information
Definition: SqlUtil.qm.dox.h:2562
hash< string, hash< JoinOperatorInfo > > make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash< auto > opt)
returns hash keyed with the table name assigned to a JoinOperatorInfo hash
hash< ColumnOperatorInfo > cop_lower(auto column)
returns a ColumnOperatorInfo hash for the "lower" operator with the given argument; returns a column ...
const OP_BETWEEN
the SQL "between" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4352
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
const DB_TABLES
Feature: tables.
Definition: SqlUtil.qm.dox.h:2414
hash< UpdateOperatorInfo > uop_upper(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "upper" operator with the given argument; returns a column...
hash< ColumnOperatorInfo > cop_year(auto column)
returns a ColumnOperatorInfo hash for the "year" operator with the given argument
hash< UpdateOperatorInfo > uop_prepend(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "prepend" operator with the given argument
const COP_PREPEND
to prepend a string to a column on output
Definition: SqlUtil.qm.dox.h:2477
hash< InsertOperatorInfo > make_iop(string iop, auto arg)
returns an InsertOperatorInfo hash
hash< ColumnOperatorInfo > cop_divide(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "/" operator with the given arguments
hash< OperatorInfo > op_cne(string arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
const COP_LOWER
to return column value in lower case
Definition: SqlUtil.qm.dox.h:2497
hash< UpdateOperatorInfo > make_uop(string uop, auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash
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< ColumnOperatorInfo > cop_distinct(auto column)
returns a ColumnOperatorInfo hash for the "distinct" operator with the given argument; returns distin...
hash< ColumnOperatorInfo > make_cop(string cop, auto column, auto arg)
returns a ColumnOperatorInfo hash
hash< ColumnOperatorInfo > cop_multiply(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "*" operator with the given arguments
hash< OperatorInfo > op_between(auto l, auto r)
returns an OperatorInfo hash for the "between" operator with the given arguments, neither of which ca...
const DB_VIEWS
Feature: views.
Definition: SqlUtil.qm.dox.h:2418
hash< ColumnOperatorInfo > cop_length(auto column)
returns a ColumnOperatorInfo hash for the "len" operator with the given argument; returns the length ...
hash< OperatorInfo > op_cge(string arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
const COP_AS
to rename a column on output
Definition: SqlUtil.qm.dox.h:2467
hash< UpdateOperatorInfo > uop_lower(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "lower" operator with the given argument; returns a column...
const COP_CAST
to convert column value into another datatype
Definition: SqlUtil.qm.dox.h:2472
const JOP_INNER
for standard inner joins
Definition: SqlUtil.qm.dox.h:3800
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4302
const DT_HOUR
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3585
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition: SqlUtil.qm.dox.h:2664
hash< ColumnOperatorInfo > cop_count(auto column='')
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts
hash< OperatorInfo > op_clt(string arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
hash< ColumnOperatorInfo > cop_max(auto column)
returns a ColumnOperatorInfo hash for the "max" operator; returns maximum column values
const SZ_OPT
the data type takes an optional size parameter
Definition: SqlUtil.qm.dox.h:2454
const CHAR
specifies a CHAR column
Definition: SqlUtil.qm.dox.h:2434
const COP_YEAR_DAY
to return a date value with year to day information
Definition: SqlUtil.qm.dox.h:2567
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< UpdateOperatorInfo > uop_multiply(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "*" operator with the given arguments
hash< OperatorInfo > op_lt(auto arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
const OP_CNE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4342
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition: SqlUtil.qm.dox.h:2431
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition: SqlUtil.qm.dox.h:4322
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4372
const COP_UPPER
to return column value in upper case
Definition: SqlUtil.qm.dox.h:2492
const JOP_RIGHT
for right outer joins
Definition: SqlUtil.qm.dox.h:3810
hash< OperatorInfo > op_cgt(string arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
const COP_DENSE_RANK
Analytic (window) function: DENSE_RANK.
Definition: SqlUtil.qm.dox.h:2622
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...
const IOP_SEQ_CURRVAL
for using the last value of a sequence issued in the current session
Definition: SqlUtil.qm.dox.h:5630
const COP_TRUNC_DATE
to return the date with truncated value
Definition: SqlUtil.qm.dox.h:2608
const COP_MINUS
the SQL "minus" operator
Definition: SqlUtil.qm.dox.h:2537
hash< OperatorInfo > op_gt(auto arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
const COP_LAST_VALUE
Analytic (window) function: LAST_VALUE.
Definition: SqlUtil.qm.dox.h:2636
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition: SqlUtil.qm.dox.h:2629
hash< OperatorInfo > op_not(hash arg)
returns an OperatorInfo hash for the "not" operator; for use in where clauses
hash< ColumnOperatorInfo > cop_year_day(auto column)
returns a ColumnOperatorInfo hash for the "year_day" operator with the given argument
const DefaultCopMap
a hash of default column operator descriptions
Definition: SqlUtil.qm.dox.h:2700
const DB_FUNCTIONS
Features constants.
Definition: SqlUtil.qm.dox.h:2404
hash< OperatorInfo > op_le(auto arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
const COP_DISTINCT
to return distinct values
Definition: SqlUtil.qm.dox.h:2502
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4377
hash< UpdateOperatorInfo > uop_append(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "append" or concatenate operator with the given argument
const OP_CGT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4332
hash< ColumnOperatorInfo > cop_row_number()
Analytic/window function: number of the current row within its partition, counting from 1.
const DT_DAY
Format unit: day.
Definition: SqlUtil.qm.dox.h:3582
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence ...
const DB_SEQUENCES
Feature: sequences.
Definition: SqlUtil.qm.dox.h:2412
const DB_TYPES
Feature: named types.
Definition: SqlUtil.qm.dox.h:2416
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4347
const COP_SUM
to return the sum value
Definition: SqlUtil.qm.dox.h:2522
const OP_LIKE
the SQL "like" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4287
hash< ColumnOperatorInfo > cop_min(auto column)
returns a ColumnOperatorInfo hash for the "min" operator; returns minimum column values
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_minus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "-" operator with the given arguments
hash< ColumnOperatorInfo > cop_first_value(any column)
Analytic/window function: value evaluated at the row that is the first row of the window frame.
const JOP_LEFT
for left outer joins
Definition: SqlUtil.qm.dox.h:3805
hash< InsertOperatorInfo > iop_seq(string arg)
returns an InsertOperatorInfo hash for retrieving the value of the given sequence in insert queries
column operator info hash as returned by all column operator functions
Definition: SqlUtil.qm.dox.h:2333
string cop
the column operator string code
Definition: SqlUtil.qm.dox.h:2334
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2336
auto column
column sopecifier, may be a string or a complex hash
Definition: SqlUtil.qm.dox.h:2335
generic column description hash in schema descriptions
Definition: SqlUtil.qm.dox.h:2303
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:2319
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:2321
auto default_value
the default value for the column
Definition: SqlUtil.qm.dox.h:2313
softint scale
for numeric data types, this value gives the scale
Definition: SqlUtil.qm.dox.h:2311
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition: SqlUtil.qm.dox.h:2309
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:2315
*string comment
an optional comment for the column
Definition: SqlUtil.qm.dox.h:2317
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:2305
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:2307
*bool auto_increment
True for DBs that support an auto-increment column
Definition: SqlUtil.qm.dox.h:2323
insert operator info hash as returned by all insert operator functions
Definition: SqlUtil.qm.dox.h:2340
string _iop
the insert operator string code
Definition: SqlUtil.qm.dox.h:2341
any arg
optional argument
Definition: SqlUtil.qm.dox.h:2342
join operator info hash as returned by all join operator functions
Definition: SqlUtil.qm.dox.h:2353
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition: SqlUtil.qm.dox.h:2358
*string alias
optional alias for table in the query
Definition: SqlUtil.qm.dox.h:2356
*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:2359
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition: SqlUtil.qm.dox.h:2355
*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:2357
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition: SqlUtil.qm.dox.h:2360
string jop
the join operator string code
Definition: SqlUtil.qm.dox.h:2354
SQL operator info hash as returned by all operator functions.
Definition: SqlUtil.qm.dox.h:2327
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2329
string op
the operator string code
Definition: SqlUtil.qm.dox.h:2328
Query information.
Definition: SqlUtil.qm.dox.h:2667
*hash< auto > expression_map
The expression map.
Definition: SqlUtil.qm.dox.h:2687
*hash< string, AbstractTable > join_map
Tables in this join; table alias -> table.
Definition: SqlUtil.qm.dox.h:2678
*hash< auto > pseudo_column_map
Any valid pseudocolumns or aliases generated in th query.
Definition: SqlUtil.qm.dox.h:2684
*hash< auto > where_operator_map
The old-style backwards-compatible "where operator" map.
Definition: SqlUtil.qm.dox.h:2690
object table
The primary table object.
Definition: SqlUtil.qm.dox.h:2669
*hash< auto > query_hash
The original query hash.
Definition: SqlUtil.qm.dox.h:2672
*hash< auto > column_operator_map
Any custom column operator map.
Definition: SqlUtil.qm.dox.h:2693
list< auto > args
arguments to bind in the query generated
Definition: SqlUtil.qm.dox.h:2696
*hash< auto > query_options
Any query options.
Definition: SqlUtil.qm.dox.h:2675
*hash< string, bool > subquery_column_map
When executing a superquery, we can only reference colums in the subquery.
Definition: SqlUtil.qm.dox.h:2681
A hash describing SQL and arguments for an SQL DML command.
Definition: SqlUtil.qm.dox.h:2389
string sql
the SQL string for the update
Definition: SqlUtil.qm.dox.h:2391
list< auto > args
the arguments for the string
Definition: SqlUtil.qm.dox.h:2394
column data type options
Definition: SqlUtil.qm.dox.h:2364
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition: SqlUtil.qm.dox.h:2375
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition: SqlUtil.qm.dox.h:2369
*softint maxlen
optional additional limit to the maximum length of the data
Definition: SqlUtil.qm.dox.h:2383
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition: SqlUtil.qm.dox.h:2372
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition: SqlUtil.qm.dox.h:2378
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition: SqlUtil.qm.dox.h:2366
update operator info hash as returned by all update operator functions
Definition: SqlUtil.qm.dox.h:2346
*hash nest
option nested operation hash
Definition: SqlUtil.qm.dox.h:2349
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2348
string uop
the update operator string code
Definition: SqlUtil.qm.dox.h:2347