Qore SqlUtil Module Reference  1.6
SqlUtil.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SqlUtil.qm Copyright (C) 2013 - 2020 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 
2120 namespace SqlUtil {
2123  public struct GenericColumnInfo {
2125  string qore_type;
2127  string native_type;
2129  softint size;
2131  softint scale;
2137  *string comment;
2139  bool notnull = False;
2141  hash<string, hash> driver;
2144  };
2145 
2147  public struct OperatorInfo {
2148  string op;
2149  auto arg;
2150  };
2151 
2153  public struct ColumnOperatorInfo {
2154  string cop;
2155  auto column;
2156  auto arg;
2157  };
2158 
2160  public struct InsertOperatorInfo {
2161  string _iop;
2162  any arg;
2163  };
2164 
2166  public struct UpdateOperatorInfo {
2167  string uop;
2168  auto arg;
2170  };
2171 
2173  public struct JoinOperatorInfo {
2174  string jop;
2175  auto table;
2176  *string alias;
2179  *string ta;
2180  *hash<auto> opt;
2181  };
2182 
2186  *string date_format;
2187 
2189  *TimeZone data_timezone;
2190 
2192  *TimeZone db_timezone;
2193 
2195  *string number_format;
2196 
2198  *softbool mandatory;
2199 
2201 
2203  *softint maxlen;
2204  };
2205 
2207 
2209  public struct SqlCommandInfo {
2211  string sql;
2212 
2214  list<auto> args;
2215  };
2216 
2221 
2224  const DB_FUNCTIONS = "functions";
2226  const DB_MVIEWS = "materialized views";
2228  const DB_PACKAGES = "packages";
2230  const DB_PROCEDURES = "procedures";
2232  const DB_SEQUENCES = "sequences";
2234  const DB_TABLES = "tables";
2236  const DB_TYPES = "named types";
2238  const DB_VIEWS = "views";
2240  const DB_SYNONYMS = "synonyms";
2242 
2243  /* @defgroup SqlTypeConstants SQL Type Constants
2244  These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
2245  */
2247  const VARCHAR = "string";
2249 
2251  const NUMERIC = "number";
2252 
2254  const CHAR = "char";
2255 
2257  const BLOB = "blob";
2258 
2260  const CLOB = "clob";
2262 
2267  const SZ_NONE = 0;
2269 
2271  const SZ_MAND = 1;
2272 
2274  const SZ_OPT = 2;
2275 
2277  const SZ_NUM = 3;
2279 
2284 
2287  const COP_AS = "as";
2288 
2290 
2292  const COP_CAST = "cast";
2293 
2295 
2297  const COP_PREPEND = "prepend";
2298 
2300 
2302  const COP_APPEND = "append";
2303 
2305 
2307  const COP_VALUE = "value";
2308 
2310 
2312  const COP_UPPER = "upper";
2313 
2315 
2317  const COP_LOWER = "lower";
2318 
2320 
2322  const COP_DISTINCT = "distinct";
2323 
2325 
2327  const COP_MIN = "min";
2328 
2330 
2332  const COP_MAX = "max";
2333 
2335 
2337  const COP_AVG = "avg";
2338 
2340 
2342  const COP_SUM = "sum";
2343 
2345 
2347  const COP_COUNT = "count";
2348 
2350 
2352  const COP_OVER = "over";
2353 
2355 
2357  const COP_MINUS = "minus";
2358 
2360 
2362  const COP_PLUS = "plus";
2363 
2365 
2367  const COP_DIVIDE = "divide";
2368 
2370 
2372  const COP_MULTIPLY = "multiply";
2373 
2375 
2377  const COP_YEAR = "year";
2378 
2380 
2382  const COP_YEAR_MONTH = "year_month";
2383 
2385 
2387  const COP_YEAR_DAY = "year_day";
2388 
2390 
2392  const COP_YEAR_HOUR = "year_hour";
2393 
2395 
2397  const COP_SEQ = "seq";
2398 
2400 
2402  const COP_SEQ_CURRVAL = "seq_currval";
2403 
2405 
2407  const COP_COALESCE = "coalesce";
2408 
2410 
2412  const COP_SUBSTR = "substr";
2413 
2415 
2419  const COP_LENGTH = "length";
2420 
2422 
2428  const COP_TRUNC_DATE = "truncate_date";
2429 
2431 
2435  const COP_CUME_DIST = "cume_dist";
2436 
2438 
2442  const COP_DENSE_RANK = "dense_rank";
2443 
2445 
2449  const COP_FIRST_VALUE = "first_value";
2450 
2452 
2456  const COP_LAST_VALUE = "last_value";
2457 
2459 
2463  const COP_NTILE = "ntile";
2464 
2466 
2470  const COP_PERCENT_RANK = "percent_rank";
2471 
2473 
2477  const COP_RANK = "rank";
2478 
2480 
2484  const COP_ROW_NUMBER = "row_number";
2485 
2487  const DefaultCopMap = (
2488  COP_AS: (
2489  "arg": Type::String,
2490  "withalias": True,
2491  "code": string (string cve, string arg, reference<hash<auto>> psch) {
2492  // issue #2163: make sure the unquoted alias is inserted in the map
2493  if (arg ==1)
2494  psch{arg.substr(1, -1)} = cve;
2495  else
2496  psch{arg} = cve;
2497  return sprintf("%s as %s", cve, arg);
2498  },
2499  ),
2500  COP_PREPEND: (
2501  "arg": Type::String,
2502  "sqlvalue": True,
2503  "code": string (string cve, string arg) {
2504  return sprintf("%s || %s", arg, cve);
2505  },
2506  ),
2507  COP_APPEND: (
2508  "arg": Type::String,
2509  "sqlvalue": True,
2510  "code": string (string cve, string arg) {
2511  return sprintf("%s || %s", cve, arg);
2512  },
2513  ),
2514  COP_VALUE: (
2515  "sqlvalue": True,
2516  "nocolumn": True,
2517  "code": string (*string cve, auto arg) {
2518  return arg;
2519  },
2520  ),
2521  COP_UPPER: (
2522  "code": string (string cve, auto arg) {
2523  return sprintf("upper(%s)", cve);
2524  },
2525  ),
2526  COP_LOWER: (
2527  "code": string (string cve, auto arg) {
2528  return sprintf("lower(%s)", cve);
2529  },
2530  ),
2531  COP_DISTINCT: (
2532  "code": string (string cve, auto arg) {
2533  return sprintf("distinct %s", cve);
2534  },
2535  ),
2536  COP_MIN: (
2537  "code": string (string cve, auto arg) {
2538  return sprintf("min(%s)", cve);
2539  },
2540  "group": True,
2541  ),
2542  COP_MAX: (
2543  "code": string (string cve, auto arg) {
2544  return sprintf("max(%s)", cve);
2545  },
2546  "group": True,
2547  ),
2548  COP_AVG: (
2549  "code": string (string cve, auto arg) {
2550  return sprintf("avg(%s)", cve);
2551  },
2552  "group": True,
2553  ),
2554  COP_SUM: (
2555  "code": string (string cve, auto arg) {
2556  return sprintf("sum(%s)", cve);
2557  },
2558  "group": True,
2559  ),
2560  COP_COUNT: (
2561  "nocolumn": True,
2562  "code": string (*string cve, auto arg) {
2563  return sprintf("count(%s)", cve ? cve : "*");
2564  },
2565  ),
2566  COP_MINUS: (
2567  "argcolumn": True,
2568  "code": string (string arg1, string arg2) {
2569  return sprintf("%s - %s", arg1, arg2);
2570  },
2571  ),
2572  COP_PLUS: (
2573  "argcolumn": True,
2574  "code": string (string arg1, string arg2) {
2575  return sprintf("%s + %s", arg1, arg2);
2576  },
2577  ),
2578  COP_DIVIDE: (
2579  "argcolumn": True,
2580  "code": string (string arg1, string arg2) {
2581  return sprintf("%s / %s", arg1, arg2);
2582  },
2583  ),
2584  COP_MULTIPLY: (
2585  "argcolumn": True,
2586  "code": string (string arg1, string arg2) {
2587  return sprintf("%s * %s", arg1, arg2);
2588  },
2589  ),
2590  COP_SEQ: (
2591  "nocolumn": True,
2592  "code": string (*string cve, hash<auto> arg) {
2593  throw "SEQUENCE-ERROR", sprintf("cannot select sequence %y because this database does not support sequences", arg.seq);
2594  }
2595  ),
2596  COP_SEQ_CURRVAL: (
2597  "nocolumn": True,
2598  "code": string (*string cve, hash<auto> arg) {
2599  throw "SEQUENCE-ERROR", sprintf("cannot select the current value of sequence %y because this database does not support sequences", arg.seq);
2600  }
2601  ),
2602  COP_COALESCE: (
2603  "columnargs": True,
2604  "code": string (*string cve, hash<auto> arg) {
2605  return sprintf("coalesce(%s)", (foldl $1 + "," + $2, arg.args));
2606  }
2607  ),
2608  COP_SUBSTR: (
2609  "code": string (string cve, list<auto> args) {
2610  if (!exists args[1])
2611  return sprintf("substring(%s from %d)", cve, args[0]);
2612  return sprintf("substring(%s from %d for %d)", cve, args[0], args[1]);
2613  },
2614  ),
2615  COP_LENGTH: (
2616  "code": string (string cve, auto arg) {
2617  return sprintf("length(%s)", cve);
2618  },
2619  ),
2620  COP_OVER: (
2621  "columnargs" : True,
2622  "columnargs_ignore_nothings" : True,
2623  "code": string (*string cve, hash<auto> args)
2624  {
2625  *string partitionby = args.args[0];
2626  *string orderby = args.args[1];
2627  if (!exists partitionby && exists orderby);
2628 
2629  string sql = cve + " over (";
2630  if (exists partitionby)
2631  sql += sprintf("partition by %s", partitionby); // TODO/FIXME: sql injection!
2632  if (exists orderby)
2633  sql += sprintf(" order by %s", orderby); // TODO/FIXME: sql injection!
2634  sql += ")";
2635  return sql;
2636  },
2637  ),
2638  COP_CUME_DIST: (
2639  "nocolumn": True,
2640  "code": string (*string cve, auto arg) {
2641  return "cume_dist()";
2642  },
2643  ),
2644  COP_DENSE_RANK: (
2645  "nocolumn": True,
2646  "code": string (*string cve, auto arg) {
2647  return "dense_rank()";
2648  },
2649  ),
2650  COP_FIRST_VALUE: (
2651  "code": string (string cve) {
2652  return sprintf("first_value(%s)", cve);
2653  },
2654  ),
2655  COP_LAST_VALUE: (
2656  "code": string (string cve) {
2657  return sprintf("last_value(%s)", cve);
2658  },
2659  ),
2660  COP_NTILE: (
2661  "sqlvalue": True,
2662  "nocolumn": True,
2663  "code": string (*string cve, auto arg) {
2664  return sprintf("ntile(%d)", arg);
2665  },
2666  ),
2667  COP_PERCENT_RANK: (
2668  "nocolumn": True,
2669  "code": string (*string cve, auto arg) {
2670  return "percent_rank()";
2671  },
2672  ),
2673  COP_RANK: (
2674  "nocolumn": True,
2675  "code": string (*string cve, auto arg) {
2676  return "rank()";
2677  },
2678  ),
2679  COP_ROW_NUMBER: (
2680  "nocolumn": True,
2681  "code": string (*string cve, auto arg) {
2682  return "row_number()";
2683  },
2684  ),
2685  );
2687 
2729 
2738  hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
2739 
2740 
2742 
2754  hash<ColumnOperatorInfo> cop_as(auto column, string arg);
2755 
2756 
2758 
2772  hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
2773 
2774 
2776 
2786  hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
2787 
2788 
2790 
2800  hash<ColumnOperatorInfo> cop_append(auto column, string arg);
2801 
2802 
2804 
2932  hash<ColumnOperatorInfo> cop_value(auto arg);
2933 
2934 
2936 
2945  hash<ColumnOperatorInfo> cop_upper(auto column);
2946 
2947 
2949 
2958  hash<ColumnOperatorInfo> cop_lower(auto column);
2959 
2960 
2962 
2971  hash<ColumnOperatorInfo> cop_distinct(auto column);
2972 
2973 
2975 
2984  hash<ColumnOperatorInfo> cop_min(auto column);
2985 
2986 
2988 
2997  hash<ColumnOperatorInfo> cop_max(auto column);
2998 
2999 
3001 
3010  hash<ColumnOperatorInfo> cop_avg(auto column);
3011 
3012 
3014 
3023  hash<ColumnOperatorInfo> cop_sum(auto column);
3024 
3025 
3027 
3034  hash<ColumnOperatorInfo> cop_count(auto column = '');
3035 
3036 
3038 
3045  hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
3046 
3047 
3049 
3059  hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
3060 
3061 
3063 
3073  hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
3074 
3075 
3077 
3087  hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
3088 
3089 
3091 
3101  hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
3102 
3103 
3105 
3114  hash<ColumnOperatorInfo> cop_year(auto column);
3115 
3116 
3118 
3127  hash<ColumnOperatorInfo> cop_year_month(auto column);
3128 
3129 
3131 
3140  hash<ColumnOperatorInfo> cop_year_day(auto column);
3141 
3142 
3144 
3153  hash<ColumnOperatorInfo> cop_year_hour(auto column);
3154 
3155 
3157 
3167  hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
3168 
3169 
3171 
3181  hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
3182 
3183 
3185 
3197  hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
3198 
3199 
3201 
3212  hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
3213 
3214 
3216 
3227  hash<ColumnOperatorInfo> cop_length(auto column);
3228 
3229 
3231 
3245  hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
3246 
3247 
3248 
3250 
3278  hash<ColumnOperatorInfo> cop_cume_dist();
3279 
3280 
3282 
3310  hash<ColumnOperatorInfo> cop_dense_rank();
3311 
3312 
3314 
3342  hash<ColumnOperatorInfo> cop_first_value(any column);
3343 
3344 
3346 
3374  hash<ColumnOperatorInfo> cop_last_value(any column);
3375 
3376 
3378 
3408  hash<ColumnOperatorInfo> cop_ntile(int value);
3409 
3410 
3412 
3440  hash<ColumnOperatorInfo> cop_percent_rank();
3441 
3442 
3444 
3472  hash<ColumnOperatorInfo> cop_rank();
3473 
3474 
3476 
3504  hash<ColumnOperatorInfo> cop_row_number();
3505 
3506 
3508 
3559  const DT_YEAR = "Y";
3561 
3563  const DT_MONTH = "M";
3564 
3566  const DT_DAY = "D";
3567 
3569  const DT_HOUR = "H";
3570 
3572  const DT_MINUTE = "m";
3573 
3575  const DT_SECOND = "S";
3576 
3577  // let's simulate and enum here'
3578  const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
3580 
3585  const DefaultUopMap = (
3587  COP_PREPEND: True,
3588  COP_APPEND: True,
3589  COP_UPPER: True,
3590  COP_LOWER: True,
3591  COP_MINUS: (
3592  "sqlvalue": True,
3593  "code": string (string cve, auto arg) {
3594  return sprintf("%s - %s", cve, arg);
3595  },
3596  ),
3597  COP_PLUS: (
3598  "sqlvalue": True,
3599  "code": string (string cve, auto arg) {
3600  return sprintf("%s + %s", cve, arg);
3601  },
3602  ),
3603  COP_DIVIDE: (
3604  "sqlvalue": True,
3605  "code": string (string cve, auto arg) {
3606  return sprintf("%s / %s", cve, arg);
3607  },
3608  ),
3609  COP_MULTIPLY: (
3610  "sqlvalue": True,
3611  "code": string (string cve, auto arg) {
3612  return sprintf("%s * %s", cve, arg);
3613  },
3614  ),
3615  COP_SUBSTR: True,
3616  COP_SEQ: (
3617  "nocolumn": True,
3618  "code": string (*string cve, string arg) {
3619  throw "SEQUENCE-ERROR", sprintf("cannot select sequence %y because this database does not support sequences", arg);
3620  }
3621  ),
3622  COP_SEQ_CURRVAL: (
3623  "nocolumn": True,
3624  "code": string (*string cve, string arg) {
3625  throw "SEQUENCE-ERROR", sprintf("cannot select the current value of sequence %y because this database does not support sequences", arg);
3626  }
3627  ),
3628  COP_COALESCE: (
3629  "columnargs": True,
3630  "code": string (*string cve, softlist<auto> args) {
3631  return sprintf("coalesce(%s)", (foldl $1 + "," + $2, args));
3632  }
3633  ),
3634  );
3636 
3658 
3667  hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
3668 
3669 
3671 
3681  hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
3682 
3683 
3685 
3695  hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
3696 
3697 
3699 
3708  hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
3709 
3710 
3712 
3721  hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
3722 
3723 
3725 
3736  hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
3737 
3738 
3740 
3750  hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
3751 
3752 
3754 
3764  hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
3765 
3766 
3768 
3778  hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
3779 
3780 
3782 
3792  hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
3793 
3794 
3796 
3805  hash<UpdateOperatorInfo> uop_seq(string seq);
3806 
3807 
3809 
3818  hash<UpdateOperatorInfo> uop_seq_currval(string seq);
3819 
3821 
3828 
3831  const JOP_INNER = "inner";
3832 
3834 
3836  const JOP_LEFT = "left";
3837 
3839 
3841  const JOP_RIGHT = "right";
3842 
3844  const JopMap = {
3845  JOP_INNER: "inner",
3846  JOP_LEFT: "left outer",
3847  JOP_RIGHT: "right outer",
3848  };
3850 
3860 
3864  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3865 
3866 
3868 
3872  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3873 
3874 
3876 
3895  hash<string, hash<JoinOperatorInfo>> join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3896 
3897 
3899 
3918  hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3919 
3920 
3922 
3941  hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3942 
3943 
3945 
3967  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3968 
3969 
3971 
3991  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3992 
3993 
3995 
4017  hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4018 
4019 
4021 
4040  hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4041 
4042 
4044 
4063  hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4064 
4065 
4067 
4088  hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4089 
4090 
4092 
4112  hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4113 
4114 
4116 
4136  hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4137 
4138 
4140 
4162  hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4163 
4164 
4166 
4185  hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4186 
4187 
4189 
4208  hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4209 
4210 
4212 
4233  hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4234 
4235 
4237 
4257  hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4258 
4259 
4261 
4281  hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4282 
4283 
4285 
4307  hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4308 
4310 
4315 
4318  const OP_LIKE = "like";
4319 
4321 
4323  const OP_LT = "<";
4324 
4326 
4328  const OP_LE = "<=";
4329 
4331 
4333  const OP_GT = ">";
4334 
4336 
4338  const OP_GE = ">=";
4339 
4341 
4343  const OP_NE = "!=";
4344 
4346 
4348  const OP_EQ = "=";
4349 
4351 
4353  const OP_CLT = "C<";
4354 
4356 
4358  const OP_CLE = "C<=";
4359 
4361 
4363  const OP_CGT = "C>";
4364 
4366 
4368  const OP_CGE = "C>=";
4369 
4371 
4373  const OP_CNE = "C!=";
4374 
4376 
4378  const OP_CEQ = "C=";
4379 
4381 
4383  const OP_BETWEEN = "between";
4384 
4386 
4388  const OP_IN = "in";
4389 
4391 
4393  const OP_NOT = "not";
4394 
4396 
4398  const OP_SUBSTR = "substr";
4399 
4401 
4403  const OP_OR = "or";
4404 
4406 
4408  const OP_IN_SELECT = "in_select";
4409 
4411  const DefaultOpMap = {
4412  OP_LIKE: (
4413 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4414  args += arg;
4415  return sprintf("%s like %v", cn);
4416  },
4417  ),
4418  OP_LT: (
4419 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4420  args += arg;
4421  return sprintf("%s < %v", cn);
4422  },
4423  ),
4424  OP_LE: (
4425 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4426  args += arg;
4427  return sprintf("%s <= %v", cn);
4428  },
4429  ),
4430  OP_GT: (
4431 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4432  args += arg;
4433  return sprintf("%s > %v", cn);
4434  },
4435  ),
4436  OP_GE: (
4437 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4438  args += arg;
4439  return sprintf("%s >= %v", cn);
4440  },
4441  ),
4442  OP_NE: (
4443 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4444  if (arg === NULL || !exists arg)
4445  return sprintf("%s is not null", cn);
4446  args += arg;
4447  return sprintf("(%s != %v or %s is null)", cn, cn);
4448  },
4449  ),
4450  OP_EQ: (
4451 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4452  if (arg === NULL || !exists arg)
4453  return sprintf("%s is null", cn);
4454  args += arg;
4455  return sprintf("%s = %v", cn);
4456  },
4457  ),
4458  OP_BETWEEN: (
4459 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4460  args += arg[0];
4461  args += arg[1];
4462  return sprintf("%s between %v and %v", cn);
4463  },
4464  ),
4465  OP_IN: (
4466 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4467  *string ins = (foldl $1 + "," + $2, (map t.getSqlValue($1), arg));
4468  return exists ins ? sprintf("%s in (%s)", cn, ins) : "1 != 1";
4469  },
4470  ),
4471  OP_IN_SELECT: {
4472 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch, *hash<auto> opt) {
4473  object subtable;
4474  if (arg.table.typeCode() == NT_STRING);
4475  else {
4476  subtable = arg.table;
4477  }
4478 
4479  list<auto> subargs;
4480  string subsql = subtable.getSelectSql(arg.select_hash, \subargs);
4481  args += subargs;
4482  return sprintf("%s in (%s)", cn, subsql);
4483  },
4484  "withopt": True,
4485  },
4486  OP_NOT: (
4487  "recursive": True,
4488 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4489  return sprintf("not (%s)", cn);
4490  },
4491  ),
4492  OP_CLT: (
4493  "argcolumn": True,
4494 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4495  return sprintf("%s < %s", cn, arg);
4496  },
4497  ),
4498  OP_CLE: (
4499  "argcolumn": True,
4500 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4501  return sprintf("%s <= %s", cn, arg);
4502  },
4503  ),
4504  OP_CGT: (
4505  "argcolumn": True,
4506 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4507  return sprintf("%s > %s", cn, arg);
4508  },
4509  ),
4510  OP_CGE: (
4511  "argcolumn": True,
4512 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4513  return sprintf("%s >= %s", cn, arg);
4514  },
4515  ),
4516  OP_CNE: (
4517  "argcolumn": True,
4518 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4519  return sprintf("%s != %s", cn, arg);
4520  },
4521  ),
4522  OP_CEQ: (
4523  "argcolumn": True,
4524 "code": string (object t, string cn, string arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4525  return sprintf("%s = %s", cn, arg);
4526  },
4527  ),
4528  OP_SUBSTR: (
4529 "code": string (object t, string cn, auto arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4530  args += arg[0]; // start
4531  if (!exists arg[1]);
4532 
4533  args += arg[1]; // count
4534  args += arg[2]; // text
4535  return sprintf("substring(%s from %v for %v) = %v", cn);
4536  },
4537  ),
4538  OP_OR: (
4539 "code": string (object t, string cn, list<auto> arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch) {
4540  return t.getOrClause(arg, \args, jch, join, ch, psch);
4541  },
4542  ),
4543  };
4545 
4569  hash<OperatorInfo> make_op(string op, auto arg);
4571 
4572 
4574 
4583  hash<OperatorInfo> op_like(string str);
4584 
4585 
4587 
4598  hash<OperatorInfo> op_lt(auto arg);
4599 
4600 
4602 
4613  hash<OperatorInfo> op_le(auto arg);
4614 
4615 
4617 
4628  hash<OperatorInfo> op_gt(auto arg);
4629 
4630 
4632 
4643  hash<OperatorInfo> op_ge(auto arg);
4644 
4645 
4647 
4660  hash<OperatorInfo> op_ne(auto arg);
4661 
4662 
4664 
4677  hash<OperatorInfo> op_eq(auto arg);
4678 
4679 
4681 
4693  hash<OperatorInfo> op_between(auto l, auto r);
4694 
4695 
4697 
4706  hash<OperatorInfo> op_in();
4707 
4708 
4710 
4717  hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
4718 
4719 
4721 
4728  hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
4729 
4730 
4732 
4739  hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
4740 
4741 
4743 
4754  hash<OperatorInfo> op_in(list<auto> args);
4755 
4756 
4758 
4765  hash<OperatorInfo> op_not(hash arg);
4766 
4767 
4769 
4780  hash<OperatorInfo> op_clt(string arg);
4781 
4782 
4784 
4795  hash<OperatorInfo> op_cle(string arg);
4796 
4797 
4799 
4810  hash<OperatorInfo> op_cgt(string arg);
4811 
4812 
4814 
4825  hash<OperatorInfo> op_cge(string arg);
4826 
4827 
4829 
4840  hash<OperatorInfo> op_cne(string arg);
4841 
4842 
4844 
4855  hash<OperatorInfo> op_ceq(string arg);
4856 
4857 
4859 
4870  hash<OperatorInfo> op_substr(int start, *int count, string text);
4871 
4872 
4874 
4884  hash<OperatorInfo> op_substr(int start, string text);
4885 
4886 
4888 
4905  hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
4906 
4908 
4915 
4918  const IOP_SEQ = "seq";
4919 
4921 
4923  const IOP_SEQ_CURRVAL = "seq_currval";
4924 
4926  const DefaultIopMap = {};
4928 
4934 
4942  hash<InsertOperatorInfo> make_iop(string iop, auto arg);
4943 
4944 
4946 
4955  hash<InsertOperatorInfo> iop_seq(string arg);
4956 
4957 
4959 
4968  hash<InsertOperatorInfo> iop_seq_currval(string arg);
4969 
4971 
4973  const SqlUtilDrivers = (
4974  "oracle",
4975  "pgsql",
4976  "mysql",
4977  "freetds",
4978  "sybase",
4979  );
4980 
4981  // private variable to store the closure used to deserialize datasources (if any)
4982  extern code ds_get;
4983 
4984  // private variable to store the closure used to serialize datasources (if any)
4985  extern code ds_do;
4986 
4989 
4990 
4993 
4994 
4995  // private function used to deserialize datasources
4996  AbstractDatasource sqlutil_get_ds(string type, string config);
4997 
4998 
4999  // private function used to serialize datasources
5000  hash<auto> sqlutil_ds(AbstractDatasource ds);
5001 
5002 
5004 class AbstractHashContainer : public Serializable {
5005 
5006 public:
5007 
5008 
5009 protected:
5012 
5013 public:
5014 
5017 
5018 
5021 
5022 
5025 
5026 
5028 
5043  auto memberGate(string k);
5044 
5045 
5047 
5054 
5055 
5057  abstract auto take(string k);
5058 
5060  renameKey(string old_name, string new_name);
5061 
5062 
5064  *hash<auto> getHash();
5065 
5066 
5068 
5077  bool matchKeys(hash h1);
5078 
5079 
5081 
5090  bool matchKeys(list<auto> l);
5091 
5092 
5094 
5104 
5105 
5107 
5117 
5118 
5120 
5129  bool partialMatchKeys(list<auto> l);
5130 
5131 
5133 
5143 
5144 
5146 
5155  bool val();
5156 
5157 
5159 
5166  list<string> keys();
5167 
5168 
5170 
5177  list<auto> values();
5178 
5179 
5181 
5189 
5190 
5192 
5200 
5201 
5203 
5211 
5212 
5214  bool empty();
5215 
5216 
5218 
5225  int size();
5226 
5227 
5229 
5238  bool hasKey(string k);
5239 
5240 
5242 
5251  bool hasKeyValue(string k);
5252 
5253 
5255 
5264  *string firstKey();
5265 
5266 
5268 
5277  *string lastKey();
5278 
5279 
5281  abstract string getElementName();
5282  };
5283 
5285 class AbstractListContainer : public Serializable {
5286 
5287 public:
5288 
5289 
5290 protected:
5291  softlist l;
5292 
5293 public:
5294 
5296  constructor(softlist nl);
5297 
5298 
5300 
5311  abstract auto get(softint i);
5312 
5314  add(auto val);
5315 
5316 
5318  auto take(int i);
5319 
5320 
5322  list<auto> getList();
5323 
5324 
5326 
5335  bool val();
5336 
5337 
5339 
5347 
5348 
5350  bool empty();
5351 
5352 
5354 
5361  int size();
5362 
5363 
5365  abstract string getElementName();
5366 
5367 protected:
5368  checkIndex(int i);
5369 public:
5370 
5371  };
5372 
5375 
5376 public:
5379 
5380 
5382  constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
5383 
5384 
5386  constructor(AbstractDatasource ds);
5387 
5388 
5390  add(string k, Table val);
5391 
5392 
5394  add(string k, AbstractTable val);
5395 
5396 
5399 
5400 
5403 
5404 
5406  AbstractTable take(string k);
5407 
5408 
5410  populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
5411 
5412 
5414  populate(AbstractDatasource ds);
5415 
5416 
5418 
5432  *list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
5433 
5434 
5436 
5452 
5453 
5455  string getElementName();
5456 
5457 
5459  *AbstractTable getIfExists(AbstractDatasource ds, string name);
5460 
5461 
5463  AbstractTable get(AbstractDatasource ds, string name);
5464 
5465 
5467 
5482  *string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
5483 
5484 
5486 
5497  bool tableRenamed(string old_name, string new_name, string old_sql_name);
5498 
5499 
5500 protected:
5501  tableRenamedIntern(string old_name, string new_name, string oldsn);
5502 public:
5503 
5504 
5506 
5521  *string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
5522 
5523 
5524  list<auto> getCreateList();
5525 
5526 
5527  Qore::AbstractIterator createIterator();
5528 
5529 
5531 
5539  list<auto> getDropList();
5540 
5541 
5543 
5551 
5552 
5553 protected:
5554  getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
5555 public:
5556 
5557  };
5558 
5561 
5562 public:
5565 
5566 
5569 
5570 
5572  add(string k, AbstractColumn val);
5573 
5574 
5577 
5578 
5580 
5596 
5597 
5599  Columns subset(softlist l);
5600 
5601 
5603  string getElementName();
5604 
5605 
5607  bool equal(Columns cols);
5608 
5609 
5611  AbstractIterator getSqlColumnNameIterator();
5612 
5613  };
5614 
5616 class AbstractDdlObject : public Serializable {
5617 
5618 public:
5620  string name;
5621 
5623  string ddl_name;
5624 
5626 protected:
5628 public:
5629 
5630 
5633 
5634 
5636 
5638  abstract string getDdlName(string name);
5639  };
5640 
5643 
5644 public:
5646  string native_type;
5647 
5649  *string qore_type;
5650 
5652  int size;
5653 
5655  bool nullable;
5656 
5658  *string def_val;
5659 
5661  *string comment;
5662 
5664 protected:
5666 public:
5667 
5668 
5669  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c)
5670  ;
5671 
5672 
5675 
5676 
5679 
5680 
5682 
5691  abstract list<auto> getAddColumnSql(AbstractTable t);
5692 
5694  string getDropSql(string table_name);
5695 
5696 
5698 
5711  list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5712 
5713 
5715 
5725  abstract string getRenameSql(AbstractTable t, string new_name);
5726 
5729 
5730 
5732 protected:
5733  abstract bool equalImpl(AbstractColumn c);
5734 public:
5735 
5737 
5750 protected:
5751  abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5752 public:
5753  };
5754 
5756 class NumericColumnInfo : public Serializable {
5757 
5758 public:
5760  int scale;
5761 
5762  constructor(softint n_scale = 0);
5763 
5764 
5766  string getNativeTypeString(string native_type, int precision);
5767 
5768  };
5769 
5772 
5773 public:
5774  constructor(*hash c) ;
5775 
5776 
5778  add(string k, AbstractIndex val);
5779 
5780 
5783 
5784 
5786  AbstractIndex take(string k);
5787 
5788 
5791 
5792 
5794 
5810 
5811 
5812  string getElementName();
5813 
5814  };
5815 
5817 class AbstractIndex : public Serializable {
5818 
5819 public:
5821  string name;
5822 
5824  bool unique;
5825 
5828 
5829 protected:
5832 
5833 public:
5834 
5836  constructor(string n, bool u, hash c);
5837 
5838 
5840  string getName();
5841 
5842 
5844  bool hasColumn(string cname);
5845 
5846 
5848  abstract string getCreateSql(string table_name, *hash<auto> opt);
5849 
5851  string getDropSql(string table_name);
5852 
5853 
5856 
5857 
5860 
5861 
5863  abstract bool equalImpl(AbstractIndex ix);
5864 
5866  abstract string getRenameSql(string table_name, string new_name);
5867 
5870 
5871 
5874 
5875 
5878 
5879 
5881  list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
5882 
5883  };
5884 
5887 
5888 public:
5889  constructor(*hash c) ;
5890 
5891 
5894 
5895 
5898 
5899 
5902 
5903 
5905 
5921 
5922 
5923  string getElementName();
5924 
5925  };
5926 
5928 class AbstractConstraint : public Serializable {
5929 
5930 public:
5931 
5932 
5933 protected:
5935  string name;
5936 
5937 public:
5938 
5940  constructor(string n);
5941 
5942 
5944  string getName();
5945 
5946 
5948  rename(string n);
5949 
5950 
5952  abstract string getCreateSql(string table_name, *hash<auto> opt);
5953 
5955  string getDropSql(string table_name);
5956 
5957 
5959  abstract list<auto> getRenameSql(string table_name, string new_name);
5960 
5962  string getDisableSql(string table_name);
5963 
5964 
5966  string getEnableSql(string table_name, *hash<auto> opt);
5967 
5968 
5971 
5972 
5974 protected:
5975  abstract bool equalImpl(AbstractConstraint c);
5976 public:
5977 
5979  abstract bool setIndexBase(string ix);
5980 
5982  abstract clearIndex();
5983 
5985  bool hasColumn(string cname);
5986 
5987  };
5988 
5991 
5992 public:
5994  string src;
5995 
5997  constructor(string n, string n_src) ;
5998 
5999 
6001 protected:
6003 public:
6004 
6005 
6007  bool setIndexBase(string ix);
6008 
6009 
6012 
6013  };
6014 
6017 
6018 public:
6019 protected:
6022 
6024  *string index;
6025 
6026 public:
6027 
6029  constructor(string n, *hash c, *string n_index) ;
6030 
6031 
6033  constructor(string n, Columns c, *string n_index) ;
6034 
6035 
6037 
6042 
6043 
6045  hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
6046 
6047 
6050 
6051 
6053 
6064 
6065 
6067  removeSourceConstraint(string tname, list cols);
6068 
6069 
6071  renameSourceConstraintTable(string old_name, string new_name);
6072 
6073 
6075  bool hasColumn(string cname);
6076 
6077 
6079  *string getIndex();
6080 
6081 
6083 protected:
6085 public:
6086 
6087 
6089  bool setIndexBase(string ix);
6090 
6091 
6094 
6095 
6097  abstract string getCreateSql(string table_name, *hash<auto> opts);
6098  };
6099 
6102 
6103 public:
6105  constructor(string n, *hash c, *string n_index) ;
6106 
6107  };
6108 
6111 
6112 public:
6113  constructor() ;
6114 
6115 
6116  constructor(string n, *hash c) ;
6117 
6118  };
6119 
6122 
6123 public:
6124  constructor(*hash c) ;
6125 
6126 
6129 
6130 
6133 
6134 
6137 
6138 
6140 
6156 
6157 
6159  *hash findConstraintOn(string table, softlist cols);
6160 
6161 
6163  string getElementName();
6164 
6165  };
6166 
6168 class ForeignConstraintTarget : public Serializable {
6169 
6170 public:
6172  string table;
6173 
6176 
6178  constructor(string t, Columns c);
6179 
6180 
6183 
6184  };
6185 
6188 
6189 public:
6192 
6193  constructor(string n, Columns c, ForeignConstraintTarget t) ;
6194 
6195 
6197 protected:
6199 public:
6200 
6201  };
6202 
6204 class AbstractSequence : public Serializable {
6205 
6206 public:
6208  string name;
6209 
6212 
6215 
6218 
6220  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
6221 
6222 
6224  abstract string getCreateSql(*hash<auto> opt);
6225 
6227 
6229  string getDropSql(*hash<auto> opt);
6230 
6231 
6233 
6236  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6237  };
6238 
6240 class AbstractView : public Serializable {
6241 
6242 public:
6243  // ! potential object schema
6244  *string schema;
6245 
6247  string name;
6248 
6250  string src;
6251 
6254 
6256  constructor(string n_name, string n_src);
6257 
6258 
6260  abstract string getCreateSql(*hash<auto> opt);
6261 
6263 
6265  string getDropSql(*hash<auto> opt);
6266 
6267 
6269 
6272  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6273  };
6274 
6276 class AbstractFunctionBase : public Serializable {
6277 
6278 public:
6280  string name;
6281 
6283  string type;
6284 
6286  string src;
6287 
6289 
6293  constructor(string n, string n_type, string n_src);
6294 
6295 
6297  string getType();
6298 
6299 
6301 
6303  string getDropSql(*hash<auto> opt);
6304 
6305 
6308 
6309 
6311  string getNormalizedSource(string src);
6312 
6313 
6315 protected:
6317 public:
6318  };
6319 
6322 
6323 public:
6325 
6329  constructor(string n, string n_type, string n_src) ;
6330 
6331 
6333  abstract list<auto> getCreateSql(*hash<auto> opt);
6334 
6336 
6339  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6340 
6342  setName(string new_name);
6343 
6344  };
6345 
6348 
6349 public:
6350  constructor(*hash c) ;
6351 
6352 
6355 
6356 
6359 
6360 
6362 
6378 
6379 
6380  string getElementName();
6381 
6382  };
6383 
6386 
6387 public:
6389  constructor(string n, string n_src) ;
6390 
6391 
6393  abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
6394 
6396  abstract softlist<auto> getRenameSql(string table_name, string new_name);
6397 
6399  abstract list<auto> getDropSql(string table_name);
6400  };
6401 
6404 
6405 public:
6406  constructor(*hash c) ;
6407 
6408 
6411 
6412 
6415 
6416 
6418 
6434 
6435 
6436  string getElementName();
6437 
6438  };
6439 }
SqlUtil::Functions::getElementName
string getElementName()
must return the name of the contained element
SqlUtil::COP_COUNT
const COP_COUNT
to return the row count
Definition: SqlUtil.qm.dox.h:2347
SqlUtil::op_cge
hash< OperatorInfo > op_cge(string arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
SqlUtil::AbstractFunction::constructor
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
SqlUtil::SqlUtilDrivers
const SqlUtilDrivers
known drivers
Definition: SqlUtil.qm.dox.h:4973
SqlUtil::Tables::constructor
constructor(AbstractDatasource ds)
creates and populates the object from tables in the database
SqlUtil::OP_CEQ
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4378
SqlUtil::ColumnOperatorInfo::arg
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2156
SqlUtil::COP_MINUS
const COP_MINUS
the SQL "minus" operator
Definition: SqlUtil.qm.dox.h:2357
SqlUtil::cop_divide
hash< ColumnOperatorInfo > cop_divide(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "/" operator with the given arguments
SqlUtil::make_jop
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
SqlUtil::op_in_select
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 ...
SqlUtil::AbstractFunctionBase::getType
string getType()
returns the type of object
SqlUtil::SZ_NUM
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition: SqlUtil.qm.dox.h:2277
SqlUtil::Functions::memberGate
AbstractFunction memberGate(string k)
returns the AbstractFunction object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::AbstractSequence::getDropSql
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the sequence from the database
SqlUtil::IOP_SEQ
const IOP_SEQ
for using the value of a sequence
Definition: SqlUtil.qm.dox.h:4918
SqlUtil::AbstractFunction::getRenameSql
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
SqlUtil::GenericColumnInfo::scale
softint scale
for numeric data types, this value gives the scale
Definition: SqlUtil.qm.dox.h:2131
SqlUtil::COP_YEAR
const COP_YEAR
to return a date value with year information only
Definition: SqlUtil.qm.dox.h:2377
SqlUtil::NUMERIC
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition: SqlUtil.qm.dox.h:2251
SqlUtil::AbstractHashContainer::keys
list< string > keys()
Returns a list of key names of the contained hash.
SqlUtil::CHAR
const CHAR
specifies a CHAR column
Definition: SqlUtil.qm.dox.h:2254
SqlUtil::AbstractHashContainer::partialMatchKeys
bool partialMatchKeys(AbstractHashContainer c)
returns True if the container argument has at least the same keys (in any order, can have more keys),...
SqlUtil::COP_DENSE_RANK
const COP_DENSE_RANK
Analytic (window) function: DENSE_RANK.
Definition: SqlUtil.qm.dox.h:2442
SqlUtil::AbstractHashContainer::firstKey
*string firstKey()
Returns the first key name in the contained hash or NOTHING if the contained hash has no keys.
SqlUtil::AbstractHashContainer::iterator
Qore::AbstractIterator iterator()
Returns a HashIterator object for the contained hash.
SqlUtil::AbstractSequence::constructor
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_max)
creates the object from the arguments
SqlUtil::AbstractHashContainer::getElementName
abstract string getElementName()
must return the name of the contained element
SqlUtil::Columns::take
AbstractColumn take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::Tables::getDropList
list< auto > getDropList()
returns a list of cached table names in the order that can be used to drop the tables,...
SqlUtil::COP_UPPER
const COP_UPPER
to return column value in upper case
Definition: SqlUtil.qm.dox.h:2312
SqlUtil::Tables::populate
populate(AbstractDatasource ds)
populates the object from tables in the database
SqlUtil::AbstractFunctionBase::constructor
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
SqlUtil::AbstractFunction::getCreateSql
abstract list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that can be used to create the function in the database
SqlUtil::op_in
hash< OperatorInfo > op_in()
returns an OperatorInfo hash for the "in" operator with all arguments passed to the function; for use...
SqlUtil::OP_CNE
const OP_CNE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4373
SqlUtil::DB_SEQUENCES
const DB_SEQUENCES
Feature: sequences.
Definition: SqlUtil.qm.dox.h:2232
SqlUtil::AbstractSequence
base class for sequences
Definition: SqlUtil.qm.dox.h:6204
SqlUtil::op_like
hash< OperatorInfo > op_like(string str)
returns an OperatorInfo hash for the "like" operator with the given argument for use in where clauses
SqlUtil::Tables::constructor
constructor(AbstractDatasource ds, hash tables, *hash< auto > opt)
creates and populates the object from a hash<auto> description
SqlUtil::AbstractIndex::getName
string getName()
returns the index name
SqlUtil::COP_YEAR_MONTH
const COP_YEAR_MONTH
to return a date value with year to month information
Definition: SqlUtil.qm.dox.h:2382
SqlUtil::AbstractCheckConstraint::clearIndex
clearIndex()
clears any index base for the constraint
SqlUtil::cop_row_number
hash< ColumnOperatorInfo > cop_row_number()
Analytic/window function: number of the current row within its partition, counting from 1.
SqlUtil::iop_seq
hash< InsertOperatorInfo > iop_seq(string arg)
returns an InsertOperatorInfo hash for retrieving the value of the given sequence in insert queries
SqlUtil::Columns::subset
Columns subset(softlist l)
returns a subset of the current columns according to the list<auto> argument
SqlUtil::DT_MONTH
const DT_MONTH
Format unit: month.
Definition: SqlUtil.qm.dox.h:3563
SqlUtil::AbstractColumnSupportingConstraint::addSourceConstraint
addSourceConstraint(string tname, AbstractForeignConstraint fk)
adds a foreign constraint source to the unique constraint
SqlUtil::cop_length
hash< ColumnOperatorInfo > cop_length(auto column)
returns a ColumnOperatorInfo hash for the "len" operator with the given argument; returns the length ...
SqlUtil::OperatorInfo::arg
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2149
SqlUtil::AbstractConstraint::getName
string getName()
returns the constraint name
SqlUtil::AbstractTrigger
the base class for triggers
Definition: SqlUtil.qm.dox.h:6385
SqlUtil::Triggers::getElementName
string getElementName()
must return the name of the contained element
SqlUtil::SZ_OPT
const SZ_OPT
the data type takes an optional size parameter
Definition: SqlUtil.qm.dox.h:2274
SqlUtil::AbstractUniqueConstraint
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:6101
SqlUtil::ForeignConstraints
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6121
SqlUtil::COP_ROW_NUMBER
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition: SqlUtil.qm.dox.h:2484
SqlUtil::InsertOperatorInfo::arg
any arg
optional argument
Definition: SqlUtil.qm.dox.h:2162
SqlUtil::uop_divide
hash< UpdateOperatorInfo > uop_divide(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "/" operator with the given arguments
SqlUtil::AbstractHashContainer::keyIterator
Qore::AbstractIterator keyIterator()
Returns a HashKeyIterator object for the contained hash.
SqlUtil::DT_HOUR
const DT_HOUR
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3569
SqlUtil::AbstractIndex::equal
bool equal(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
SqlUtil::AbstractHashContainer::partialMatchKeys
bool partialMatchKeys(hash h1)
returns True if the hash argument has at least the same keys (in any order, can have more keys),...
SqlUtil::AbstractConstraint::name
string name
the name of the constraint
Definition: SqlUtil.qm.dox.h:5935
type
string type(auto arg)
SqlUtil::DefaultCopMap
const DefaultCopMap
a hash of default column operator descriptions
Definition: SqlUtil.qm.dox.h:2487
SqlUtil::op_cle
hash< OperatorInfo > op_cle(string arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
SqlUtil::join_right
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
SqlUtil::iop_seq_currval
hash< InsertOperatorInfo > iop_seq_currval(string arg)
returns an InsertOperatorInfo hash for retrieving the current value of the given sequence in insert q...
SqlUtil::OP_NE
const OP_NE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4343
SqlUtil::AbstractConstraint::getEnableSql
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 ...
SqlUtil::cop_rank
hash< ColumnOperatorInfo > cop_rank()
Analytic/window function: rank of the current row with gaps.
SqlUtil::Triggers::add
add(string k, AbstractTrigger val)
adds the given value to the hash with the given key name
SqlUtil::AbstractHashContainer::memberGate
auto memberGate(string k)
returns the value of the given key in the contained hash if it exists, otherwise throws a KEY-ERROR e...
SqlUtil::GenericColumnInfo::comment
*string comment
an optional comment for the column
Definition: SqlUtil.qm.dox.h:2137
SqlUtil::ForeignConstraintTarget
a class describing a foreign constraint target
Definition: SqlUtil.qm.dox.h:6168
SqlUtil::AbstractIndex::columns
Columns columns
an object of class Columns representing the columns in the index
Definition: SqlUtil.qm.dox.h:5827
SqlUtil::COP_LENGTH
const COP_LENGTH
to get the length of a text field
Definition: SqlUtil.qm.dox.h:2419
SqlUtil::AbstractSequence::max
*number max
the ending number
Definition: SqlUtil.qm.dox.h:6217
SqlUtil::COP_OVER
const COP_OVER
the SQL "over" clause
Definition: SqlUtil.qm.dox.h:2352
SqlUtil::SqlCommandInfo::args
list< auto > args
the arguments for the string
Definition: SqlUtil.qm.dox.h:2214
SqlUtil::InsertOperatorInfo
insert operator info hash as returned by all insert operator functions
Definition: SqlUtil.qm.dox.h:2160
SqlUtil::AbstractColumn::qore_type
*string qore_type
the equivalent qore type name of the column if known
Definition: SqlUtil.qm.dox.h:5649
SqlUtil::ForeignConstraints::take
AbstractForeignConstraint take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::op_ne
hash< OperatorInfo > op_ne(auto arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
SqlUtil::GenericColumnInfo::native_type
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:2127
SqlUtil::GenericColumnInfo::size
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition: SqlUtil.qm.dox.h:2129
SqlUtil::SqlCommandInfo::sql
string sql
the SQL string for the update
Definition: SqlUtil.qm.dox.h:2211
SqlUtil::COP_LAST_VALUE
const COP_LAST_VALUE
Analytic (window) function: LAST_VALUE.
Definition: SqlUtil.qm.dox.h:2456
string
string string(softstring str, *string enc)
SqlUtil::Indexes::take
AbstractIndex take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::JoinOperatorInfo::ta
*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:2179
SqlUtil::cop_coalesce
hash< ColumnOperatorInfo > cop_coalesce(auto col1, auto col2)
returns a ColumnOperatorInfo hash for the "coalesce" operator with the given column arguments; the fi...
SqlUtil::UpdateOperatorInfo
update operator info hash as returned by all update operator functions
Definition: SqlUtil.qm.dox.h:2166
SqlUtil::AbstractFunction
base class for functions
Definition: SqlUtil.qm.dox.h:6321
SqlUtil::AbstractHashContainer::matchKeys
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...
SqlUtil::AbstractIndex::equalImpl
abstract bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
SqlUtil::cop_dense_rank
hash< ColumnOperatorInfo > cop_dense_rank()
Analytic/window function: rank of the current row without gaps.
SqlUtil::DB_PACKAGES
const DB_PACKAGES
Feature: packages.
Definition: SqlUtil.qm.dox.h:2228
SqlUtil::AbstractForeignConstraint::equalImpl
bool equalImpl(AbstractConstraint con)
returns True if the argument is equal to the current object, False if not
SqlUtil::cop_upper
hash< ColumnOperatorInfo > cop_upper(auto column)
returns a ColumnOperatorInfo hash for the "upper" operator with the given argument; returns a column ...
SqlUtil::AbstractConstraint::getRenameSql
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
SqlUtil::AbstractDdlObject::constructor
constructor(string name)
creates the object from the name
SqlUtil::JOP_LEFT
const JOP_LEFT
for left outer joins
Definition: SqlUtil.qm.dox.h:3836
SqlUtil::uop_append
hash< UpdateOperatorInfo > uop_append(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "append" or concatenate operator with the given argument
SqlUtil::AbstractTrigger::constructor
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
SqlUtil::BLOB
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition: SqlUtil.qm.dox.h:2257
SqlUtil::AbstractColumn::nullable
bool nullable
True if the column can hold a NULL value, False if not
Definition: SqlUtil.qm.dox.h:5655
SqlUtil::make_iop
hash< InsertOperatorInfo > make_iop(string iop, auto arg)
returns an InsertOperatorInfo hash
Qore::ListIterator
SqlUtil::OP_GE
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4338
SqlUtil::OP_GT
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4333
SqlUtil::Constraints::getElementName
string getElementName()
must return the name of the contained element
SqlUtil::join_right_alias
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...
SqlUtil::GenericColumnInfo::qore_type
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:2125
SqlUtil::AbstractFunctionBase::getNormalizedSource
string getNormalizedSource(string src)
returns normalized source for comparisons
SqlUtil::OP_BETWEEN
const OP_BETWEEN
the SQL "between" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4383
SqlUtil::cop_percent_rank
hash< ColumnOperatorInfo > cop_percent_rank()
Analytic/window function: relative rank of the current row.
SqlUtil::COP_TRUNC_DATE
const COP_TRUNC_DATE
to return the date with truncated value
Definition: SqlUtil.qm.dox.h:2428
SqlUtil::JOP_INNER
const JOP_INNER
for standard inner joins
Definition: SqlUtil.qm.dox.h:3831
SqlUtil::AbstractColumnSupportingConstraint::index
*string index
the index supporting the constraint
Definition: SqlUtil.qm.dox.h:6024
SqlUtil::uop_minus
hash< UpdateOperatorInfo > uop_minus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "-" operator with the given arguments
SqlUtil::Functions::take
AbstractFunction take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::COP_NTILE
const COP_NTILE
Analytic (window) function: NTILE.
Definition: SqlUtil.qm.dox.h:2463
SqlUtil::OP_NOT
const OP_NOT
the SQL "not" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4393
SqlUtil::NumericColumnInfo
the base class to use to extend AbstractColumn to implement numeric columns
Definition: SqlUtil.qm.dox.h:5756
SqlUtil::AbstractHashContainer::val
bool val()
Returns False if the contained hash has no keys, True if it does.
SqlUtil::AbstractColumnSupportingConstraint::constructor
constructor(string n, Columns c, *string n_index)
creates the object from the name and a Columns object
SqlUtil::ForeignConstraintTarget::equal
bool equal(ForeignConstraintTarget targ)
returns True if the argument is equal to the current object, False if not
SqlUtil::Functions
function container class that throws an exception if an unknown function is accessed
Definition: SqlUtil.qm.dox.h:6347
SqlUtil::AbstractIndex::constraint
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition: SqlUtil.qm.dox.h:5831
SqlUtil::AbstractIndex::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the index from the database
SqlUtil::AbstractForeignConstraint::target
ForeignConstraintTarget target
a ForeignConstraintTarget object to describe the target table and columns
Definition: SqlUtil.qm.dox.h:6191
SqlUtil::cop_minus
hash< ColumnOperatorInfo > cop_minus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "-" operator with the given arguments
SqlUtil::AbstractForeignConstraint
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:6187
SqlUtil::AbstractSequence::getRenameSql
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
SqlUtil::ColumnOperatorInfo::column
auto column
column sopecifier, may be a string or a complex hash
Definition: SqlUtil.qm.dox.h:2155
SqlUtil::SqlUtilDataTypeOptionInfo::number_format
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition: SqlUtil.qm.dox.h:2195
SqlUtil::COP_APPEND
const COP_APPEND
to append a string to a column on output
Definition: SqlUtil.qm.dox.h:2302
SqlUtil::op_substr
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...
SqlUtil::GenericColumnInfo::default_value_native
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:2135
SqlUtil::JoinOperatorInfo::jop
string jop
the join operator string code
Definition: SqlUtil.qm.dox.h:2174
SqlUtil::wop_or
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...
SqlUtil::DT_DAY
const DT_DAY
Format unit: day.
Definition: SqlUtil.qm.dox.h:3566
SqlUtil::AbstractHashContainer::clear
clear()
purges the contained data
SqlUtil::AbstractFunctionBase::getDropSql
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the function from the database
SqlUtil::AbstractHashContainer::empty
bool empty()
returns True if the container is empty, False if not
True
const True
SqlUtil::AbstractCheckConstraint::setIndexBase
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
SqlUtil::Table
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:50
SqlUtil::cop_sum
hash< ColumnOperatorInfo > cop_sum(auto column)
returns a ColumnOperatorInfo hash for the "sum" operator; returns the total sum of a numeric column.
SqlUtil::SqlUtilDataTypeOptionInfo::mandatory
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition: SqlUtil.qm.dox.h:2198
SqlUtil::uop_lower
hash< UpdateOperatorInfo > uop_lower(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "lower" operator with the given argument; returns a column...
SqlUtil::AbstractCheckConstraint::equalImpl
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
SqlUtil::ColumnOperatorInfo
column operator info hash as returned by all column operator functions
Definition: SqlUtil.qm.dox.h:2153
SqlUtil::AbstractColumn::constructor
constructor()
empty constructor for subclasses
SqlUtil::cop_substr
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...
SqlUtil::cop_first_value
hash< ColumnOperatorInfo > cop_first_value(any column)
Analytic/window function: value evaluated at the row that is the first row of the window frame.
SqlUtil::AbstractIndex::unique
bool unique
True if the index is a unique index, False if not
Definition: SqlUtil.qm.dox.h:5824
SqlUtil::Indexes::memberGate
AbstractIndex memberGate(string k)
returns the AbstractIndex object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::GenericColumnInfo
generic column description hash in schema descriptions
Definition: SqlUtil.qm.dox.h:2123
SqlUtil::Tables::getDropConstraintIfExistsSql
*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...
SqlUtil::cop_lower
hash< ColumnOperatorInfo > cop_lower(auto column)
returns a ColumnOperatorInfo hash for the "lower" operator with the given argument; returns a column ...
SqlUtil::AbstractColumnSupportingConstraint::hasColumn
bool hasColumn(string cname)
returns True if the constraint references the named column
SqlUtil::AbstractConstraint::equalImpl
abstract bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
SqlUtil::VARCHAR
const VARCHAR
specifies a VARCHAR column (equivalent to Qore::Type::String)
Definition: SqlUtil.qm.dox.h:2248
SqlUtil::Functions::add
add(string k, AbstractFunction val)
adds the given value to the hash with the given key name
SqlUtil::COP_SEQ
const COP_SEQ
to return the next value of a sequence
Definition: SqlUtil.qm.dox.h:2397
SqlUtil::AbstractConstraint::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
SqlUtil::SqlUtilDataTypeOptionInfo
column data type options
Definition: SqlUtil.qm.dox.h:2184
SqlUtil::cop_ntile
hash< ColumnOperatorInfo > cop_ntile(int value)
Analytic/window function: integer ranging from 1 to the argument value, dividing the partition as equ...
SqlUtil::NumericColumnInfo::scale
int scale
the scale for numeric columns
Definition: SqlUtil.qm.dox.h:5760
SqlUtil::DefaultIopMap
const DefaultIopMap
a hash of default insert operator descriptions (currently empty, all operators are driver-dependent)
Definition: SqlUtil.qm.dox.h:4926
SqlUtil::AbstractColumnSupportingConstraint::setIndexBase
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
SqlUtil::uop_plus
hash< UpdateOperatorInfo > uop_plus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "+" operator with the given arguments
SqlUtil::AbstractHashContainer::size
int size()
Returns the number of keys in the contained hash.
SqlUtil::Columns::constructor
constructor(Columns old)
creates a copy of the object
SqlUtil::COP_MAX
const COP_MAX
to return the maximum value
Definition: SqlUtil.qm.dox.h:2332
SqlUtil::COP_SUBSTR
const COP_SUBSTR
to extract a substring from a column
Definition: SqlUtil.qm.dox.h:2412
SqlUtil::AbstractHashContainer::hasKey
bool hasKey(string k)
Returns True if the key exists in the contained hash (may or may not be assigned a value),...
SqlUtil::AbstractListContainer::val
bool val()
Returns False if the contained list is empty, True if not.
SqlUtil::COP_DISTINCT
const COP_DISTINCT
to return distinct values
Definition: SqlUtil.qm.dox.h:2322
SqlUtil::op_not
hash< OperatorInfo > op_not(hash arg)
returns an OperatorInfo hash for the "not" operator; for use in where clauses
SqlUtil::AbstractListContainer
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:5285
SqlUtil::DB_TABLES
const DB_TABLES
Feature: tables.
Definition: SqlUtil.qm.dox.h:2234
SqlUtil::ForeignConstraints::memberGate
AbstractForeignConstraint memberGate(string k)
returns the AbstractForeignConstraint object corresponding to the key given or throws a KEY-ERROR exc...
SqlUtil::SqlCommandInfo
A hash describing SQL and arguments for an SQL DML command.
Definition: SqlUtil.qm.dox.h:2209
SqlUtil::AbstractColumn::equalImpl
abstract bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
SqlUtil::Triggers::memberGate
AbstractTrigger memberGate(string k)
returns the AbstractTrigger object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::Columns::getElementName
string getElementName()
returns "column" since this object stores column objects
SqlUtil::uop_substr
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...
SqlUtil::JoinOperatorInfo::alias
*string alias
optional alias for table in the query
Definition: SqlUtil.qm.dox.h:2176
SqlUtil::Indexes::findEqual
*AbstractIndex findEqual(AbstractIndex ix)
find an index with columns equal to the index passed
SqlUtil::AbstractSequence::start
number start
the starting number
Definition: SqlUtil.qm.dox.h:6211
SqlUtil::AbstractColumnSupportingConstraint::constructor
constructor(string n, *hash c, *string n_index)
creates the object from the name and a hash of column information
SqlUtil::COP_CAST
const COP_CAST
to convert column value into another datatype
Definition: SqlUtil.qm.dox.h:2292
SqlUtil::JoinOperatorInfo::opt
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition: SqlUtil.qm.dox.h:2180
SqlUtil::cop_distinct
hash< ColumnOperatorInfo > cop_distinct(auto column)
returns a ColumnOperatorInfo hash for the "distinct" operator with the given argument; returns distin...
SqlUtil::AbstractTrigger::getCreateSql
abstract list< auto > getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the trigger in the database
SqlUtil::COP_PLUS
const COP_PLUS
the SQL "plus" operator
Definition: SqlUtil.qm.dox.h:2362
SqlUtil::uop_multiply
hash< UpdateOperatorInfo > uop_multiply(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "*" operator with the given arguments
SqlUtil::op_eq
hash< OperatorInfo > op_eq(auto arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
SqlUtil::AbstractColumn
the base class for column information
Definition: SqlUtil.qm.dox.h:5642
SqlUtil::AbstractIndex::getRecreateSql
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,...
SqlUtil::Tables::add
add(string k, AbstractTable val)
adds the given value to the hash with the given key name
SqlUtil::AbstractIndex
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5817
SqlUtil::Indexes::add
add(string k, AbstractIndex val)
adds the given value to the hash with the given key name
SqlUtil::Columns::getSqlColumnNameIterator
AbstractIterator getSqlColumnNameIterator()
returns an iterator for column SQL names
SqlUtil::AbstractColumn::comment
*string comment
comment on the column
Definition: SqlUtil.qm.dox.h:5661
SqlUtil::op_clt
hash< OperatorInfo > op_clt(string arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
SqlUtil::cop_min
hash< ColumnOperatorInfo > cop_min(auto column)
returns a ColumnOperatorInfo hash for the "min" operator; returns minimum column values
SqlUtil::make_cop
hash< ColumnOperatorInfo > make_cop(string cop, auto column, auto arg)
returns a ColumnOperatorInfo hash
SqlUtil::OP_IN
const OP_IN
the SQL "in" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4388
SqlUtil::COP_MULTIPLY
const COP_MULTIPLY
the SQL "multiply" operator
Definition: SqlUtil.qm.dox.h:2372
SqlUtil::AbstractConstraint::getDisableSql
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database; if disabli...
SqlUtil::COP_PERCENT_RANK
const COP_PERCENT_RANK
Analytic (window) function: PERCENT_RANK.
Definition: SqlUtil.qm.dox.h:2470
SqlUtil::Indexes::tryTake
*AbstractIndex tryTake(string k)
tries to remove the given key from the contained hash and returns the value if it exists
SqlUtil::AbstractListContainer::iterator
Qore::ListIterator iterator()
Returns a ListIterator object for the contained list.
SqlUtil::Tables::getDropAllForeignConstraintsOnTableSql
*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...
SqlUtil::Constraints::add
add(string k, AbstractConstraint val)
adds the given value to the hash with the given key name
SqlUtil::ForeignConstraints::add
add(string k, AbstractForeignConstraint val)
adds the given value to the hash with the given key name
SqlUtil::cop_cume_dist
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
SqlUtil::OP_LT
const OP_LT
the SQL less than (<) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4323
SqlUtil::AbstractColumn::getNativeTypeString
string getNativeTypeString()
returns the string describing the native type that can be used in SQL (for example to add the colunn ...
SqlUtil::join_left
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
SqlUtil::AbstractDdlObject::ddl_name
string ddl_name
the name of the object for DDL (in case it's a reserved word)
Definition: SqlUtil.qm.dox.h:5623
SqlUtil::AbstractIndex::getCreateSql
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the index in the database
SqlUtil::cop_plus
hash< ColumnOperatorInfo > cop_plus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "+" operator with the given arguments
SqlUtil::op_gt
hash< OperatorInfo > op_gt(auto arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
SqlUtil::AbstractColumn::getModifySqlImpl
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; if the col...
SqlUtil::AbstractConstraint::getCreateSql
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the constraint in the database
SqlUtil::AbstractView::constructor
constructor(string n_name, string n_src)
creates the object from the arguments
SqlUtil::AbstractHashContainer
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:5004
SqlUtil::JoinOperatorInfo::cond
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition: SqlUtil.qm.dox.h:2178
SqlUtil::JoinOperatorInfo
join operator info hash as returned by all join operator functions
Definition: SqlUtil.qm.dox.h:2173
SqlUtil::AbstractColumn::def_val
*string def_val
default value for column
Definition: SqlUtil.qm.dox.h:5658
SqlUtil::DT_MINUTE
const DT_MINUTE
Format unit: minute.
Definition: SqlUtil.qm.dox.h:3572
SqlUtil::DB_FUNCTIONS
const DB_FUNCTIONS
Features constants.
Definition: SqlUtil.qm.dox.h:2224
SqlUtil::AbstractColumnSupportingConstraint::getIndex
*string getIndex()
returns the name of the associated index, if any
SqlUtil::AbstractColumn::getCreateSql
string getCreateSql(AbstractTable t)
returns an sql string that can be used to add the column to a table
SqlUtil::AbstractFunctionBase::name
string name
the name of the object
Definition: SqlUtil.qm.dox.h:6280
NULL
const NULL
SqlUtil::DT_YEAR
const DT_YEAR
Format unit: year.
Definition: SqlUtil.qm.dox.h:3560
SqlUtil::AbstractCheckConstraint
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5990
SqlUtil::COP_SUM
const COP_SUM
to return the sum value
Definition: SqlUtil.qm.dox.h:2342
SqlUtil::AbstractView::src
string src
the source code
Definition: SqlUtil.qm.dox.h:6250
SqlUtil::AbstractHashContainer::h
*hash h
the data to be contained
Definition: SqlUtil.qm.dox.h:5011
SqlUtil::AbstractCheckConstraint::constructor
constructor(string n, string n_src)
creates the object and sets its name and the check clause source
SqlUtil::ForeignConstraints::getElementName
string getElementName()
returns "foreign constraint" for the type of object encapsulated
SqlUtil::OP_CGT
const OP_CGT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4363
list
list< auto > list(...)
SqlUtil::AbstractIndex::setSupportingConstraint
setSupportingConstraint()
clears the supporting constraint
SqlUtil::AbstractIndex::getRenameSql
abstract string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
SqlUtil::cop_year_hour
hash< ColumnOperatorInfo > cop_year_hour(auto column)
returns a ColumnOperatorInfo hash for the "year_hour" operator with the given argument
SqlUtil::OperatorInfo::op
string op
the operator string code
Definition: SqlUtil.qm.dox.h:2148
SqlUtil::AbstractView::getRenameSql
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
SqlUtil::AbstractIndex::constructor
constructor(string n, bool u, hash c)
creates the object from the name, a unique flag, and a hash of column information
SqlUtil::ForeignConstraints::findConstraintOn
*hash findConstraintOn(string table, softlist cols)
returns either a hash of AbstractColumn information or NOTHING if no foreign constraint can be found ...
SqlUtil::AbstractColumnSupportingConstraint::findMatchingIndex
findMatchingIndex(*Indexes indexes)
find an index that matches the constraint and marks both objects as related
SqlUtil::JoinOperatorInfo::jcols
*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:2177
SqlUtil::COP_YEAR_HOUR
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition: SqlUtil.qm.dox.h:2392
SqlUtil::AbstractFunctionBase
base class for function or objects with code
Definition: SqlUtil.qm.dox.h:6276
SqlUtil::JoinOperatorInfo::table
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition: SqlUtil.qm.dox.h:2175
SqlUtil::AbstractColumn::getRenameSql
abstract string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
SqlUtil::cop_year_month
hash< ColumnOperatorInfo > cop_year_month(auto column)
returns a ColumnOperatorInfo hash for the "year_month" operator with the given argument
SqlUtil::UpdateOperatorInfo::uop
string uop
the update operator string code
Definition: SqlUtil.qm.dox.h:2167
SqlUtil::cop_avg
hash< ColumnOperatorInfo > cop_avg(auto column)
returns a ColumnOperatorInfo hash for the "avg" operator; returns average column values
exists
bool exists(...)
SqlUtil::AbstractConstraint::rename
rename(string n)
renames the constraint
SqlUtil::COP_YEAR_DAY
const COP_YEAR_DAY
to return a date value with year to day information
Definition: SqlUtil.qm.dox.h:2387
SqlUtil::DefaultOpMap
const DefaultOpMap
a hash of valid operators for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4411
String
const String
SqlUtil::cop_multiply
hash< ColumnOperatorInfo > cop_multiply(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "*" operator with the given arguments
SqlUtil::cop_year_day
hash< ColumnOperatorInfo > cop_year_day(auto column)
returns a ColumnOperatorInfo hash for the "year_day" operator with the given argument
SqlUtil::AbstractListContainer::get
abstract auto get(softint i)
returns the value of the given element in the contained list if it exists, otherwise throws an ELEMEN...
SqlUtil::COP_LOWER
const COP_LOWER
to return column value in lower case
Definition: SqlUtil.qm.dox.h:2317
SqlUtil::SqlUtilDataTypeOptionInfo::data_timezone
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition: SqlUtil.qm.dox.h:2189
SqlUtil::AbstractColumn::getModifySql
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...
SqlUtil::AbstractHashContainer::matchKeys
bool matchKeys(AbstractHashContainer c)
returns True if the container argument has the same keys (in any order), False if not
SqlUtil::AbstractHashContainer::copy
copy(AbstractHashContainer old)
creates a "deep copy" of the object
SqlUtil::DB_TYPES
const DB_TYPES
Feature: named types.
Definition: SqlUtil.qm.dox.h:2236
SqlUtil::Columns
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5560
SqlUtil::Constraints::take
AbstractConstraint take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::Indexes
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:5771
SqlUtil::COP_SEQ_CURRVAL
const COP_SEQ_CURRVAL
to return the last value of a sequence issued in the same session
Definition: SqlUtil.qm.dox.h:2402
SqlUtil::op_le
hash< OperatorInfo > op_le(auto arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
SqlUtil::AbstractTable
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:36
SqlUtil::AbstractListContainer::getList
list< auto > getList()
returns the list contained by this object
SqlUtil::cop_append
hash< ColumnOperatorInfo > cop_append(auto column, string arg)
returns a ColumnOperatorInfo hash for the "append" operator with the given argument
SqlUtil::AbstractSequence::increment
number increment
the increment
Definition: SqlUtil.qm.dox.h:6214
SqlUtil::SZ_MAND
const SZ_MAND
the data type takes a mandatory size parameter
Definition: SqlUtil.qm.dox.h:2271
SqlUtil::COP_PREPEND
const COP_PREPEND
to prepend a string to a column on output
Definition: SqlUtil.qm.dox.h:2297
SqlUtil::AbstractColumnSupportingConstraint::removeSourceConstraint
removeSourceConstraint(string tname, list cols)
removes a source constraint
SqlUtil::AbstractColumnSupportingConstraint::getDisableReenableSql
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...
SqlUtil::cop_prepend
hash< ColumnOperatorInfo > cop_prepend(auto column, string arg)
returns a ColumnOperatorInfo hash for the "prepend" operator with the given argument
SqlUtil::UpdateOperatorInfo::arg
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2168
SqlUtil::sqlutil_register_ds_deserializer
sqlutil_register_ds_deserializer(*code new_ds_get)
registers a closure or call reference taking a string type and string datasource configuration that w...
SqlUtil::GenericColumnInfo::notnull
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:2139
SqlUtil::InsertOperatorInfo::_iop
string _iop
the insert operator string code
Definition: SqlUtil.qm.dox.h:2161
SqlUtil::AbstractConstraint::constructor
constructor(string n)
creates the object and sets its name
SqlUtil::Tables::dropIterator
Qore::AbstractIterator dropIterator()
returns an iterator for a list of cached table names in the order that can be used to drop the tables...
hash
hash< auto > hash(object obj)
SqlUtil::DB_VIEWS
const DB_VIEWS
Feature: views.
Definition: SqlUtil.qm.dox.h:2238
SqlUtil::AbstractColumnSupportingConstraint
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:6016
SqlUtil::Tables::tableRenamed
bool tableRenamed(string old_name, string new_name, string old_sql_name)
updates table names and internal references for renamed tables
SqlUtil::AbstractView::updatable
bool updatable
Flag showing if is the view updatable with DML commands.
Definition: SqlUtil.qm.dox.h:6253
SqlUtil::AbstractColumnSupportingConstraint::sourceConstraints
*hash sourceConstraints
a hash of ForeignConstraintSources, keyed by table name, the value is a hash of foreign constraints k...
Definition: SqlUtil.qm.dox.h:6021
SqlUtil::ForeignConstraintTarget::table
string table
the name of the target table
Definition: SqlUtil.qm.dox.h:6172
SqlUtil::AbstractHashContainer::renameKey
renameKey(string old_name, string new_name)
renames the given key; maintains the key order
SqlUtil::Triggers
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:6403
sprintf
string sprintf(string fmt,...)
SqlUtil::uop_prepend
hash< UpdateOperatorInfo > uop_prepend(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "prepend" operator with the given argument
SqlUtil::AbstractHashContainer::partialMatchKeys
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)...
SqlUtil::DefaultUopMap
const DefaultUopMap
a hash of valid update operators
Definition: SqlUtil.qm.dox.h:3586
SqlUtil::ForeignConstraints::findEqual
*AbstractForeignConstraint findEqual(AbstractForeignConstraint fk)
find an index with columns equal to the index passed
SqlUtil::AbstractHashContainer::pairIterator
Qore::AbstractIterator pairIterator()
Returns a HashPairIterator object for the contained hash.
SqlUtil::cop_year
hash< ColumnOperatorInfo > cop_year(auto column)
returns a ColumnOperatorInfo hash for the "year" operator with the given argument
SqlUtil::cop_as
hash< ColumnOperatorInfo > cop_as(auto column, string arg)
returns a ColumnOperatorInfo hash for the "as" operator with the given argument
SqlUtil::AbstractListContainer::getElementName
abstract string getElementName()
must return the name of the contained element
SqlUtil::sqlutil_register_ds_serializer
sqlutil_register_ds_serializer(*code new_ds_do)
registers a closure or call reference taking a string type and string datasource configuration that w...
SqlUtil::ForeignConstraintTarget::constructor
constructor(string t, Columns c)
creates the object and sets the target table name and the target columns
SqlUtil::AbstractSequence::getCreateSql
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the sequence in the database
SqlUtil::AbstractView::getDropSql
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the view from the database
SqlUtil::AbstractColumn::native_type
string native_type
the native type name of the column
Definition: SqlUtil.qm.dox.h:5646
SqlUtil::DB_PROCEDURES
const DB_PROCEDURES
Feature: procedures.
Definition: SqlUtil.qm.dox.h:2230
join
string join(string str,...)
SqlUtil::AbstractTrigger::getDropSql
abstract list< auto > getDropSql(string table_name)
returns a string that can be used to drop the trigger in the database
SqlUtil::COP_DIVIDE
const COP_DIVIDE
the SQL "divide" operator
Definition: SqlUtil.qm.dox.h:2367
SqlUtil::OP_CLE
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4358
SqlUtil::uop_seq_currval
hash< UpdateOperatorInfo > uop_seq_currval(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
SqlUtil::Tables::getElementName
string getElementName()
returns "table" since this object stores AbstractTable objects
SqlUtil::AbstractHashContainer::values
list< auto > values()
Returns a list of values of the contained hash.
SqlUtil::AbstractColumn::getAddColumnSql
abstract list< auto > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
SqlUtil::AbstractListContainer::size
int size()
Returns the number of elements in the contained list.
SqlUtil::OP_LE
const OP_LE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4328
SqlUtil::AbstractDdlObject::getDdlName
abstract string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
SqlUtil::SqlUtilDataTypeOptionInfo::date_format
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition: SqlUtil.qm.dox.h:2186
SqlUtil::AbstractView
base class for views
Definition: SqlUtil.qm.dox.h:6240
SqlUtil::cop_over
hash< ColumnOperatorInfo > cop_over(auto column, *string partitionby, *string orderby)
returns a ColumnOperatorInfo hash for the "over" clause
SqlUtil::AbstractConstraint::hasColumn
bool hasColumn(string cname)
returns True if the constraint references the named column
SqlUtil::AbstractPrimaryKey
represents a primary key
Definition: SqlUtil.qm.dox.h:6110
SqlUtil::OP_CGE
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4368
False
const False
SqlUtil::JopMap
const JopMap
a hash of valid join operators
Definition: SqlUtil.qm.dox.h:3844
SqlUtil::op_cgt
hash< OperatorInfo > op_cgt(string arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
SqlUtil::OP_OR
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4403
SqlUtil::IOP_SEQ_CURRVAL
const IOP_SEQ_CURRVAL
for using the last value of a sequence issued in the current session
Definition: SqlUtil.qm.dox.h:4923
SqlUtil::SqlUtilDataTypeOptionInfo::maxlen
*softint maxlen
optional additional limit to the maximum length of the data
Definition: SqlUtil.qm.dox.h:2203
SqlUtil::COP_CUME_DIST
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition: SqlUtil.qm.dox.h:2435
SqlUtil::AbstractColumnSupportingConstraint::clearIndex
clearIndex()
clears any index base for the constraint
SqlUtil::COP_MIN
const COP_MIN
to return the minimum value
Definition: SqlUtil.qm.dox.h:2327
SqlUtil::AbstractColumn::equal
bool equal(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
SqlUtil::Tables::add
add(Table val)
adds the given value to the hash with the given key name
SqlUtil::AbstractConstraint::clearIndex
abstract clearIndex()
clears any index base for the constraint
SqlUtil::OP_SUBSTR
const OP_SUBSTR
the SQL "substr" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4398
SqlUtil::AbstractView::getCreateSql
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the view in the database
SqlUtil::NumericColumnInfo::getNativeTypeString
string getNativeTypeString(string native_type, int precision)
returns the string describing the native type that can be used in SQL (for example to add the column ...
SqlUtil::join_left_alias
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 ...
SqlUtil::AbstractHashContainer::hasKeyValue
bool hasKeyValue(string k)
Returns True if the key exists in the contained hash and is assigned a value, False if not.
SqlUtil::Indexes::getElementName
string getElementName()
must return the name of the contained element
SqlUtil::Tables::memberGate
AbstractTable memberGate(string k)
returns the AbstractTable object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::SqlUtilDataTypeOptionInfo::db_timezone
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition: SqlUtil.qm.dox.h:2192
SqlUtil::cop_value
hash< ColumnOperatorInfo > cop_value(auto arg)
returns a ColumnOperatorInfo hash for the "value" (literal) operator with the given argument
SqlUtil::AbstractDdlObject
the base class for named objects
Definition: SqlUtil.qm.dox.h:5616
SqlUtil::AbstractHashContainer::constructor
constructor(*hash nh)
creates the object with the hash argument passed
SqlUtil::AbstractListContainer::empty
bool empty()
returns True if the container is empty, False if not
SqlUtil::AbstractCheckConstraint::src
string src
the source of the check clause
Definition: SqlUtil.qm.dox.h:5994
SqlUtil::AbstractListContainer::take
auto take(int i)
removes the given element from the contained list and returns the value
SqlUtil::AbstractHashContainer::getHash
*hash< auto > getHash()
returns the hash contained by this object
SqlUtil::Constraints
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5886
SqlUtil::Columns::memberGate
AbstractColumn memberGate(string k)
returns the AbstractColumn object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::make_uop
hash< UpdateOperatorInfo > make_uop(string uop, auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash
SqlUtil::cop_cast
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)
SqlUtil::Tables::take
AbstractTable take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::AbstractConstraint::setIndexBase
abstract bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
SqlUtil::Constraints::memberGate
AbstractConstraint memberGate(string k)
returns the AbstractConstraint object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::op_cne
hash< OperatorInfo > op_cne(string arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
SqlUtil::cop_max
hash< ColumnOperatorInfo > cop_max(auto column)
returns a ColumnOperatorInfo hash for the "max" operator; returns maximum column values
SqlUtil::ForeignConstraintTarget::columns
Columns columns
columns in the target table
Definition: SqlUtil.qm.dox.h:6175
SqlUtil::AbstractColumn::size
int size
the size of the column
Definition: SqlUtil.qm.dox.h:5652
SqlUtil
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:32
SqlUtil::AbstractFunctionBase::type
string type
the type of object
Definition: SqlUtil.qm.dox.h:6283
SqlUtil::AbstractColumnSupportingConstraint::getCreateSql
abstract string getCreateSql(string table_name, *hash< auto > opts)
returns a string that can be used to create the constraint in the database
SqlUtil::AbstractHashContainer::take
abstract auto take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::op_between
hash< OperatorInfo > op_between(auto l, auto r)
returns an OperatorInfo hash for the "between" operator with the given arguments, neither of which ca...
SqlUtil::AbstractIndex::getSupportingConstraint
*AbstractColumnSupportingConstraint getSupportingConstraint()
returns the supporting constraint, if any
SqlUtil::COP_AS
const COP_AS
to rename a column on output
Definition: SqlUtil.qm.dox.h:2287
SqlUtil::op_ge
hash< OperatorInfo > op_ge(auto arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
SqlUtil::COP_VALUE
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition: SqlUtil.qm.dox.h:2307
SqlUtil::Tables::getIfExists
*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,...
SqlUtil::Tables::get
AbstractTable get(AbstractDatasource ds, string name)
gets a table from the database or from the cache if already cached
SqlUtil::AbstractColumnSupportingConstraint::renameSourceConstraintTable
renameSourceConstraintTable(string old_name, string new_name)
renames a table in a source constraint
SqlUtil::Tables
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5374
SqlUtil::cop_count
hash< ColumnOperatorInfo > cop_count(auto column='')
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts
SqlUtil::GenericColumnInfo::auto_increment
*bool auto_increment
True for DBs that support an auto-increment column
Definition: SqlUtil.qm.dox.h:2143
SqlUtil::AbstractConstraint::equal
bool equal(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractUniqueConstraint::constructor
constructor(string n, *hash c, *string n_index)
creates the object from the name an a hash of column information
SqlUtil::COP_COALESCE
const COP_COALESCE
to return the first non-null argument in the list
Definition: SqlUtil.qm.dox.h:2407
SqlUtil::cop_last_value
hash< ColumnOperatorInfo > cop_last_value(any column)
Analytic/window function: value evaluated at the row that is the last row of the window frame.
SqlUtil::AbstractFunctionBase::equal
bool equal(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractIndex::name
string name
the name of the index
Definition: SqlUtil.qm.dox.h:5821
SqlUtil::AbstractHashContainer::lastKey
*string lastKey()
Returns the last key name in the contained hash or NOTHING if the contained hash has no keys.
SqlUtil::op_ceq
hash< OperatorInfo > op_ceq(string arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
SqlUtil::JOP_RIGHT
const JOP_RIGHT
for right outer joins
Definition: SqlUtil.qm.dox.h:3841
SqlUtil::AbstractView::name
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6247
SqlUtil::AbstractFunction::setName
setName(string new_name)
sets the new name of the object
SqlUtil::join_inner_alias
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::AbstractTrigger::getRenameSql
abstract softlist< auto > getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
SqlUtil::Tables::add
add(AbstractTable val)
adds the given value to the hash with the given key name
SqlUtil::Columns::constructor
constructor(*hash c)
creates the object from the argument
SqlUtil::Triggers::take
AbstractTrigger take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::cop_seq_currval
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...
number
number number(softnumber n)
SqlUtil::AbstractHashContainer::constructor
constructor(AbstractHashContainer old)
creates a copy of the object
SqlUtil::OP_LIKE
const OP_LIKE
the SQL "like" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4318
SqlUtil::uop_upper
hash< UpdateOperatorInfo > uop_upper(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "upper" operator with the given argument; returns a column...
SqlUtil::AbstractListContainer::constructor
constructor(softlist nl)
creates the object with the list<auto> argument passed
SqlUtil::GenericColumnInfo::driver
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:2141
SqlUtil::OP_CLT
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition: SqlUtil.qm.dox.h:4353
SqlUtil::AbstractColumnSupportingConstraint::getSourceConstraintIterator
Qore::AbstractIterator getSourceConstraintIterator()
returns an iterator through all known source foreign constraints on the current table
SqlUtil::AbstractDdlObject::name
string name
the name of the object
Definition: SqlUtil.qm.dox.h:5620
SqlUtil::make_op
hash< OperatorInfo > make_op(string op, auto arg)
returns an OperatorInfo hash
SqlUtil::Tables::add
add(string k, Table val)
adds the given value to the hash with the given key name
SqlUtil::AbstractDdlObject::constructor
constructor()
empty constructor for subclasses
SqlUtil::AbstractColumnSupportingConstraint::equalImpl
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
SqlUtil::CLOB
const CLOB
specifies a large variable-length character column (ie CLOB or TEXT, etc)
Definition: SqlUtil.qm.dox.h:2260
SqlUtil::ColumnOperatorInfo::cop
string cop
the column operator string code
Definition: SqlUtil.qm.dox.h:2154
SqlUtil::Tables::constructor
constructor()
creates an empty object
SqlUtil::join_inner
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
SqlUtil::COP_RANK
const COP_RANK
Analytic (window) function: RANK.
Definition: SqlUtil.qm.dox.h:2477
SqlUtil::cop_seq
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence ...
SqlUtil::AbstractColumn::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the column from the table
Qore::AbstractIterator
SqlUtil::AbstractIndex::equalExceptName
bool equalExceptName(AbstractIndex ix)
returns True if the argument is equal to the current index with the exception of the name,...
SqlUtil::AbstractIndex::hasColumn
bool hasColumn(string cname)
returns True if the constraint references the named column
SqlUtil::OperatorInfo
SQL operator info hash as returned by all operator functions.
Definition: SqlUtil.qm.dox.h:2147
SqlUtil::cop_trunc_date
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...
SqlUtil::op_lt
hash< OperatorInfo > op_lt(auto arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
SqlUtil::AbstractConstraint
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5928
SqlUtil::DB_MVIEWS
const DB_MVIEWS
Feature: materialized views / snapshots.
Definition: SqlUtil.qm.dox.h:2226
SqlUtil::AbstractFunctionBase::src
string src
the source of the object
Definition: SqlUtil.qm.dox.h:6286
SqlUtil::uop_seq
hash< UpdateOperatorInfo > uop_seq(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
SqlUtil::AbstractFunctionBase::equalImpl
abstract bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
SqlUtil::Columns::equal
bool equal(Columns cols)
returns True if the argument has the same columns in the same order as the current object,...
SqlUtil::Tables::populate
populate(AbstractDatasource ds, hash< auto > tables, *hash< auto > opt)
populates the object from a hash<auto> description
SqlUtil::DT_SECOND
const DT_SECOND
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3575
SqlUtil::AbstractIndex::setSupportingConstraint
setSupportingConstraint(AbstractColumnSupportingConstraint c)
tags the index with a column supporting constraint (unique or fk constraint, etc) that the index supp...
SqlUtil::Columns::add
add(string k, AbstractColumn val)
adds the given value to the hash with the given key name
SqlUtil::COP_AVG
const COP_AVG
to return the average value
Definition: SqlUtil.qm.dox.h:2337
SqlUtil::Tables::getRenameTableIfExistsSql
*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...
SqlUtil::COP_FIRST_VALUE
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition: SqlUtil.qm.dox.h:2449
SqlUtil::AbstractListContainer::add
add(auto val)
adds the given value to the list
SqlUtil::AbstractHashContainer::matchKeys
bool matchKeys(hash h1)
returns True if the hash argument has the same keys (in any order), False if not
SqlUtil::OP_EQ
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4348
SqlUtil::AbstractSequence::name
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6208
SqlUtil::UpdateOperatorInfo::nest
*hash nest
option nested operation hash
Definition: SqlUtil.qm.dox.h:2169
SqlUtil::GenericColumnInfo::default_value
auto default_value
the default value for the column
Definition: SqlUtil.qm.dox.h:2133
NT_STRING
const NT_STRING
SqlUtil::SZ_NONE
const SZ_NONE
the data type does not take a size parameter
Definition: SqlUtil.qm.dox.h:2268
SqlUtil::DB_SYNONYMS
const DB_SYNONYMS
Feature: synonyms.
Definition: SqlUtil.qm.dox.h:2240
SqlUtil::Constraints::findEqualUniqueConstraint
*AbstractUniqueConstraint findEqualUniqueConstraint(AbstractUniqueConstraint uk)
finds a unique constraint with the same columns as the unique constraint passed
SqlUtil::OP_IN_SELECT
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4408