Qore SqlUtil Module Reference  1.8
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 
2297 namespace SqlUtil {
2299  public struct GenericColumnInfo {
2301  string qore_type;
2303  string native_type;
2305  softint size;
2307  softint scale;
2313  *string comment;
2315  bool notnull = False;
2317  hash<string, hash> driver;
2320  };
2321 
2323  public struct OperatorInfo {
2324  string op;
2325  auto arg;
2326  };
2327 
2329  public struct ColumnOperatorInfo {
2330  string cop;
2331  auto column;
2332  auto arg;
2333  };
2334 
2336  public struct InsertOperatorInfo {
2337  string _iop;
2338  any arg;
2339  };
2340 
2342  public struct UpdateOperatorInfo {
2343  string uop;
2344  auto arg;
2346  };
2347 
2349  public struct JoinOperatorInfo {
2350  string jop;
2351  auto table;
2352  *string alias;
2355  *string ta;
2356  *hash<auto> opt;
2357  };
2358 
2362  *string date_format;
2363 
2365  *TimeZone data_timezone;
2366 
2368  *TimeZone db_timezone;
2369 
2371  *string number_format;
2372 
2374  *softbool mandatory;
2375 
2377 
2379  *softint maxlen;
2380  };
2381 
2383 
2385  public struct SqlCommandInfo {
2387  string sql;
2388 
2390  list<auto> args;
2391  };
2392 
2398 
2400  const DB_FUNCTIONS = "functions";
2402  const DB_MVIEWS = "materialized views";
2404  const DB_PACKAGES = "packages";
2406  const DB_PROCEDURES = "procedures";
2408  const DB_SEQUENCES = "sequences";
2410  const DB_TABLES = "tables";
2412  const DB_TYPES = "named types";
2414  const DB_VIEWS = "views";
2416  const DB_SYNONYMS = "synonyms";
2418 
2419  /* @defgroup SqlTypeConstants SQL Type Constants
2420  These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
2421  */
2423  const VARCHAR = "string";
2425 
2427  const NUMERIC = "number";
2428 
2430  const CHAR = "char";
2431 
2433  const BLOB = "blob";
2434 
2436  const CLOB = "clob";
2438 
2444  const SZ_NONE = 0;
2445 
2447  const SZ_MAND = 1;
2448 
2450  const SZ_OPT = 2;
2451 
2453  const SZ_NUM = 3;
2455 
2461 
2463  const COP_AS = "as";
2464 
2466 
2468  const COP_CAST = "cast";
2469 
2471 
2473  const COP_PREPEND = "prepend";
2474 
2476 
2478  const COP_APPEND = "append";
2479 
2481 
2483  const COP_VALUE = "value";
2484 
2486 
2488  const COP_UPPER = "upper";
2489 
2491 
2493  const COP_LOWER = "lower";
2494 
2496 
2498  const COP_DISTINCT = "distinct";
2499 
2501 
2503  const COP_MIN = "min";
2504 
2506 
2508  const COP_MAX = "max";
2509 
2511 
2513  const COP_AVG = "avg";
2514 
2516 
2518  const COP_SUM = "sum";
2519 
2521 
2523  const COP_COUNT = "count";
2524 
2526 
2528  const COP_OVER = "over";
2529 
2531 
2533  const COP_MINUS = "minus";
2534 
2536 
2538  const COP_PLUS = "plus";
2539 
2541 
2543  const COP_DIVIDE = "divide";
2544 
2546 
2548  const COP_MULTIPLY = "multiply";
2549 
2551 
2553  const COP_YEAR = "year";
2554 
2556 
2558  const COP_YEAR_MONTH = "year_month";
2559 
2561 
2563  const COP_YEAR_DAY = "year_day";
2564 
2566 
2568  const COP_YEAR_HOUR = "year_hour";
2569 
2571 
2573  const COP_SEQ = "seq";
2574 
2576 
2578  const COP_SEQ_CURRVAL = "seq_currval";
2579 
2581 
2583  const COP_COALESCE = "coalesce";
2584 
2586 
2588  const COP_SUBSTR = "substr";
2589 
2591 
2595  const COP_LENGTH = "length";
2596 
2598 
2604  const COP_TRUNC_DATE = "truncate_date";
2605 
2607 
2611  const COP_CUME_DIST = "cume_dist";
2612 
2614 
2618  const COP_DENSE_RANK = "dense_rank";
2619 
2621 
2625  const COP_FIRST_VALUE = "first_value";
2626 
2628 
2632  const COP_LAST_VALUE = "last_value";
2633 
2635 
2639  const COP_NTILE = "ntile";
2640 
2642 
2646  const COP_PERCENT_RANK = "percent_rank";
2647 
2649 
2653  const COP_RANK = "rank";
2654 
2656 
2660  const COP_ROW_NUMBER = "row_number";
2661 
2663  public struct QueryInfo {
2665  object table;
2666 
2668  *hash<auto> query_hash;
2669 
2671  *hash<auto> query_options;
2672 
2674  *hash<string, AbstractTable> join_map;
2675 
2677  *hash<string, bool> subquery_column_map;
2678 
2680  *hash<auto> pseudo_column_map;
2681 
2683  *hash<auto> expression_map;
2684 
2686  *hash<auto> where_operator_map;
2687 
2689  *hash<auto> column_operator_map;
2690 
2692  list<auto> args;
2693  };
2694 
2696  const DefaultCopMap = ...;
2697 
2699 
2742 
2750  hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
2751 
2752 
2754 
2766  hash<ColumnOperatorInfo> cop_as(auto column, string arg);
2767 
2768 
2770 
2784  hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
2785 
2786 
2788 
2798  hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
2799 
2800 
2802 
2812  hash<ColumnOperatorInfo> cop_append(auto column, string arg);
2813 
2814 
2816 
2944  hash<ColumnOperatorInfo> cop_value(auto arg);
2945 
2946 
2948 
2957  hash<ColumnOperatorInfo> cop_upper(auto column);
2958 
2959 
2961 
2970  hash<ColumnOperatorInfo> cop_lower(auto column);
2971 
2972 
2974 
2983  hash<ColumnOperatorInfo> cop_distinct(auto column);
2984 
2985 
2987 
2996  hash<ColumnOperatorInfo> cop_min(auto column);
2997 
2998 
3000 
3009  hash<ColumnOperatorInfo> cop_max(auto column);
3010 
3011 
3013 
3022  hash<ColumnOperatorInfo> cop_avg(auto column);
3023 
3024 
3026 
3035  hash<ColumnOperatorInfo> cop_sum(auto column);
3036 
3037 
3039 
3046  hash<ColumnOperatorInfo> cop_count(auto column = '');
3047 
3048 
3050 
3057  hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
3058 
3059 
3061 
3071  hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
3072 
3073 
3075 
3085  hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
3086 
3087 
3089 
3099  hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
3100 
3101 
3103 
3113  hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
3114 
3115 
3117 
3126  hash<ColumnOperatorInfo> cop_year(auto column);
3127 
3128 
3130 
3139  hash<ColumnOperatorInfo> cop_year_month(auto column);
3140 
3141 
3143 
3152  hash<ColumnOperatorInfo> cop_year_day(auto column);
3153 
3154 
3156 
3165  hash<ColumnOperatorInfo> cop_year_hour(auto column);
3166 
3167 
3169 
3179  hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
3180 
3181 
3183 
3193  hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
3194 
3195 
3197 
3209  hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
3210 
3211 
3213 
3224  hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
3225 
3226 
3228 
3239  hash<ColumnOperatorInfo> cop_length(auto column);
3240 
3241 
3243 
3257  hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
3258 
3259 
3260 
3262 
3290  hash<ColumnOperatorInfo> cop_cume_dist();
3291 
3292 
3294 
3322  hash<ColumnOperatorInfo> cop_dense_rank();
3323 
3324 
3326 
3354  hash<ColumnOperatorInfo> cop_first_value(any column);
3355 
3356 
3358 
3386  hash<ColumnOperatorInfo> cop_last_value(any column);
3387 
3388 
3390 
3420  hash<ColumnOperatorInfo> cop_ntile(int value);
3421 
3422 
3424 
3452  hash<ColumnOperatorInfo> cop_percent_rank();
3453 
3454 
3456 
3484  hash<ColumnOperatorInfo> cop_rank();
3485 
3486 
3488 
3516  hash<ColumnOperatorInfo> cop_row_number();
3517 
3518 
3520 
3572  const DT_YEAR = "Y";
3573 
3575  const DT_MONTH = "M";
3576 
3578  const DT_DAY = "D";
3579 
3581  const DT_HOUR = "H";
3582 
3584  const DT_MINUTE = "m";
3585 
3587  const DT_SECOND = "S";
3588 
3589  // let's simulate and enum here'
3590  const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
3592 
3598  const DefaultUopMap = ...;
3599 
3601 
3624 
3632  hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
3633 
3634 
3636 
3646  hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
3647 
3648 
3650 
3660  hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
3661 
3662 
3664 
3673  hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
3674 
3675 
3677 
3686  hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
3687 
3688 
3690 
3701  hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
3702 
3703 
3705 
3715  hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
3716 
3717 
3719 
3729  hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
3730 
3731 
3733 
3743  hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
3744 
3745 
3747 
3757  hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
3758 
3759 
3761 
3770  hash<UpdateOperatorInfo> uop_seq(string seq);
3771 
3772 
3774 
3783  hash<UpdateOperatorInfo> uop_seq_currval(string seq);
3784 
3786 
3794 
3796  const JOP_INNER = "inner";
3797 
3799 
3801  const JOP_LEFT = "left";
3802 
3804 
3806  const JOP_RIGHT = "right";
3807 
3809  const JopMap = {
3810  JOP_INNER: "inner",
3811  JOP_LEFT: "left outer",
3812  JOP_RIGHT: "right outer",
3813  };
3815 
3826 
3829  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3830 
3831 
3833 
3837  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3838 
3839 
3841 
3860  hash<string, hash<JoinOperatorInfo>> join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3861 
3862 
3864 
3883  hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3884 
3885 
3887 
3906  hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3907 
3908 
3910 
3932  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3933 
3934 
3936 
3956  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3957 
3958 
3960 
3982  hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3983 
3984 
3986 
4005  hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4006 
4007 
4009 
4028  hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4029 
4030 
4032 
4053  hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4054 
4055 
4057 
4077  hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4078 
4079 
4081 
4101  hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4102 
4103 
4105 
4127  hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4128 
4129 
4131 
4150  hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4151 
4152 
4154 
4173  hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4174 
4175 
4177 
4198  hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4199 
4200 
4202 
4222  hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4223 
4224 
4226 
4246  hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4247 
4248 
4250 
4272  hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4273 
4275 
4281 
4283  const OP_LIKE = "like";
4284 
4286 
4288  const OP_LT = "<";
4289 
4291 
4293  const OP_LE = "<=";
4294 
4296 
4298  const OP_GT = ">";
4299 
4301 
4303  const OP_GE = ">=";
4304 
4306 
4308  const OP_NE = "!=";
4309 
4311 
4313  const OP_EQ = "=";
4314 
4316 
4318  const OP_CLT = "C<";
4319 
4321 
4323  const OP_CLE = "C<=";
4324 
4326 
4328  const OP_CGT = "C>";
4329 
4331 
4333  const OP_CGE = "C>=";
4334 
4336 
4338  const OP_CNE = "C!=";
4339 
4341 
4343  const OP_CEQ = "C=";
4344 
4346 
4348  const OP_BETWEEN = "between";
4349 
4351 
4353  const OP_IN = "in";
4354 
4356 
4358  const OP_NOT = "not";
4359 
4361 
4363  const OP_SUBSTR = "substr";
4364 
4366 
4368  const OP_OR = "or";
4369 
4371 
4373  const OP_IN_SELECT = "in_select";
4374 
4377  // first the "AND" and "OR" "operators"
4378  DP_OP_AND: {
4379  "exp": AbstractDataProvider::GenericExpressions{DP_OP_AND},
4380  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4381  return "("
4382  + (foldl $1 + " and " + $2,
4383  (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap."bool"), args))
4384  + ")";
4385  },
4386  },
4387  DP_OP_OR: {
4388  "exp": AbstractDataProvider::GenericExpressions{DP_OP_OR},
4389  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4390  return "("
4391  + (foldl $1 + " or " + $2,
4392  (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap."bool"), args))
4393  + ")";
4394  },
4395  },
4396  OP_LIKE: {
4397  "exp": <DataProviderExpressionInfo>{
4398  "type": DET_Operator,
4399  "label": "like",
4400  "name": "like",
4401  "desc": "The value to bind as the 'like' value (ex: '%some string%')",
4402  "symbol": "like",
4403  "args": (
4404  DataProviderSignatureStringType,
4405  DataProviderSignatureStringValueType,
4406  ),
4407  "return_type": AbstractDataProviderTypeMap."bool",
4408  },
4409  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4410  return sprintf("%s like %s",
4411  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."string"),
4412  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."string"));
4413  },
4414  },
4415  OP_LT: {
4416  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LT},
4417  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4418  return sprintf("%s < %s",
4419  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4420  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4421  },
4422  },
4423  OP_LE: {
4424  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LE},
4425  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4426  return sprintf("%s <= %s",
4427  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4428  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4429  },
4430  },
4431  OP_GT: {
4432  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GT},
4433  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4434  return sprintf("%s > %s",
4435  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4436  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4437  },
4438  },
4439  OP_GE: {
4440  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GE},
4441  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4442  return sprintf("%s >= %s",
4443  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4444  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4445  },
4446  },
4447  OP_NE: {
4448  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NE},
4449  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4450  bool null0 = (args[0] === NULL || !exists args[0]);
4451  bool null1 = (args[1] === NULL || !exists args[1]);
4452  if (null0 && null1) {
4453  return "1 = 0";
4454  }
4455  if (null0) {
4456  return sprintf("%s is not null",
4457  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4458  }
4459  if (null1) {
4460  return sprintf("%s is not null",
4461  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"));
4462  }
4463  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4464  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4465  return sprintf("%s != %s", exp0, exp1);
4466  },
4467  },
4468  OP_EQ: {
4469  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_EQ},
4470  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4471  bool null0 = (args[0] === NULL || !exists args[0]);
4472  bool null1 = (args[1] === NULL || !exists args[1]);
4473  if (null0 && null1) {
4474  return "1 = 1";
4475  }
4476  if (null0) {
4477  return sprintf("%s is null",
4478  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"));
4479  }
4480  if (null1) {
4481  return sprintf("%s is null",
4482  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"));
4483  }
4484  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4485  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4486  return sprintf("%s = %s", exp0, exp1);
4487  },
4488  },
4489  OP_BETWEEN: {
4490  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_BETWEEN},
4491  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4492  return sprintf("%s between %s and %s",
4493  info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any"),
4494  info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any"),
4495  info.table.getExpressionArg(\info, role, args[2], AbstractDataProviderTypeMap."any"));
4496  },
4497  },
4498  OP_IN: {
4499  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_IN},
4500  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4501  string exp0 = info.table.getExpressionArg(\info, role, shift args, AbstractDataProviderTypeMap."any");
4502  *string ins = (foldl $1 + "," + $2, (map info.table.getExpressionArg(\info, role, $1,
4503  AbstractDataProviderTypeMap."any"), args));
4504  return exists ins ? sprintf("%s in (%s)", exp0, ins) : "1 != 1";
4505  },
4506  },
4507  OP_NOT: {
4508  "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NOT},
4509  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4510  return sprintf("not (%s)", info.table.getExpressionArg(\info, role, args[0],
4511  AbstractDataProviderTypeMap."bool"));
4512  },
4513  },
4514  OP_SUBSTR: {
4515  "exp": <DataProviderExpressionInfo>{
4516  "type": DET_Operator,
4517  "label": "substr",
4518  "name": "substr",
4519  "desc": "returns a substring from a string; args: string, int start char, [int length]",
4520  "symbol": "substr",
4521  "args": (
4522  DataProviderSignatureStringType,
4523  DataProviderSignatureIntValueType,
4524  DataProviderSignatureOptionalIntValueType,
4525  ),
4526  "return_type": AbstractDataProviderTypeMap."string",
4527  },
4528  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4529  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."string");
4530  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."int");
4531  if (!exists args[2]) {
4532  return sprintf("substring(%s from %s)", exp0, exp1);
4533  }
4534  return sprintf("substring(%s from %s for %s)", exp0, exp1,
4535  info.table.getExpressionArg(\info, role, args[2], AbstractDataProviderTypeMap."int"));
4536  },
4537  },
4538  OP_IN_SELECT: {
4539  "exp": <DataProviderExpressionInfo>{
4540  "type": DET_Operator,
4541  "label": "in_select",
4542  "name": "in_select",
4543  "desc": "check if a value is in a sub-select; args: value, table name for the subselect, subselect "
4544  "query hash",
4545  "symbol": "in_select",
4546  "args": (
4547  DataProviderSignatureAnyType, # any value, expression, or field reference
4548  DataProviderSignatureStringValueType, # table name
4549  DataProviderSignatureHashValueType, # query hash
4550  ),
4551  "return_type": AbstractDataProviderTypeMap."bool",
4552  },
4553  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4554  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4555  object subtable = info.table.getSubtableFromString(args[1], info.query_options);
4556  list<auto> subargs;
4557  string subsql = subtable.getSelectSql(args[2], \subargs);
4558  args += subargs;
4559  return sprintf("%s in (%s)", exp0, subsql);
4560  },
4561  },
4562  COP_AS: {
4563  "exp": <DataProviderExpressionInfo>{
4564  "type": DET_Operator,
4565  "label": "as",
4566  "name": "as",
4567  "desc": "aliases a result; args: expression or value, string label",
4568  "symbol": "as",
4569  "role": ER_Field,
4570  "args": (
4571  DataProviderSignatureAnyType,
4572  DataProviderSignatureStringValueType,
4573  ),
4574  "return_type": AbstractDataProviderTypeMap."any",
4575  },
4576  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4577  string exp = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4578  string arg = args[1];
4579  info.pseudo_column_map{arg} = exp;
4580  return sprintf("%s as %s", exp, info.table.getColumnSqlName(arg));
4581  },
4582  },
4583  COP_PREPEND: {
4584  "exp": <DataProviderExpressionInfo>{
4585  "type": DET_Operator,
4586  "label": COP_PREPEND,
4587  "name": COP_PREPEND,
4588  "desc": "prepends a string to another string; args: string to be prepended, string to prepend to the "
4589  "first string",
4590  "symbol": COP_PREPEND,
4591  "args": (
4592  DataProviderSignatureStringType,
4593  DataProviderSignatureStringType,
4594  ),
4595  "return_type": AbstractDataProviderTypeMap."string",
4596  },
4597  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4598  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."string");
4599  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."string");
4600  return sprintf("%s || %s", exp1, exp0);
4601  },
4602  },
4603  COP_APPEND: {
4604  "exp": <DataProviderExpressionInfo>{
4605  "type": DET_Operator,
4606  "label": COP_APPEND,
4607  "name": COP_APPEND,
4608  "desc": "appends or catenates a string to another string; args: string to be appended, string to "
4609  "append or concatenate to the first string",
4610  "symbol": COP_APPEND,
4611  "args": (
4612  DataProviderSignatureStringType,
4613  DataProviderSignatureStringType,
4614  ),
4615  "return_type": AbstractDataProviderTypeMap."string",
4616  },
4617  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4618  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."string");
4619  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."string");
4620  return sprintf("%s || %s", exp0, exp1);
4621  },
4622  },
4623  COP_UPPER: {
4624  "exp": <DataProviderExpressionInfo>{
4625  "type": DET_Operator,
4626  "label": COP_UPPER,
4627  "name": COP_UPPER,
4628  "desc": "converts a string to all upper case; arg: string",
4629  "symbol": COP_UPPER,
4630  "args": (
4631  DataProviderSignatureStringType,
4632  ),
4633  "return_type": AbstractDataProviderTypeMap."string",
4634  },
4635  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4636  return sprintf("upper(%s)", info.table.getExpressionArg(\info, role, args[0],
4637  AbstractDataProviderTypeMap."string"));
4638  },
4639  },
4640  COP_LOWER: {
4641  "exp": <DataProviderExpressionInfo>{
4642  "type": DET_Operator,
4643  "label": COP_LOWER,
4644  "name": COP_LOWER,
4645  "desc": "converts a string to all lower case; arg: string",
4646  "symbol": COP_LOWER,
4647  "args": (
4648  DataProviderSignatureStringType,
4649  ),
4650  "return_type": AbstractDataProviderTypeMap."string",
4651  },
4652  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4653  return sprintf("lower(%s)", info.table.getExpressionArg(\info, role, args[0],
4654  AbstractDataProviderTypeMap."string"));
4655  },
4656  },
4657  COP_DISTINCT: {
4658  "exp": <DataProviderExpressionInfo>{
4659  "type": DET_Operator,
4660  "label": COP_DISTINCT,
4661  "name": COP_DISTINCT,
4662  "desc": "indicates that only records with distinct values of the given field should be returned",
4663  "symbol": COP_DISTINCT,
4664  "role": ER_Field,
4665  "args": (
4666  DataProviderSignatureAnyType,
4667  ),
4668  "return_type": AbstractDataProviderTypeMap."any",
4669  },
4670  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4671  return sprintf("distinct %s", info.table.getExpressionArg(\info, role, args[0],
4672  AbstractDataProviderTypeMap."any"));
4673  },
4674  },
4675  COP_MIN: {
4676  "exp": <DataProviderExpressionInfo>{
4677  "type": DET_Operator,
4678  "label": COP_MIN,
4679  "name": COP_MIN,
4680  "desc": "Returns the minimum value in the group",
4681  "symbol": COP_MIN,
4682  "role": ER_Field,
4683  "args": (
4684  DataProviderSignatureAnyType,
4685  ),
4686  "return_type": AbstractDataProviderTypeMap."any",
4687  },
4688  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4689  return sprintf("min(%s)", info.table.getExpressionArg(\info, role, args[0],
4690  AbstractDataProviderTypeMap."any"));
4691  },
4692  "group": True,
4693  },
4694  COP_MAX: {
4695  "exp": <DataProviderExpressionInfo>{
4696  "type": DET_Operator,
4697  "label": COP_MAX,
4698  "name": COP_MAX,
4699  "desc": "Returns the maximum value in the group",
4700  "symbol": COP_MAX,
4701  "role": ER_Field,
4702  "args": (
4703  DataProviderSignatureAnyType,
4704  ),
4705  "return_type": AbstractDataProviderTypeMap."any",
4706  },
4707  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4708  return sprintf("max(%s)", info.table.getExpressionArg(\info, role, args[0],
4709  AbstractDataProviderTypeMap."any"));
4710  },
4711  "group": True,
4712  },
4713  COP_AVG: {
4714  "exp": <DataProviderExpressionInfo>{
4715  "type": DET_Operator,
4716  "label": COP_AVG,
4717  "name": COP_AVG,
4718  "desc": "Returns the average of the given values in the group",
4719  "symbol": COP_AVG,
4720  "role": ER_Field,
4721  "args": (
4722  DataProviderSignatureAnyType,
4723  ),
4724  "return_type": AbstractDataProviderTypeMap."any",
4725  },
4726  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4727  return sprintf("avg(%s)", info.table.getExpressionArg(\info, role, args[0],
4728  AbstractDataProviderTypeMap."any"));
4729  },
4730  "group": True,
4731  },
4732  COP_SUM: {
4733  "exp": <DataProviderExpressionInfo>{
4734  "type": DET_Operator,
4735  "label": COP_SUM,
4736  "name": COP_SUM,
4737  "desc": "Returns the sum of the given values",
4738  "symbol": COP_SUM,
4739  "role": ER_Field,
4740  "args": (
4741  DataProviderSignatureAnyType,
4742  ),
4743  "return_type": AbstractDataProviderTypeMap."any",
4744  },
4745  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4746  return sprintf("sum(%s)", info.table.getExpressionArg(\info, role, args[0],
4747  AbstractDataProviderTypeMap."any"));
4748  },
4749  "group": True,
4750  },
4751  COP_COUNT: {
4752  "exp": <DataProviderExpressionInfo>{
4753  "type": DET_Operator,
4754  "label": COP_COUNT,
4755  "name": COP_COUNT,
4756  "desc": "Count the number of rows in the group",
4757  "symbol": COP_COUNT,
4758  "role": ER_Field,
4759  "args": (
4760  DataProviderSignatureAnyType,
4761  ),
4762  "return_type": AbstractDataProviderTypeMap."int",
4763  },
4764  "code": string sub (reference<hash<QueryInfo>> info, int role, *list<auto> args) {
4765  if (exists args[0] && args[0] != NULL) {
4766  return sprintf("count(%s)", info.table.getExpressionArg(\info, role, args[0],
4767  AbstractDataProviderTypeMap."any"));
4768  }
4769  return "count(1)";
4770  },
4771  },
4772  COP_MINUS: {
4773  "exp": <DataProviderExpressionInfo>{
4774  "type": DET_Operator,
4775  "label": COP_MINUS,
4776  "name": COP_MINUS,
4777  "desc": "Subtracts one number from another",
4778  "symbol": COP_MINUS,
4779  "args": (
4780  DataProviderSignatureAnyType,
4781  DataProviderSignatureAnyType,
4782  ),
4783  "return_type": AbstractDataProviderTypeMap."any",
4784  },
4785  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4786  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4787  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4788  return sprintf("%s - %s", exp0, exp1);
4789  },
4790  },
4791  COP_PLUS: {
4792  "exp": <DataProviderExpressionInfo>{
4793  "type": DET_Operator,
4794  "label": COP_PLUS,
4795  "name": COP_PLUS,
4796  "desc": "Adds two numbers",
4797  "symbol": COP_PLUS,
4798  "args": (
4799  DataProviderSignatureAnyType,
4800  DataProviderSignatureAnyType,
4801  ),
4802  "return_type": AbstractDataProviderTypeMap."any",
4803  },
4804  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4805  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4806  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4807  return sprintf("%s + %s", exp0, exp1);
4808  },
4809  },
4810  COP_DIVIDE: {
4811  "exp": <DataProviderExpressionInfo>{
4812  "type": DET_Operator,
4813  "label": COP_DIVIDE,
4814  "name": COP_DIVIDE,
4815  "desc": "Divides one number by another",
4816  "symbol": COP_DIVIDE,
4817  "args": (
4818  DataProviderSignatureAnyType,
4819  DataProviderSignatureAnyType,
4820  ),
4821  "return_type": AbstractDataProviderTypeMap."any",
4822  },
4823  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4824  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4825  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4826  return sprintf("%s / %s", exp0, exp1);
4827  },
4828  },
4829  COP_MULTIPLY: {
4830  "exp": <DataProviderExpressionInfo>{
4831  "type": DET_Operator,
4832  "label": COP_MULTIPLY,
4833  "name": COP_MULTIPLY,
4834  "desc": "Multiplies two numbers",
4835  "symbol": COP_MULTIPLY,
4836  "args": (
4837  DataProviderSignatureAnyType,
4838  DataProviderSignatureAnyType,
4839  ),
4840  "return_type": AbstractDataProviderTypeMap."any",
4841  },
4842  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4843  string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap."any");
4844  string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap."any");
4845  return sprintf("%s * %s", exp0, exp1);
4846  },
4847  },
4848  COP_COALESCE: {
4849  "exp": <DataProviderExpressionInfo>{
4850  "type": DET_Operator,
4851  "label": COP_COALESCE,
4852  "name": COP_COALESCE,
4853  "desc": "Returns the value of the first expression with a value",
4854  "symbol": COP_COALESCE,
4855  "args": (
4856  DataProviderSignatureAnyType,
4857  ),
4858  "varargs": True,
4859  "return_type": AbstractDataProviderTypeMap."any",
4860  },
4861  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4862  return sprintf("coalesce(%s)", (foldl $1 + "," + $2,
4863  (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap."any"), args)));
4864  }
4865  },
4866  COP_LENGTH: {
4867  "exp": <DataProviderExpressionInfo>{
4868  "type": DET_Operator,
4869  "label": COP_LENGTH,
4870  "name": COP_LENGTH,
4871  "desc": "Returns the length of the argument",
4872  "symbol": COP_LENGTH,
4873  "args": (
4874  DataProviderSignatureAnyType,
4875  ),
4876  "return_type": AbstractDataProviderTypeMap."int",
4877  },
4878  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4879  return sprintf("length(%s)", info.table.getExpressionArg(\info, role, args[0],
4880  AbstractDataProviderTypeMap."any"));
4881  },
4882  },
4883  COP_SEQ: {
4884  "exp": <DataProviderExpressionInfo>{
4885  "type": DET_Operator,
4886  "label": COP_SEQ,
4887  "name": COP_SEQ,
4888  "desc": "returns the next value in the given sequence; args: sequence name",
4889  "symbol": COP_SEQ,
4890  "args": (
4891  DataProviderSignatureStringValueType,
4892  ),
4893  "return_type": AbstractDataProviderTypeMap."int",
4894  },
4895  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4896  throw "SEQUENCE-ERROR", sprintf("cannot select sequence %y because this database does not support "
4897  "sequences", args[0]);
4898  }
4899  },
4900  COP_SEQ_CURRVAL: {
4901  "exp": <DataProviderExpressionInfo>{
4902  "type": DET_Operator,
4903  "label": COP_SEQ_CURRVAL,
4904  "name": COP_SEQ_CURRVAL,
4905  "desc": "returns the current value in the given sequence; args: sequence name",
4906  "symbol": COP_SEQ_CURRVAL,
4907  "args": (
4908  DataProviderSignatureStringValueType,
4909  ),
4910  "return_type": AbstractDataProviderTypeMap."int",
4911  },
4912  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4913  throw "SEQUENCE-ERROR", sprintf("cannot select the current value of sequence %y because this "
4914  "database does not support sequences", args[0]);
4915  }
4916  },
4917  COP_OVER: {
4918  "exp": <DataProviderExpressionInfo>{
4919  "type": DET_Operator,
4920  "label": COP_OVER,
4921  "name": COP_OVER,
4922  "desc": "returns the output of the SQL window given by the arguments; args: *string partiion by, "
4923  "*string order by",
4924  "symbol": COP_OVER,
4925  "args": (
4926  DataProviderSignatureFieldType,
4927  DataProviderSignatureOptionalStringValueType,
4928  DataProviderSignatureOptionalStringValueType,
4929  ),
4930  "role": ER_Field,
4931  "return_type": AbstractDataProviderTypeMap."any",
4932  },
4933  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4934  string column_name = args[0];
4935  *string partitionby = args[1];
4936  *string orderby = args[2];
4937  if (!exists partitionby && exists orderby) {
4938  throw "OVER-ERROR", "Argument 2 (partition by) must be given in case of usage of argument 3 "
4939  "(order by)";
4940  }
4941  string sql = column_name + " over (";
4942  Columns cols;
4943  if (exists partitionby) {
4944  if (!info.pseudo_column_map{partitionby}) {
4945  cols = info.table.describe();
4946  if (!exists cols{partitionby}) {
4947  throw "OVER-ERROR", sprintf("Argument 2 (partition by) %y is not an alias or an "
4948  "accessible column", partitionby);
4949  }
4950  }
4951  sql += sprintf("partition by %s", partitionby);
4952  }
4953  if (exists orderby) {
4954  if (!info.pseudo_column_map{orderby}) {
4955  if (!cols) {
4956  cols = info.table.describe();
4957  if (!exists cols{orderby}) {
4958  throw "OVER-ERROR", sprintf("Argument 3 (order by) %y is not an alias or an "
4959  "accessible column", orderby);
4960  }
4961  }
4962  }
4963  sql += sprintf(" order by %s", orderby);
4964  }
4965  sql += ")";
4966  return sql;
4967  }
4968  },
4969  COP_DENSE_RANK: (
4970  "exp": <DataProviderExpressionInfo>{
4971  "type": DET_Operator,
4972  "label": COP_DENSE_RANK,
4973  "name": COP_DENSE_RANK,
4974  "desc": "Returns the rank of a row in an ordered group of rows as a number",
4975  "symbol": COP_DENSE_RANK,
4976  "args": (),
4977  "role": ER_Field,
4978  "return_type": AbstractDataProviderTypeMap."any",
4979  },
4980  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4981  return "dense_rank()";
4982  },
4983  ),
4984  COP_FIRST_VALUE: (
4985  "exp": <DataProviderExpressionInfo>{
4986  "type": DET_Operator,
4987  "label": COP_FIRST_VALUE,
4988  "name": COP_FIRST_VALUE,
4989  "desc": "Returns the first value in an ordered group of rows",
4990  "symbol": COP_FIRST_VALUE,
4991  "args": (
4992  DataProviderSignatureFieldType,
4993  ),
4994  "role": ER_Field,
4995  "return_type": AbstractDataProviderTypeMap."any",
4996  },
4997  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
4998  return sprintf("first_value(%s)", args[0]);
4999  },
5000  ),
5001  COP_LAST_VALUE: (
5002  "exp": <DataProviderExpressionInfo>{
5003  "type": DET_Operator,
5004  "label": COP_LAST_VALUE,
5005  "name": COP_LAST_VALUE,
5006  "desc": "Returns the last value in an ordered group of rows",
5007  "symbol": COP_LAST_VALUE,
5008  "args": (
5009  DataProviderSignatureFieldType,
5010  ),
5011  "role": ER_Field,
5012  "return_type": AbstractDataProviderTypeMap."any",
5013  },
5014  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5015  return sprintf("last_value(%s)", args[0]);
5016  },
5017  ),
5018  COP_NTILE: (
5019  "exp": <DataProviderExpressionInfo>{
5020  "type": DET_Operator,
5021  "label": COP_NTILE,
5022  "name": COP_NTILE,
5023  "desc": "Returns the group number of an ordered group of rows",
5024  "symbol": COP_NTILE,
5025  "args": (
5026  DataProviderSignatureIntValueType,
5027  ),
5028  "role": ER_Field,
5029  "return_type": AbstractDataProviderTypeMap."int",
5030  },
5031  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5032  return sprintf("ntile(%d)", args[0]);
5033  },
5034  ),
5035  COP_PERCENT_RANK: (
5036  "exp": <DataProviderExpressionInfo>{
5037  "type": DET_Operator,
5038  "label": COP_PERCENT_RANK,
5039  "name": COP_PERCENT_RANK,
5040  "desc": "Returns the percent rank of a row in an ordered group of rows",
5041  "symbol": COP_PERCENT_RANK,
5042  "args": (),
5043  "role": ER_Field,
5044  "return_type": AbstractDataProviderTypeMap."int",
5045  },
5046  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5047  return "percent_rank()";
5048  },
5049  ),
5050  COP_RANK: (
5051  "exp": <DataProviderExpressionInfo>{
5052  "type": DET_Operator,
5053  "label": COP_PERCENT_RANK,
5054  "name": COP_PERCENT_RANK,
5055  "desc": "Returns the row number of a row in an ordered group of rows",
5056  "symbol": COP_PERCENT_RANK,
5057  "args": (),
5058  "role": ER_Field,
5059  "return_type": AbstractDataProviderTypeMap."int",
5060  },
5061  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5062  return "rank()";
5063  },
5064  ),
5065  COP_ROW_NUMBER: (
5066  "exp": <DataProviderExpressionInfo>{
5067  "type": DET_Operator,
5068  "label": COP_ROW_NUMBER,
5069  "name": COP_ROW_NUMBER,
5070  "desc": "Returns the row number of a result set",
5071  "symbol": COP_ROW_NUMBER,
5072  "args": (),
5073  "role": ER_Field,
5074  "return_type": AbstractDataProviderTypeMap."int",
5075  },
5076  "code": string sub (reference<hash<QueryInfo>> info, int role, list<auto> args) {
5077  return "row_number()";
5078  },
5079  ),
5080  };
5081 
5083  const DefaultOpMap = {
5084  OP_LIKE: {
5085  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5086  info.args += arg;
5087  return sprintf("%s like %v", cn);
5088  },
5089  "name": "like",
5090  "args": (DataProviderSignatureStringType, DataProviderSignatureStringValueType),
5091  "return_type": AbstractDataProviderTypeMap."bool",
5092  "desc": "The value to bind as the 'like' value (ex: '%some string%')",
5093  },
5094  OP_LT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LT} + (
5095  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5096  info.args += arg;
5097  return sprintf("%s < %v", cn);
5098  },
5099  ),
5100  OP_LE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LE} + (
5101  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5102  info.args += arg;
5103  return sprintf("%s <= %v", cn);
5104  },
5105  ),
5106  OP_GT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GT} + (
5107  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5108  info.args += arg;
5109  return sprintf("%s > %v", cn);
5110  },
5111  ),
5112  OP_GE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GE} + (
5113  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5114  info.args += arg;
5115  return sprintf("%s >= %v", cn);
5116  },
5117  ),
5118  OP_NE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NE} + (
5119  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5120  if (arg === NULL || !exists arg)
5121  return sprintf("%s is not null", cn);
5122  info.args += arg;
5123  return sprintf("(%s != %v or %s is null)", cn, cn);
5124  },
5125  ),
5126  OP_EQ: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_EQ} + (
5127  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5128  if (arg === NULL || !exists arg)
5129  return sprintf("%s is null", cn);
5130  info.args += arg;
5131  return sprintf("%s = %v", cn);
5132  },
5133  ),
5134  OP_BETWEEN: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_BETWEEN} + (
5135  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5136  info.args += arg[0];
5137  info.args += arg[1];
5138  return sprintf("%s between %v and %v", cn);
5139  },
5140  ),
5141  OP_IN: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_IN} + (
5142  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5143  *string ins = (foldl $1 + "," + $2, (map info.table.getSqlValue($1), arg));
5144  return exists ins ? sprintf("%s in (%s)", cn, ins) : "1 != 1";
5145  },
5146  ),
5147  OP_IN_SELECT: {
5148  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg,
5149  *hash<auto> opt) {
5150  object subtable;
5151  if (arg.table.typeCode() == NT_STRING) {
5152  subtable = info.table.getSubtableFromString(arg.table, opt);
5153  } else {
5154  subtable = arg.table;
5155  }
5156 
5157  list<auto> subargs;
5158  string subsql = subtable.getSelectSql(arg.select_hash, \subargs);
5159  info.args += subargs;
5160  return sprintf("%s in (%s)", cn, subsql);
5161  },
5162  "withopt": True,
5163  },
5164  OP_NOT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NOT} + (
5165  "recursive": True,
5166  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5167  return sprintf("not (%s)", cn);
5168  },
5169  ),
5170  OP_CLT: (
5171  "argcolumn": True,
5172  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5173  return sprintf("%s < %s", cn, arg);
5174  },
5175  "name": "column <",
5176  "type": AbstractDataProviderType::get(StringType),
5177  "desc": "a column name for less than comparisons; if the field value is less than the column argument's "
5178  "value, then the operation returns true; the other column must have a compatible type",
5179  ),
5180  OP_CLE: (
5181  "argcolumn": True,
5182  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5183  return sprintf("%s <= %s", cn, arg);
5184  },
5185  "name": "column <=",
5186  "type": AbstractDataProviderType::get(StringType),
5187  "desc": "a column name for less than or equals comparisons; if the field value is less than or equal to "
5188  "the column argument's, then the operation returns true; the other column must have a compatible type",
5189  ),
5190  OP_CGT: (
5191  "argcolumn": True,
5192  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5193  return sprintf("%s > %s", cn, arg);
5194  },
5195  "name": "column >",
5196  "type": AbstractDataProviderType::get(StringType),
5197  "desc": "a column name for less than comparisons; if the field value is less than the column argument's, "
5198  "then the operation returns true; the other column must have a compatible type",
5199  ),
5200  OP_CGE: (
5201  "argcolumn": True,
5202  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5203  return sprintf("%s >= %s", cn, arg);
5204  },
5205  "name": "column >=",
5206  "type": AbstractDataProviderType::get(StringType),
5207  "desc": "a column name for greater than or equals comparisons; if the field value is greater than or "
5208  "equal to the column argument's, then the operation returns true; the other column must have a "
5209  "compatible type",
5210  ),
5211  OP_CNE: (
5212  "argcolumn": True,
5213  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5214  return sprintf("%s != %s", cn, arg);
5215  },
5216  "name": "column !=",
5217  "type": AbstractDataProviderType::get(StringType),
5218  "desc": "a column name for not=equals comparisons; the other column must have a compatible type",
5219  ),
5220  OP_CEQ: (
5221  "argcolumn": True,
5222  "code": string sub (reference<hash<QueryInfo>> info, string cn, string arg) {
5223  return sprintf("%s = %s", cn, arg);
5224  },
5225  "name": "column =",
5226  "type": AbstractDataProviderType::get(StringType),
5227  "desc": "a value for equality comparisons; the other column must have a compatible type",
5228  ),
5229  OP_SUBSTR: (
5230  "code": string sub (reference<hash<QueryInfo>> info, string cn, auto arg) {
5231  info.args += arg[0]; // start
5232  if (!exists arg[1]) {
5233  info.args += arg[2]; # text
5234  return sprintf("substring(%s from %v) = %v", cn);
5235  }
5236  info.args += arg[1]; # count
5237  info.args += arg[2]; # text
5238  return sprintf("substring(%s from %v for %v) = %v", cn);
5239  },
5240  ),
5241  OP_OR: (
5242  "code": string sub (reference<hash<QueryInfo>> info, string cn, list<auto> arg) {
5243  return info.table.getOrClause(\info, arg);
5244  },
5245  ),
5246  };
5248 
5273  hash<OperatorInfo> make_op(string op, auto arg);
5274 
5275 
5277 
5286  hash<OperatorInfo> op_like(string str);
5287 
5288 
5290 
5301  hash<OperatorInfo> op_lt(auto arg);
5302 
5303 
5305 
5316  hash<OperatorInfo> op_le(auto arg);
5317 
5318 
5320 
5331  hash<OperatorInfo> op_gt(auto arg);
5332 
5333 
5335 
5346  hash<OperatorInfo> op_ge(auto arg);
5347 
5348 
5350 
5363  hash<OperatorInfo> op_ne(auto arg);
5364 
5365 
5367 
5380  hash<OperatorInfo> op_eq(auto arg);
5381 
5382 
5384 
5396  hash<OperatorInfo> op_between(auto l, auto r);
5397 
5398 
5400 
5409  hash<OperatorInfo> op_in();
5410 
5411 
5413 
5420  hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
5421 
5422 
5424 
5431  hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
5432 
5433 
5435 
5442  hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
5443 
5444 
5446 
5457  hash<OperatorInfo> op_in(list<auto> args);
5458 
5459 
5461 
5468  hash<OperatorInfo> op_not(hash arg);
5469 
5470 
5472 
5483  hash<OperatorInfo> op_clt(string arg);
5484 
5485 
5487 
5498  hash<OperatorInfo> op_cle(string arg);
5499 
5500 
5502 
5513  hash<OperatorInfo> op_cgt(string arg);
5514 
5515 
5517 
5528  hash<OperatorInfo> op_cge(string arg);
5529 
5530 
5532 
5543  hash<OperatorInfo> op_cne(string arg);
5544 
5545 
5547 
5558  hash<OperatorInfo> op_ceq(string arg);
5559 
5560 
5562 
5573  hash<OperatorInfo> op_substr(int start, *int count, string text);
5574 
5575 
5577 
5587  hash<OperatorInfo> op_substr(int start, string text);
5588 
5589 
5591 
5608  hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
5609 
5611 
5619 
5621  const IOP_SEQ = "seq";
5622 
5624 
5626  const IOP_SEQ_CURRVAL = "seq_currval";
5627 
5629  const DefaultIopMap = {};
5631 
5638 
5645  hash<InsertOperatorInfo> make_iop(string iop, auto arg);
5646 
5647 
5649 
5658  hash<InsertOperatorInfo> iop_seq(string arg);
5659 
5660 
5662 
5671  hash<InsertOperatorInfo> iop_seq_currval(string arg);
5672 
5674 
5676  const SqlUtilDrivers = ...;
5677 
5678 
5679  // private variable to store the closure used to deserialize datasources (if any)
5680  extern code ds_get;
5681 
5682  // private variable to store the closure used to serialize datasources (if any)
5683  extern code ds_do;
5684 
5687 
5688 
5691 
5692 
5693  // private function used to deserialize datasources
5694  AbstractDatasource sqlutil_get_ds(string type, string config);
5695 
5696 
5697  // private function used to serialize datasources
5698  hash<auto> sqlutil_ds(AbstractDatasource ds);
5699 
5700 
5702 class AbstractHashContainer : public Serializable {
5703 
5704 public:
5705 
5706 
5707 protected:
5710 
5711 public:
5712 
5715 
5716 
5719 
5720 
5723 
5724 
5726 
5741  auto memberGate(string k);
5742 
5743 
5745 
5752 
5753 
5755  abstract auto take(string k);
5756 
5758  renameKey(string old_name, string new_name);
5759 
5760 
5762  *hash<auto> getHash();
5763 
5764 
5766 
5775  bool matchKeys(hash h1);
5776 
5777 
5779 
5788  bool matchKeys(list<auto> l);
5789 
5790 
5792 
5802 
5803 
5805 
5815 
5816 
5818 
5827  bool partialMatchKeys(list<auto> l);
5828 
5829 
5831 
5841 
5842 
5844 
5853  bool val();
5854 
5855 
5857 
5864  list<string> keys();
5865 
5866 
5868 
5875  list<auto> values();
5876 
5877 
5879 
5887 
5888 
5890 
5898 
5899 
5901 
5909 
5910 
5912  bool empty();
5913 
5914 
5916 
5923  int size();
5924 
5925 
5927 
5936  bool hasKey(string k);
5937 
5938 
5940 
5949  bool hasKeyValue(string k);
5950 
5951 
5953 
5962  *string firstKey();
5963 
5964 
5966 
5975  *string lastKey();
5976 
5977 
5979  abstract string getElementName();
5980  };
5981 
5983 class AbstractListContainer : public Serializable {
5984 
5985 public:
5986 
5987 
5988 protected:
5989  softlist l;
5990 
5991 public:
5992 
5994  constructor(softlist nl);
5995 
5996 
5998 
6009  abstract auto get(softint i);
6010 
6012  add(auto val);
6013 
6014 
6016  auto take(int i);
6017 
6018 
6020  list<auto> getList();
6021 
6022 
6024 
6033  bool val();
6034 
6035 
6037 
6045 
6046 
6048  bool empty();
6049 
6050 
6052 
6059  int size();
6060 
6061 
6063  abstract string getElementName();
6064 
6065 protected:
6066  checkIndex(int i);
6067 public:
6068 
6069  };
6070 
6073 
6074 public:
6077 
6078 
6080  constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
6081 
6082 
6084  constructor(AbstractDatasource ds);
6085 
6086 
6088  add(string k, Table val);
6089 
6090 
6092  add(string k, AbstractTable val);
6093 
6094 
6097 
6098 
6101 
6102 
6104  AbstractTable take(string k);
6105 
6106 
6108  populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
6109 
6110 
6112  populate(AbstractDatasource ds);
6113 
6114 
6116 
6132  *list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
6133 
6134 
6136 
6152 
6153 
6155  string getElementName();
6156 
6157 
6159  *AbstractTable getIfExists(AbstractDatasource ds, string name);
6160 
6161 
6163  AbstractTable get(AbstractDatasource ds, string name);
6164 
6165 
6167 
6182  *string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
6183 
6184 
6186 
6197  bool tableRenamed(string old_name, string new_name, string old_sql_name);
6198 
6199 
6200 protected:
6201  tableRenamedIntern(string old_name, string new_name, string oldsn);
6202 public:
6203 
6204 
6206 
6221  *string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
6222 
6223 
6224  list<auto> getCreateList();
6225 
6226 
6227  Qore::AbstractIterator createIterator();
6228 
6229 
6231 
6239  list<auto> getDropList();
6240 
6241 
6243 
6251 
6252 
6253 protected:
6254  getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
6255 public:
6256 
6257  };
6258 
6261 
6262 public:
6265 
6266 
6269 
6270 
6272  add(string k, AbstractColumn val);
6273 
6274 
6277 
6278 
6280 
6296 
6297 
6299  Columns subset(softlist l);
6300 
6301 
6303  string getElementName();
6304 
6305 
6307  bool equal(Columns cols);
6308 
6309 
6311  AbstractIterator getSqlColumnNameIterator();
6312 
6313  };
6314 
6316 class AbstractDdlObject : public Serializable {
6317 
6318 public:
6320  string name;
6321 
6323  string ddl_name;
6324 
6326 protected:
6328 public:
6329 
6330 
6333 
6334 
6336 
6338  abstract string getDdlName(string name);
6339  };
6340 
6343 
6344 public:
6346  string native_type;
6347 
6349  *string qore_type;
6350 
6352  int size;
6353 
6355  bool nullable;
6356 
6358  *string def_val;
6359 
6361  *string comment;
6362 
6364  *int scale;
6365 
6368 
6370 protected:
6372 public:
6373 
6374 
6375  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c, *int scale)
6376  ;
6377 
6378 
6380 
6384  hash<GenericColumnInfo> getDescriptionHash();
6385 
6386 
6388 
6391 
6392 
6395 
6396 
6398 
6407  abstract list<auto> getAddColumnSql(AbstractTable t);
6408 
6410  string getDropSql(string table_name);
6411 
6412 
6414 
6427  list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
6428 
6429 
6431 
6441  abstract string getRenameSql(AbstractTable t, string new_name);
6442 
6445 
6446 
6448 protected:
6449  abstract bool equalImpl(AbstractColumn c);
6450 public:
6451 
6453 
6469 protected:
6470  abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
6471 public:
6472  };
6473 
6476 
6477 public:
6478  constructor(*hash c) ;
6479 
6480 
6482  add(string k, AbstractIndex val);
6483 
6484 
6487 
6488 
6490  AbstractIndex take(string k);
6491 
6492 
6495 
6496 
6498 
6514 
6515 
6516  string getElementName();
6517 
6518  };
6519 
6521 class AbstractIndex : public Serializable {
6522 
6523 public:
6525  string name;
6526 
6528  bool unique;
6529 
6532 
6533 protected:
6536 
6539 
6540 public:
6541 
6543  constructor(string n, bool u, hash c);
6544 
6545 
6547  string getName();
6548 
6549 
6551  bool hasColumn(string cname);
6552 
6553 
6555  abstract string getCreateSql(string table_name, *hash<auto> opt);
6556 
6558  string getDropSql(string table_name);
6559 
6560 
6563 
6564 
6567 
6568 
6570  abstract bool equalImpl(AbstractIndex ix);
6571 
6573  abstract string getRenameSql(string table_name, string new_name);
6574 
6577 
6578 
6581 
6582 
6585 
6586 
6589 
6590 
6593 
6594 
6597 
6598 
6600  *list<AbstractColumnConstraint> getAllSupportingConstraints();
6601 
6602 
6604  list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
6605 
6606  };
6607 
6610 
6611 public:
6612  constructor(*hash c) ;
6613 
6614 
6617 
6618 
6621 
6622 
6625 
6626 
6628 
6644 
6645 
6646  string getElementName();
6647 
6648  };
6649 
6651 class AbstractConstraint : public Serializable {
6652 
6653 public:
6654 
6655 
6656 protected:
6658  string name;
6659 
6660 public:
6661 
6663  constructor(string n);
6664 
6665 
6667  string getName();
6668 
6669 
6671  rename(string n);
6672 
6673 
6675  abstract string getCreateSql(string table_name, *hash<auto> opt);
6676 
6678  string getDropSql(string table_name);
6679 
6680 
6682  abstract list<auto> getRenameSql(string table_name, string new_name);
6683 
6685  string getDisableSql(string table_name);
6686 
6687 
6689  string getEnableSql(string table_name, *hash<auto> opt);
6690 
6691 
6694 
6695 
6697 protected:
6698  abstract bool equalImpl(AbstractConstraint c);
6699 public:
6700 
6702  abstract bool setIndexBase(string ix);
6703 
6705  abstract clearIndex();
6706 
6708  bool hasColumn(string cname);
6709 
6710  };
6711 
6714 
6715 public:
6717  string src;
6718 
6720  constructor(string n, string n_src) ;
6721 
6722 
6724 protected:
6726 public:
6727 
6728 
6730  bool setIndexBase(string ix);
6731 
6732 
6735 
6736  };
6737 
6740 
6741 public:
6742 protected:
6744  *string index;
6745 
6746 public:
6747 
6749  constructor(string name, *hash<auto> cols, *string index) ;
6750 
6751 
6753  constructor(string name, Columns cols, *string index) ;
6754 
6755 
6757  bool setIndexBase(string ix);
6758 
6759 
6762 
6763  };
6764 
6767 
6768 public:
6769 protected:
6771  *hash<string, hash<string, AbstractForeignConstraint>> sourceConstraints;
6772 
6773 public:
6774 
6776  constructor(string name, *hash<auto> cols, *string index) ;
6777 
6778 
6780  constructor(string name, Columns cols, *string index) ;
6781 
6782 
6784 
6789 
6790 
6792  hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
6793 
6794 
6797 
6798 
6800 
6811 
6812 
6814  removeSourceConstraint(string tname, list<auto> cols);
6815 
6816 
6818  renameSourceConstraintTable(string old_name, string new_name);
6819 
6820 
6822  bool hasColumn(string cname);
6823 
6824 
6826  *string getIndex();
6827 
6828 
6830 protected:
6832 public:
6833 
6834 
6836  abstract string getCreateSql(string table_name, *hash<auto> opts);
6837  };
6838 
6841 
6842 public:
6844  constructor(string n, *hash<auto> c, *string n_index) ;
6845 
6846  };
6847 
6850 
6851 public:
6852  constructor() ;
6853 
6854 
6855  constructor(string n, *hash<auto> c) ;
6856 
6857  };
6858 
6861 
6862 public:
6863  constructor(*hash<auto> c) ;
6864 
6865 
6868 
6869 
6872 
6873 
6876 
6877 
6879 
6895 
6896 
6898  *hash<auto> findConstraintOn(string table, softlist<auto> cols);
6899 
6900 
6902  string getElementName();
6903 
6904  };
6905 
6907 class ForeignConstraintTarget : public Serializable {
6908 
6909 public:
6911  string table;
6912 
6915 
6917  constructor(string t, Columns c);
6918 
6919 
6922 
6923  };
6924 
6927 
6928 public:
6931 
6932  constructor(string name, Columns cols, ForeignConstraintTarget t) ;
6933 
6934 
6936 protected:
6938 public:
6939 
6940  };
6941 
6943 class AbstractSequence : public Serializable {
6944 
6945 public:
6947  string name;
6948 
6951 
6954 
6957 
6959  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
6960 
6961 
6963  abstract string getCreateSql(*hash<auto> opt);
6964 
6966 
6968  string getDropSql(*hash<auto> opt);
6969 
6970 
6972 
6975  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6976  };
6977 
6979 class AbstractView : public Serializable {
6980 
6981 public:
6982  // ! potential object schema
6983  *string schema;
6984 
6986  string name;
6987 
6989  string src;
6990 
6993 
6995  constructor(string n_name, string n_src);
6996 
6997 
6999  abstract string getCreateSql(*hash<auto> opt);
7000 
7002 
7004  string getDropSql(*hash<auto> opt);
7005 
7006 
7008 
7011  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
7012  };
7013 
7015 class AbstractFunctionBase : public Serializable {
7016 
7017 public:
7019  string name;
7020 
7022  string type;
7023 
7025  string src;
7026 
7028 
7032  constructor(string n, string n_type, string n_src);
7033 
7034 
7036  string getType();
7037 
7038 
7040 
7042  string getDropSql(*hash<auto> opt);
7043 
7044 
7047 
7048 
7050  string getNormalizedSource(string src);
7051 
7052 
7054 protected:
7056 public:
7057  };
7058 
7061 
7062 public:
7064 
7068  constructor(string n, string n_type, string n_src) ;
7069 
7070 
7072  abstract list<auto> getCreateSql(*hash<auto> opt);
7073 
7075 
7078  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
7079 
7081  setName(string new_name);
7082 
7083  };
7084 
7087 
7088 public:
7089  constructor(*hash c) ;
7090 
7091 
7094 
7095 
7098 
7099 
7101 
7117 
7118 
7119  string getElementName();
7120 
7121  };
7122 
7125 
7126 public:
7128  constructor(string n, string n_src) ;
7129 
7130 
7132  abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
7133 
7135  abstract softlist<auto> getRenameSql(string table_name, string new_name);
7136 
7138  abstract list<auto> getDropSql(string table_name);
7139  };
7140 
7143 
7144 public:
7145  constructor(*hash c) ;
7146 
7147 
7150 
7151 
7154 
7155 
7157 
7173 
7174 
7175  string getElementName();
7176 
7177  };
7178 };
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:6713
string src
the source of the check clause
Definition: SqlUtil.qm.dox.h:6717
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:6739
*string index
the index supporting the constraint
Definition: SqlUtil.qm.dox.h:6744
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:6342
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:6346
*string comment
comment on the column
Definition: SqlUtil.qm.dox.h:6361
*string def_val
default value for column
Definition: SqlUtil.qm.dox.h:6358
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:6349
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:6355
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:6367
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:6352
*int scale
the scale for numeric columns
Definition: SqlUtil.qm.dox.h:6364
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:6766
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:6771
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:6651
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:6658
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:6316
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:6323
string name
the name of the object
Definition: SqlUtil.qm.dox.h:6320
constructor(string name)
creates the object from the name
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:6926
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:6930
base class for function or objects with code
Definition: SqlUtil.qm.dox.h:7015
string getNormalizedSource(string src)
returns normalized source for comparisons
string name
the name of the object
Definition: SqlUtil.qm.dox.h:7019
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:7025
string type
the type of object
Definition: SqlUtil.qm.dox.h:7022
string getType()
returns the type of object
base class for functions
Definition: SqlUtil.qm.dox.h:7060
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:5702
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:5709
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:6521
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:6538
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:6525
*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:6528
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition: SqlUtil.qm.dox.h:6535
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:6531
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:5983
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:6849
base class for sequences
Definition: SqlUtil.qm.dox.h:6943
*number max
the ending number
Definition: SqlUtil.qm.dox.h:6956
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6947
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:6950
number increment
the increment
Definition: SqlUtil.qm.dox.h:6953
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:7124
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:6840
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:6979
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:6992
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6986
constructor(string n_name, string n_src)
creates the object from the arguments
string src
the source code
Definition: SqlUtil.qm.dox.h:6989
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:6260
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:6609
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:6907
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:6914
string table
the name of the target table
Definition: SqlUtil.qm.dox.h:6911
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6860
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:7086
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:6475
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:6072
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:7142
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:2508
const DT_YEAR
Format unit: year.
Definition: SqlUtil.qm.dox.h:3572
const COP_OVER
the SQL "over" clause
Definition: SqlUtil.qm.dox.h:2528
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:2578
const COP_LENGTH
to get the length of a text field
Definition: SqlUtil.qm.dox.h:2595
const COP_RANK
Analytic (window) function: RANK.
Definition: SqlUtil.qm.dox.h:2653
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition: SqlUtil.qm.dox.h:2483
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4303
const COP_COALESCE
to return the first non-null argument in the list
Definition: SqlUtil.qm.dox.h:2583
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:4308
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:2436
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:4293
const SZ_NONE
the data type does not take a size parameter
Definition: SqlUtil.qm.dox.h:2444
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4313
const COP_MIN
to return the minimum value
Definition: SqlUtil.qm.dox.h:2503
const DB_SYNONYMS
Feature: synonyms.
Definition: SqlUtil.qm.dox.h:2416
const DB_PACKAGES
Feature: packages.
Definition: SqlUtil.qm.dox.h:2404
const DefaultUopMap
a hash of valid update operators
Definition: SqlUtil.qm.dox.h:3598
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition: SqlUtil.qm.dox.h:2568
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:2543
const IOP_SEQ
for using the value of a sequence
Definition: SqlUtil.qm.dox.h:5621
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:3584
const VARCHAR
specifies a VARCHAR column (equivalent to Qore::Type::String)
Definition: SqlUtil.qm.dox.h:2424
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:4353
const JopMap
a hash of valid join operators
Definition: SqlUtil.qm.dox.h:3809
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:4358
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:2553
const DefaultExpressionMap
Default expressions to be supported by all SqlUtil modules.
Definition: SqlUtil.qm.dox.h:4376
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:5083
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:5676
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:2402
const COP_COUNT
to return the row count
Definition: SqlUtil.qm.dox.h:2523
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:2548
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:4363
const COP_AVG
to return the average value
Definition: SqlUtil.qm.dox.h:2513
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:3587
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4333
const COP_PLUS
the SQL "plus" operator
Definition: SqlUtil.qm.dox.h:2538
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition: SqlUtil.qm.dox.h:2611
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:5629
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:3575
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition: SqlUtil.qm.dox.h:2453
const COP_SUBSTR
to extract a substring from a column
Definition: SqlUtil.qm.dox.h:2588
const COP_SEQ
to return the next value of a sequence
Definition: SqlUtil.qm.dox.h:2573
const SZ_MAND
the data type takes a mandatory size parameter
Definition: SqlUtil.qm.dox.h:2447
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:2478
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition: SqlUtil.qm.dox.h:2433
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:2406
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:2646
const COP_NTILE
Analytic (window) function: NTILE.
Definition: SqlUtil.qm.dox.h:2639
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:4288
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4323
const COP_YEAR_MONTH
to return a date value with year to month information
Definition: SqlUtil.qm.dox.h:2558
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:4348
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
const DB_TABLES
Feature: tables.
Definition: SqlUtil.qm.dox.h:2410
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:2473
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:2493
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:2414
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:2463
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:2468
const JOP_INNER
for standard inner joins
Definition: SqlUtil.qm.dox.h:3796
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4298
const DT_HOUR
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3581
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition: SqlUtil.qm.dox.h:2660
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:2450
const CHAR
specifies a CHAR column
Definition: SqlUtil.qm.dox.h:2430
const COP_YEAR_DAY
to return a date value with year to day information
Definition: SqlUtil.qm.dox.h:2563
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:4338
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition: SqlUtil.qm.dox.h:2427
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition: SqlUtil.qm.dox.h:4318
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4368
const COP_UPPER
to return column value in upper case
Definition: SqlUtil.qm.dox.h:2488
const JOP_RIGHT
for right outer joins
Definition: SqlUtil.qm.dox.h:3806
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:2618
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:5626
const COP_TRUNC_DATE
to return the date with truncated value
Definition: SqlUtil.qm.dox.h:2604
const COP_MINUS
the SQL "minus" operator
Definition: SqlUtil.qm.dox.h:2533
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:2632
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition: SqlUtil.qm.dox.h:2625
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:2696
const DB_FUNCTIONS
Features constants.
Definition: SqlUtil.qm.dox.h:2400
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:2498
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4373
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:4328
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:3578
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:2408
const DB_TYPES
Feature: named types.
Definition: SqlUtil.qm.dox.h:2412
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4343
const COP_SUM
to return the sum value
Definition: SqlUtil.qm.dox.h:2518
const OP_LIKE
the SQL "like" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4283
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:3801
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:2329
string cop
the column operator string code
Definition: SqlUtil.qm.dox.h:2330
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2332
auto column
column sopecifier, may be a string or a complex hash
Definition: SqlUtil.qm.dox.h:2331
generic column description hash in schema descriptions
Definition: SqlUtil.qm.dox.h:2299
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:2315
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:2317
auto default_value
the default value for the column
Definition: SqlUtil.qm.dox.h:2309
softint scale
for numeric data types, this value gives the scale
Definition: SqlUtil.qm.dox.h:2307
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition: SqlUtil.qm.dox.h:2305
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:2311
*string comment
an optional comment for the column
Definition: SqlUtil.qm.dox.h:2313
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:2301
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:2303
*bool auto_increment
True for DBs that support an auto-increment column
Definition: SqlUtil.qm.dox.h:2319
insert operator info hash as returned by all insert operator functions
Definition: SqlUtil.qm.dox.h:2336
string _iop
the insert operator string code
Definition: SqlUtil.qm.dox.h:2337
any arg
optional argument
Definition: SqlUtil.qm.dox.h:2338
join operator info hash as returned by all join operator functions
Definition: SqlUtil.qm.dox.h:2349
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition: SqlUtil.qm.dox.h:2354
*string alias
optional alias for table in the query
Definition: SqlUtil.qm.dox.h:2352
*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:2355
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition: SqlUtil.qm.dox.h:2351
*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:2353
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition: SqlUtil.qm.dox.h:2356
string jop
the join operator string code
Definition: SqlUtil.qm.dox.h:2350
SQL operator info hash as returned by all operator functions.
Definition: SqlUtil.qm.dox.h:2323
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2325
string op
the operator string code
Definition: SqlUtil.qm.dox.h:2324
Query information.
Definition: SqlUtil.qm.dox.h:2663
*hash< auto > expression_map
The expression map.
Definition: SqlUtil.qm.dox.h:2683
*hash< string, AbstractTable > join_map
Tables in this join; table alias -> table.
Definition: SqlUtil.qm.dox.h:2674
*hash< auto > pseudo_column_map
Any valid pseudocolumns or aliases generated in th query.
Definition: SqlUtil.qm.dox.h:2680
*hash< auto > where_operator_map
The old-style backwards-compatible "where operator" map.
Definition: SqlUtil.qm.dox.h:2686
object table
The primary table object.
Definition: SqlUtil.qm.dox.h:2665
*hash< auto > query_hash
The original query hash.
Definition: SqlUtil.qm.dox.h:2668
*hash< auto > column_operator_map
Any custom column operator map.
Definition: SqlUtil.qm.dox.h:2689
list< auto > args
arguments to bind in the query generated
Definition: SqlUtil.qm.dox.h:2692
*hash< auto > query_options
Any query options.
Definition: SqlUtil.qm.dox.h:2671
*hash< string, bool > subquery_column_map
When executing a superquery, we can only reference colums in the subquery.
Definition: SqlUtil.qm.dox.h:2677
A hash describing SQL and arguments for an SQL DML command.
Definition: SqlUtil.qm.dox.h:2385
string sql
the SQL string for the update
Definition: SqlUtil.qm.dox.h:2387
list< auto > args
the arguments for the string
Definition: SqlUtil.qm.dox.h:2390
column data type options
Definition: SqlUtil.qm.dox.h:2360
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition: SqlUtil.qm.dox.h:2371
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition: SqlUtil.qm.dox.h:2365
*softint maxlen
optional additional limit to the maximum length of the data
Definition: SqlUtil.qm.dox.h:2379
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition: SqlUtil.qm.dox.h:2368
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition: SqlUtil.qm.dox.h:2374
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition: SqlUtil.qm.dox.h:2362
update operator info hash as returned by all update operator functions
Definition: SqlUtil.qm.dox.h:2342
*hash nest
option nested operation hash
Definition: SqlUtil.qm.dox.h:2345
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2344
string uop
the update operator string code
Definition: SqlUtil.qm.dox.h:2343