Qore SqlUtil Module Reference  1.7.5
SqlUtil.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SqlUtil.qm Copyright (C) 2013 - 2022 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // minimum required Qore version
26 
27 // requires the Util module
28 
29 // requires the DataProvider module
30 
31 // don't use "$" signs for variables and class members, assume local variable scope
32 
33 // require type definitions everywhere
34 
35 // enable all warnings
36 
37 
38 // version history is included below in the docs
39 
2198 namespace SqlUtil {
2200  public struct GenericColumnInfo {
2202  string qore_type;
2204  string native_type;
2206  softint size;
2208  softint scale;
2214  *string comment;
2216  bool notnull = False;
2218  hash<string, hash> driver;
2221  };
2222 
2224  public struct OperatorInfo {
2225  string op;
2226  auto arg;
2227  };
2228 
2230  public struct ColumnOperatorInfo {
2231  string cop;
2232  auto column;
2233  auto arg;
2234  };
2235 
2237  public struct InsertOperatorInfo {
2238  string _iop;
2239  any arg;
2240  };
2241 
2243  public struct UpdateOperatorInfo {
2244  string uop;
2245  auto arg;
2247  };
2248 
2250  public struct JoinOperatorInfo {
2251  string jop;
2252  auto table;
2253  *string alias;
2256  *string ta;
2257  *hash<auto> opt;
2258  };
2259 
2263  *string date_format;
2264 
2266  *TimeZone data_timezone;
2267 
2269  *TimeZone db_timezone;
2270 
2272  *string number_format;
2273 
2275  *softbool mandatory;
2276 
2278 
2280  *softint maxlen;
2281  };
2282 
2284 
2286  public struct SqlCommandInfo {
2288  string sql;
2289 
2291  list<auto> args;
2292  };
2293 
2299 
2301  const DB_FUNCTIONS = "functions";
2303  const DB_MVIEWS = "materialized views";
2305  const DB_PACKAGES = "packages";
2307  const DB_PROCEDURES = "procedures";
2309  const DB_SEQUENCES = "sequences";
2311  const DB_TABLES = "tables";
2313  const DB_TYPES = "named types";
2315  const DB_VIEWS = "views";
2317  const DB_SYNONYMS = "synonyms";
2319 
2320  /* @defgroup SqlTypeConstants SQL Type Constants
2321  These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
2322  */
2324  const VARCHAR = "string";
2326 
2328  const NUMERIC = "number";
2329 
2331  const CHAR = "char";
2332 
2334  const BLOB = "blob";
2335 
2337  const CLOB = "clob";
2339 
2345  const SZ_NONE = 0;
2346 
2348  const SZ_MAND = 1;
2349 
2351  const SZ_OPT = 2;
2352 
2354  const SZ_NUM = 3;
2356 
2362 
2364  const COP_AS = "as";
2365 
2367 
2369  const COP_CAST = "cast";
2370 
2372 
2374  const COP_PREPEND = "prepend";
2375 
2377 
2379  const COP_APPEND = "append";
2380 
2382 
2384  const COP_VALUE = "value";
2385 
2387 
2389  const COP_UPPER = "upper";
2390 
2392 
2394  const COP_LOWER = "lower";
2395 
2397 
2399  const COP_DISTINCT = "distinct";
2400 
2402 
2404  const COP_MIN = "min";
2405 
2407 
2409  const COP_MAX = "max";
2410 
2412 
2414  const COP_AVG = "avg";
2415 
2417 
2419  const COP_SUM = "sum";
2420 
2422 
2424  const COP_COUNT = "count";
2425 
2427 
2429  const COP_OVER = "over";
2430 
2432 
2434  const COP_MINUS = "minus";
2435 
2437 
2439  const COP_PLUS = "plus";
2440 
2442 
2444  const COP_DIVIDE = "divide";
2445 
2447 
2449  const COP_MULTIPLY = "multiply";
2450 
2452 
2454  const COP_YEAR = "year";
2455 
2457 
2459  const COP_YEAR_MONTH = "year_month";
2460 
2462 
2464  const COP_YEAR_DAY = "year_day";
2465 
2467 
2469  const COP_YEAR_HOUR = "year_hour";
2470 
2472 
2474  const COP_SEQ = "seq";
2475 
2477 
2479  const COP_SEQ_CURRVAL = "seq_currval";
2480 
2482 
2484  const COP_COALESCE = "coalesce";
2485 
2487 
2489  const COP_SUBSTR = "substr";
2490 
2492 
2496  const COP_LENGTH = "length";
2497 
2499 
2505  const COP_TRUNC_DATE = "truncate_date";
2506 
2508 
2512  const COP_CUME_DIST = "cume_dist";
2513 
2515 
2519  const COP_DENSE_RANK = "dense_rank";
2520 
2522 
2526  const COP_FIRST_VALUE = "first_value";
2527 
2529 
2533  const COP_LAST_VALUE = "last_value";
2534 
2536 
2540  const COP_NTILE = "ntile";
2541 
2543 
2547  const COP_PERCENT_RANK = "percent_rank";
2548 
2550 
2554  const COP_RANK = "rank";
2555 
2557 
2561  const COP_ROW_NUMBER = "row_number";
2562 
2564  const DefaultCopMap = ...;
2565 
2567 
2610 
2618  hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
2619 
2620 
2622 
2634  hash<ColumnOperatorInfo> cop_as(auto column, string arg);
2635 
2636 
2638 
2652  hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
2653 
2654 
2656 
2666  hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
2667 
2668 
2670 
2680  hash<ColumnOperatorInfo> cop_append(auto column, string arg);
2681 
2682 
2684 
2812  hash<ColumnOperatorInfo> cop_value(auto arg);
2813 
2814 
2816 
2825  hash<ColumnOperatorInfo> cop_upper(auto column);
2826 
2827 
2829 
2838  hash<ColumnOperatorInfo> cop_lower(auto column);
2839 
2840 
2842 
2851  hash<ColumnOperatorInfo> cop_distinct(auto column);
2852 
2853 
2855 
2864  hash<ColumnOperatorInfo> cop_min(auto column);
2865 
2866 
2868 
2877  hash<ColumnOperatorInfo> cop_max(auto column);
2878 
2879 
2881 
2890  hash<ColumnOperatorInfo> cop_avg(auto column);
2891 
2892 
2894 
2903  hash<ColumnOperatorInfo> cop_sum(auto column);
2904 
2905 
2907 
2914  hash<ColumnOperatorInfo> cop_count(auto column = '');
2915 
2916 
2918 
2925  hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
2926 
2927 
2929 
2939  hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
2940 
2941 
2943 
2953  hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
2954 
2955 
2957 
2967  hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
2968 
2969 
2971 
2981  hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
2982 
2983 
2985 
2994  hash<ColumnOperatorInfo> cop_year(auto column);
2995 
2996 
2998 
3007  hash<ColumnOperatorInfo> cop_year_month(auto column);
3008 
3009 
3011 
3020  hash<ColumnOperatorInfo> cop_year_day(auto column);
3021 
3022 
3024 
3033  hash<ColumnOperatorInfo> cop_year_hour(auto column);
3034 
3035 
3037 
3047  hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
3048 
3049 
3051 
3061  hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
3062 
3063 
3065 
3077  hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
3078 
3079 
3081 
3092  hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
3093 
3094 
3096 
3107  hash<ColumnOperatorInfo> cop_length(auto column);
3108 
3109 
3111 
3125  hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
3126 
3127 
3128 
3130 
3158  hash<ColumnOperatorInfo> cop_cume_dist();
3159 
3160 
3162 
3190  hash<ColumnOperatorInfo> cop_dense_rank();
3191 
3192 
3194 
3222  hash<ColumnOperatorInfo> cop_first_value(any column);
3223 
3224 
3226 
3254  hash<ColumnOperatorInfo> cop_last_value(any column);
3255 
3256 
3258 
3288  hash<ColumnOperatorInfo> cop_ntile(int value);
3289 
3290 
3292 
3320  hash<ColumnOperatorInfo> cop_percent_rank();
3321 
3322 
3324 
3352  hash<ColumnOperatorInfo> cop_rank();
3353 
3354 
3356 
3384  hash<ColumnOperatorInfo> cop_row_number();
3385 
3386 
3388 
3440  const DT_YEAR = "Y";
3441 
3443  const DT_MONTH = "M";
3444 
3446  const DT_DAY = "D";
3447 
3449  const DT_HOUR = "H";
3450 
3452  const DT_MINUTE = "m";
3453 
3455  const DT_SECOND = "S";
3456 
3457  // let's simulate and enum here'
3458  const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
3460 
3466  const DefaultUopMap = ...;
3467 
3469 
3492 
3500  hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
3501 
3502 
3504 
3514  hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
3515 
3516 
3518 
3528  hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
3529 
3530 
3532 
3541  hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
3542 
3543 
3545 
3554  hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
3555 
3556 
3558 
3569  hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
3570 
3571 
3573 
3583  hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
3584 
3585 
3587 
3597  hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
3598 
3599 
3601 
3611  hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
3612 
3613 
3615 
3625  hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
3626 
3627 
3629 
3638  hash<UpdateOperatorInfo> uop_seq(string seq);
3639 
3640 
3642 
3651  hash<UpdateOperatorInfo> uop_seq_currval(string seq);
3652 
3654 
3662 
3664  const JOP_INNER = "inner";
3665 
3667 
3669  const JOP_LEFT = "left";
3670 
3672 
3674  const JOP_RIGHT = "right";
3675 
3677  const JopMap = ...;
3678 
3680 
3691 
3694  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3695 
3696 
3698 
3702  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3703 
3704 
3706 
3725  hash<string, hash<JoinOperatorInfo>> join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3726 
3727 
3729 
3748  hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3749 
3750 
3752 
3771  hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3772 
3773 
3775 
3797  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3798 
3799 
3801 
3821  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3822 
3823 
3825 
3847  hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3848 
3849 
3851 
3870  hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3871 
3872 
3874 
3893  hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3894 
3895 
3897 
3918  hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3919 
3920 
3922 
3942  hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3943 
3944 
3946 
3966  hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3967 
3968 
3970 
3992  hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3993 
3994 
3996 
4015  hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4016 
4017 
4019 
4038  hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4039 
4040 
4042 
4063  hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4064 
4065 
4067 
4087  hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4088 
4089 
4091 
4111  hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4112 
4113 
4115 
4137  hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4138 
4140 
4146 
4148  const OP_LIKE = "like";
4149 
4151 
4153  const OP_LT = "<";
4154 
4156 
4158  const OP_LE = "<=";
4159 
4161 
4163  const OP_GT = ">";
4164 
4166 
4168  const OP_GE = ">=";
4169 
4171 
4173  const OP_NE = "!=";
4174 
4176 
4178  const OP_EQ = "=";
4179 
4181 
4183  const OP_CLT = "C<";
4184 
4186 
4188  const OP_CLE = "C<=";
4189 
4191 
4193  const OP_CGT = "C>";
4194 
4196 
4198  const OP_CGE = "C>=";
4199 
4201 
4203  const OP_CNE = "C!=";
4204 
4206 
4208  const OP_CEQ = "C=";
4209 
4211 
4213  const OP_BETWEEN = "between";
4214 
4216 
4218  const OP_IN = "in";
4219 
4221 
4223  const OP_NOT = "not";
4224 
4226 
4228  const OP_SUBSTR = "substr";
4229 
4231 
4233  const OP_OR = "or";
4234 
4236 
4238  const OP_IN_SELECT = "in_select";
4239 
4241  const DefaultOpMap = ...;
4242 
4244 
4269  hash<OperatorInfo> make_op(string op, auto arg);
4270 
4271 
4273 
4282  hash<OperatorInfo> op_like(string str);
4283 
4284 
4286 
4297  hash<OperatorInfo> op_lt(auto arg);
4298 
4299 
4301 
4312  hash<OperatorInfo> op_le(auto arg);
4313 
4314 
4316 
4327  hash<OperatorInfo> op_gt(auto arg);
4328 
4329 
4331 
4342  hash<OperatorInfo> op_ge(auto arg);
4343 
4344 
4346 
4359  hash<OperatorInfo> op_ne(auto arg);
4360 
4361 
4363 
4376  hash<OperatorInfo> op_eq(auto arg);
4377 
4378 
4380 
4392  hash<OperatorInfo> op_between(auto l, auto r);
4393 
4394 
4396 
4405  hash<OperatorInfo> op_in();
4406 
4407 
4409 
4416  hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
4417 
4418 
4420 
4427  hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
4428 
4429 
4431 
4438  hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
4439 
4440 
4442 
4453  hash<OperatorInfo> op_in(list<auto> args);
4454 
4455 
4457 
4464  hash<OperatorInfo> op_not(hash arg);
4465 
4466 
4468 
4479  hash<OperatorInfo> op_clt(string arg);
4480 
4481 
4483 
4494  hash<OperatorInfo> op_cle(string arg);
4495 
4496 
4498 
4509  hash<OperatorInfo> op_cgt(string arg);
4510 
4511 
4513 
4524  hash<OperatorInfo> op_cge(string arg);
4525 
4526 
4528 
4539  hash<OperatorInfo> op_cne(string arg);
4540 
4541 
4543 
4554  hash<OperatorInfo> op_ceq(string arg);
4555 
4556 
4558 
4569  hash<OperatorInfo> op_substr(int start, *int count, string text);
4570 
4571 
4573 
4583  hash<OperatorInfo> op_substr(int start, string text);
4584 
4585 
4587 
4604  hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
4605 
4607 
4615 
4617  const IOP_SEQ = "seq";
4618 
4620 
4622  const IOP_SEQ_CURRVAL = "seq_currval";
4623 
4625  const DefaultIopMap = {};
4627 
4634 
4641  hash<InsertOperatorInfo> make_iop(string iop, auto arg);
4642 
4643 
4645 
4654  hash<InsertOperatorInfo> iop_seq(string arg);
4655 
4656 
4658 
4667  hash<InsertOperatorInfo> iop_seq_currval(string arg);
4668 
4670 
4672  const SqlUtilDrivers = ...;
4673 
4674 
4675  // private variable to store the closure used to deserialize datasources (if any)
4676  extern code ds_get;
4677 
4678  // private variable to store the closure used to serialize datasources (if any)
4679  extern code ds_do;
4680 
4683 
4684 
4687 
4688 
4689  // private function used to deserialize datasources
4690  AbstractDatasource sqlutil_get_ds(string type, string config);
4691 
4692 
4693  // private function used to serialize datasources
4694  hash<auto> sqlutil_ds(AbstractDatasource ds);
4695 
4696 
4698 class AbstractHashContainer : public Serializable {
4699 
4700 public:
4701 
4702 
4703 protected:
4706 
4707 public:
4708 
4711 
4712 
4715 
4716 
4719 
4720 
4722 
4737  auto memberGate(string k);
4738 
4739 
4741 
4748 
4749 
4751  abstract auto take(string k);
4752 
4754  renameKey(string old_name, string new_name);
4755 
4756 
4758  *hash<auto> getHash();
4759 
4760 
4762 
4771  bool matchKeys(hash h1);
4772 
4773 
4775 
4784  bool matchKeys(list<auto> l);
4785 
4786 
4788 
4798 
4799 
4801 
4811 
4812 
4814 
4823  bool partialMatchKeys(list<auto> l);
4824 
4825 
4827 
4837 
4838 
4840 
4849  bool val();
4850 
4851 
4853 
4860  list<string> keys();
4861 
4862 
4864 
4871  list<auto> values();
4872 
4873 
4875 
4883 
4884 
4886 
4894 
4895 
4897 
4905 
4906 
4908  bool empty();
4909 
4910 
4912 
4919  int size();
4920 
4921 
4923 
4932  bool hasKey(string k);
4933 
4934 
4936 
4945  bool hasKeyValue(string k);
4946 
4947 
4949 
4958  *string firstKey();
4959 
4960 
4962 
4971  *string lastKey();
4972 
4973 
4975  abstract string getElementName();
4976  };
4977 
4979 class AbstractListContainer : public Serializable {
4980 
4981 public:
4982 
4983 
4984 protected:
4985  softlist l;
4986 
4987 public:
4988 
4990  constructor(softlist nl);
4991 
4992 
4994 
5005  abstract auto get(softint i);
5006 
5008  add(auto val);
5009 
5010 
5012  auto take(int i);
5013 
5014 
5016  list<auto> getList();
5017 
5018 
5020 
5029  bool val();
5030 
5031 
5033 
5041 
5042 
5044  bool empty();
5045 
5046 
5048 
5055  int size();
5056 
5057 
5059  abstract string getElementName();
5060 
5061 protected:
5062  checkIndex(int i);
5063 public:
5064 
5065  };
5066 
5069 
5070 public:
5073 
5074 
5076  constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
5077 
5078 
5080  constructor(AbstractDatasource ds);
5081 
5082 
5084  add(string k, Table val);
5085 
5086 
5088  add(string k, AbstractTable val);
5089 
5090 
5093 
5094 
5097 
5098 
5100  AbstractTable take(string k);
5101 
5102 
5104  populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
5105 
5106 
5108  populate(AbstractDatasource ds);
5109 
5110 
5112 
5128  *list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
5129 
5130 
5132 
5148 
5149 
5151  string getElementName();
5152 
5153 
5155  *AbstractTable getIfExists(AbstractDatasource ds, string name);
5156 
5157 
5159  AbstractTable get(AbstractDatasource ds, string name);
5160 
5161 
5163 
5178  *string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
5179 
5180 
5182 
5193  bool tableRenamed(string old_name, string new_name, string old_sql_name);
5194 
5195 
5196 protected:
5197  tableRenamedIntern(string old_name, string new_name, string oldsn);
5198 public:
5199 
5200 
5202 
5217  *string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
5218 
5219 
5220  list<auto> getCreateList();
5221 
5222 
5223  Qore::AbstractIterator createIterator();
5224 
5225 
5227 
5235  list<auto> getDropList();
5236 
5237 
5239 
5247 
5248 
5249 protected:
5250  getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
5251 public:
5252 
5253  };
5254 
5257 
5258 public:
5261 
5262 
5265 
5266 
5268  add(string k, AbstractColumn val);
5269 
5270 
5273 
5274 
5276 
5292 
5293 
5295  Columns subset(softlist l);
5296 
5297 
5299  string getElementName();
5300 
5301 
5303  bool equal(Columns cols);
5304 
5305 
5307  AbstractIterator getSqlColumnNameIterator();
5308 
5309  };
5310 
5312 class AbstractDdlObject : public Serializable {
5313 
5314 public:
5316  string name;
5317 
5319  string ddl_name;
5320 
5322 protected:
5324 public:
5325 
5326 
5329 
5330 
5332 
5334  abstract string getDdlName(string name);
5335  };
5336 
5339 
5340 public:
5342  string native_type;
5343 
5345  *string qore_type;
5346 
5348  int size;
5349 
5351  bool nullable;
5352 
5354  *string def_val;
5355 
5357  *string comment;
5358 
5360  *int scale;
5361 
5364 
5366 protected:
5368 public:
5369 
5370 
5371  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c, *int scale)
5372  ;
5373 
5374 
5376 
5380  hash<GenericColumnInfo> getDescriptionHash();
5381 
5382 
5384 
5387 
5388 
5391 
5392 
5394 
5403  abstract list<auto> getAddColumnSql(AbstractTable t);
5404 
5406  string getDropSql(string table_name);
5407 
5408 
5410 
5423  list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5424 
5425 
5427 
5437  abstract string getRenameSql(AbstractTable t, string new_name);
5438 
5441 
5442 
5444 protected:
5445  abstract bool equalImpl(AbstractColumn c);
5446 public:
5447 
5449 
5465 protected:
5466  abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5467 public:
5468  };
5469 
5472 
5473 public:
5474  constructor(*hash c) ;
5475 
5476 
5478  add(string k, AbstractIndex val);
5479 
5480 
5483 
5484 
5486  AbstractIndex take(string k);
5487 
5488 
5491 
5492 
5494 
5510 
5511 
5512  string getElementName();
5513 
5514  };
5515 
5517 class AbstractIndex : public Serializable {
5518 
5519 public:
5521  string name;
5522 
5524  bool unique;
5525 
5528 
5529 protected:
5532 
5535 
5536 public:
5537 
5539  constructor(string n, bool u, hash c);
5540 
5541 
5543  string getName();
5544 
5545 
5547  bool hasColumn(string cname);
5548 
5549 
5551  abstract string getCreateSql(string table_name, *hash<auto> opt);
5552 
5554  string getDropSql(string table_name);
5555 
5556 
5559 
5560 
5563 
5564 
5566  abstract bool equalImpl(AbstractIndex ix);
5567 
5569  abstract string getRenameSql(string table_name, string new_name);
5570 
5573 
5574 
5577 
5578 
5581 
5582 
5585 
5586 
5589 
5590 
5593 
5594 
5596  *list<AbstractColumnConstraint> getAllSupportingConstraints();
5597 
5598 
5600  list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
5601 
5602  };
5603 
5606 
5607 public:
5608  constructor(*hash c) ;
5609 
5610 
5613 
5614 
5617 
5618 
5621 
5622 
5624 
5640 
5641 
5642  string getElementName();
5643 
5644  };
5645 
5647 class AbstractConstraint : public Serializable {
5648 
5649 public:
5650 
5651 
5652 protected:
5654  string name;
5655 
5656 public:
5657 
5659  constructor(string n);
5660 
5661 
5663  string getName();
5664 
5665 
5667  rename(string n);
5668 
5669 
5671  abstract string getCreateSql(string table_name, *hash<auto> opt);
5672 
5674  string getDropSql(string table_name);
5675 
5676 
5678  abstract list<auto> getRenameSql(string table_name, string new_name);
5679 
5681  string getDisableSql(string table_name);
5682 
5683 
5685  string getEnableSql(string table_name, *hash<auto> opt);
5686 
5687 
5690 
5691 
5693 protected:
5694  abstract bool equalImpl(AbstractConstraint c);
5695 public:
5696 
5698  abstract bool setIndexBase(string ix);
5699 
5701  abstract clearIndex();
5702 
5704  bool hasColumn(string cname);
5705 
5706  };
5707 
5710 
5711 public:
5713  string src;
5714 
5716  constructor(string n, string n_src) ;
5717 
5718 
5720 protected:
5722 public:
5723 
5724 
5726  bool setIndexBase(string ix);
5727 
5728 
5731 
5732  };
5733 
5736 
5737 public:
5738 protected:
5740  *string index;
5741 
5742 public:
5743 
5745  constructor(string name, *hash<auto> cols, *string index) ;
5746 
5747 
5749  constructor(string name, Columns cols, *string index) ;
5750 
5751 
5753  bool setIndexBase(string ix);
5754 
5755 
5758 
5759  };
5760 
5763 
5764 public:
5765 protected:
5767  *hash<string, hash<string, AbstractForeignConstraint>> sourceConstraints;
5768 
5769 public:
5770 
5772  constructor(string name, *hash<auto> cols, *string index) ;
5773 
5774 
5776  constructor(string name, Columns cols, *string index) ;
5777 
5778 
5780 
5785 
5786 
5788  hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
5789 
5790 
5793 
5794 
5796 
5807 
5808 
5810  removeSourceConstraint(string tname, list<auto> cols);
5811 
5812 
5814  renameSourceConstraintTable(string old_name, string new_name);
5815 
5816 
5818  bool hasColumn(string cname);
5819 
5820 
5822  *string getIndex();
5823 
5824 
5826 protected:
5828 public:
5829 
5830 
5832  abstract string getCreateSql(string table_name, *hash<auto> opts);
5833  };
5834 
5837 
5838 public:
5840  constructor(string n, *hash<auto> c, *string n_index) ;
5841 
5842  };
5843 
5846 
5847 public:
5848  constructor() ;
5849 
5850 
5851  constructor(string n, *hash<auto> c) ;
5852 
5853  };
5854 
5857 
5858 public:
5859  constructor(*hash<auto> c) ;
5860 
5861 
5864 
5865 
5868 
5869 
5872 
5873 
5875 
5891 
5892 
5894  *hash<auto> findConstraintOn(string table, softlist<auto> cols);
5895 
5896 
5898  string getElementName();
5899 
5900  };
5901 
5903 class ForeignConstraintTarget : public Serializable {
5904 
5905 public:
5907  string table;
5908 
5911 
5913  constructor(string t, Columns c);
5914 
5915 
5918 
5919  };
5920 
5923 
5924 public:
5927 
5928  constructor(string name, Columns cols, ForeignConstraintTarget t) ;
5929 
5930 
5932 protected:
5934 public:
5935 
5936  };
5937 
5939 class AbstractSequence : public Serializable {
5940 
5941 public:
5943  string name;
5944 
5947 
5950 
5953 
5955  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
5956 
5957 
5959  abstract string getCreateSql(*hash<auto> opt);
5960 
5962 
5964  string getDropSql(*hash<auto> opt);
5965 
5966 
5968 
5971  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
5972  };
5973 
5975 class AbstractView : public Serializable {
5976 
5977 public:
5978  // ! potential object schema
5979  *string schema;
5980 
5982  string name;
5983 
5985  string src;
5986 
5989 
5991  constructor(string n_name, string n_src);
5992 
5993 
5995  abstract string getCreateSql(*hash<auto> opt);
5996 
5998 
6000  string getDropSql(*hash<auto> opt);
6001 
6002 
6004 
6007  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6008  };
6009 
6011 class AbstractFunctionBase : public Serializable {
6012 
6013 public:
6015  string name;
6016 
6018  string type;
6019 
6021  string src;
6022 
6024 
6028  constructor(string n, string n_type, string n_src);
6029 
6030 
6032  string getType();
6033 
6034 
6036 
6038  string getDropSql(*hash<auto> opt);
6039 
6040 
6043 
6044 
6046  string getNormalizedSource(string src);
6047 
6048 
6050 protected:
6052 public:
6053  };
6054 
6057 
6058 public:
6060 
6064  constructor(string n, string n_type, string n_src) ;
6065 
6066 
6068  abstract list<auto> getCreateSql(*hash<auto> opt);
6069 
6071 
6074  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6075 
6077  setName(string new_name);
6078 
6079  };
6080 
6083 
6084 public:
6085  constructor(*hash c) ;
6086 
6087 
6090 
6091 
6094 
6095 
6097 
6113 
6114 
6115  string getElementName();
6116 
6117  };
6118 
6121 
6122 public:
6124  constructor(string n, string n_src) ;
6125 
6126 
6128  abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
6129 
6131  abstract softlist<auto> getRenameSql(string table_name, string new_name);
6132 
6134  abstract list<auto> getDropSql(string table_name);
6135  };
6136 
6139 
6140 public:
6141  constructor(*hash c) ;
6142 
6143 
6146 
6147 
6150 
6151 
6153 
6169 
6170 
6171  string getElementName();
6172 
6173  };
6174 };
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5709
string src
the source of the check clause
Definition: SqlUtil.qm.dox.h:5713
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_src)
creates the object and sets its name and the check clause source
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
clearIndex()
clears any index base for the constraint
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:5735
*string index
the index supporting the constraint
Definition: SqlUtil.qm.dox.h:5740
constructor(string name, Columns cols, *string index)
creates the object from the name and a Columns object
clearIndex()
clears any index base for the constraint
constructor(string name, *hash< auto > cols, *string index)
creates the object from the name and a hash of column information
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
the base class for column information
Definition: SqlUtil.qm.dox.h:5338
abstract list< auto > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
abstract bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
abstract string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
string native_type
the native type name of the column
Definition: SqlUtil.qm.dox.h:5342
*string comment
comment on the column
Definition: SqlUtil.qm.dox.h:5357
*string def_val
default value for column
Definition: SqlUtil.qm.dox.h:5354
list< auto > getModifySql(AbstractTable t, AbstractColumn c, *hash< auto > opt)
returns a list of sql strings that can be used to modify the column to the new definition; if the col...
constructor()
empty constructor for subclasses
hash< GenericColumnInfo > getDescriptionHash()
Returns a description hash of the column.
abstract list< auto > getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash< auto > opt)
returns a list of sql strings that can be used to modify the column to the new definition
*string qore_type
the equivalent qore type name of the column if known
Definition: SqlUtil.qm.dox.h:5345
string getCreateSql(AbstractTable t)
returns an sql string that can be used to add the column to a table
bool nullable
True if the column can hold a NULL value, False if not
Definition: SqlUtil.qm.dox.h:5351
bool equal(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
const DefaultVarcharSize
Default VARCHAR column size.
Definition: SqlUtil.qm.dox.h:5363
string getNativeTypeString()
returns the string describing the native type that can be used in SQL
int size
the size of the column
Definition: SqlUtil.qm.dox.h:5348
*int scale
the scale for numeric columns
Definition: SqlUtil.qm.dox.h:5360
string getDropSql(string table_name)
returns a string that can be used to drop the column from the table
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:5762
Qore::AbstractIterator getSourceConstraintIterator()
returns an iterator through all known source foreign constraints on the current table
addSourceConstraint(string tname, AbstractForeignConstraint fk)
adds a foreign constraint source to the unique constraint
*hash< string, hash< string, AbstractForeignConstraint > > sourceConstraints
a hash of ForeignConstraintSources, keyed by table name, the value is a hash of foreign constraints k...
Definition: SqlUtil.qm.dox.h:5767
constructor(string name, Columns cols, *string index)
creates the object from the name and a Columns object
renameSourceConstraintTable(string old_name, string new_name)
renames a table in a source constraint
abstract string getCreateSql(string table_name, *hash< auto > opts)
returns a string that can be used to create the constraint in the database
findMatchingIndex(*Indexes indexes)
find an index that matches the constraint and marks both objects as related
*string getIndex()
returns the name of the associated index, if any
hash< auto > getDisableReenableSql(AbstractDatasource ds, string table_name, *hash< auto > opts)
returns lists of SQL strings to disable this constraint plus any dependent constraints and another li...
removeSourceConstraint(string tname, list< auto > cols)
removes a source constraint
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
constructor(string name, *hash< auto > cols, *string index)
creates the object from the name and a hash of column information
bool hasColumn(string cname)
returns True if the constraint references the named column
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5647
abstract bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database; if disabli...
string getName()
returns the constraint name
constructor(string n)
creates the object and sets its name
abstract list< auto > getRenameSql(string table_name, string new_name)
returns a list of SQL strings that can be used to rename the constraint in the database
bool hasColumn(string cname)
returns True if the constraint references the named column
rename(string n)
renames the constraint
abstract clearIndex()
clears any index base for the constraint
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
string name
the name of the constraint
Definition: SqlUtil.qm.dox.h:5654
abstract bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
bool equal(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
string getEnableSql(string table_name, *hash< auto > opt)
returns a string that can be used to enable the constraint in the database; if disabling constraints ...
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the constraint in the database
the base class for named objects
Definition: SqlUtil.qm.dox.h:5312
constructor()
empty constructor for subclasses
abstract string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
string ddl_name
the name of the object for DDL (in case it's a reserved word)
Definition: SqlUtil.qm.dox.h:5319
string name
the name of the object
Definition: SqlUtil.qm.dox.h:5316
constructor(string name)
creates the object from the name
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:5922
bool equalImpl(AbstractConstraint con)
returns True if the argument is equal to the current object, False if not
ForeignConstraintTarget target
a ForeignConstraintTarget object to describe the target table and columns
Definition: SqlUtil.qm.dox.h:5926
base class for function or objects with code
Definition: SqlUtil.qm.dox.h:6011
string getNormalizedSource(string src)
returns normalized source for comparisons
string name
the name of the object
Definition: SqlUtil.qm.dox.h:6015
abstract bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the function from the database
bool equal(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
string src
the source of the object
Definition: SqlUtil.qm.dox.h:6021
string type
the type of object
Definition: SqlUtil.qm.dox.h:6018
string getType()
returns the type of object
base class for functions
Definition: SqlUtil.qm.dox.h:6056
abstract softlist< auto > getRenameSql(string new_name, *hash< auto > opt)
returns a list of strings that can be used to rename the function in the database
setName(string new_name)
sets the new name of the object
abstract list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that can be used to create the function in the database
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:4698
list< auto > values()
Returns a list of values of the contained hash.
bool partialMatchKeys(hash h1)
returns True if the hash argument has at least the same keys (in any order, can have more keys),...
Qore::AbstractIterator pairIterator()
Returns a HashPairIterator object for the contained hash.
bool hasKeyValue(string k)
Returns True if the key exists in the contained hash and is assigned a value, False if not.
abstract auto take(string k)
removes the given key from the contained hash and returns the value
list< string > keys()
Returns a list of key names of the contained hash.
bool partialMatchKeys(list< auto > l)
returns True if the list<auto> argument has at least the same keys (in any order, can have more keys)...
*string firstKey()
Returns the first key name in the contained hash or NOTHING if the contained hash has no keys.
bool partialMatchKeys(AbstractHashContainer c)
returns True if the container argument has at least the same keys (in any order, can have more keys),...
Qore::AbstractIterator iterator()
Returns a HashIterator object for the contained hash.
auto memberGate(string k)
returns the value of the given key in the contained hash if it exists, otherwise throws a KEY-ERROR e...
bool hasKey(string k)
Returns True if the key exists in the contained hash (may or may not be assigned a value),...
*hash< auto > getHash()
returns the hash contained by this object
renameKey(string old_name, string new_name)
renames the given key; maintains the key order
*string lastKey()
Returns the last key name in the contained hash or NOTHING if the contained hash has no keys.
clear()
purges the contained data
bool matchKeys(hash h1)
returns True if the hash argument has the same keys (in any order), False if not
*hash h
the data to be contained
Definition: SqlUtil.qm.dox.h:4705
abstract string getElementName()
must return the name of the contained element
Qore::AbstractIterator keyIterator()
Returns a HashKeyIterator object for the contained hash.
int size()
Returns the number of keys in the contained hash.
constructor(*hash nh)
creates the object with the hash argument passed
bool matchKeys(list< auto > l)
returns True if the list<auto> argument has the same list of key strings as the keys in the object (i...
constructor(AbstractHashContainer old)
creates a copy of the object
bool empty()
returns True if the container is empty, False if not
bool matchKeys(AbstractHashContainer c)
returns True if the container argument has the same keys (in any order), False if not
bool val()
Returns False if the contained hash has no keys, True if it does.
copy(AbstractHashContainer old)
creates a "deep copy" of the object
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5517
bool equalExceptName(AbstractIndex ix)
returns True if the argument is equal to the current index with the exception of the name,...
bool hasColumn(string cname)
returns True if the constraint references the named column
*AbstractForeignConstraint foreign_constraint
Any foreign constraint that this index supports.
Definition: SqlUtil.qm.dox.h:5534
abstract bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
setForeignConstraint()
clears the supporting constraint
*AbstractColumnSupportingConstraint getSupportingConstraint()
returns the supporting constraint, if any
*list< AbstractColumnConstraint > getAllSupportingConstraints()
returns all supporting constraints, if any
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the index in the database
string name
the name of the index
Definition: SqlUtil.qm.dox.h:5521
*AbstractForeignConstraint getForeignConstraint()
returns the supporting constraint, if any
constructor(string n, bool u, hash c)
creates the object from the name, a unique flag, and a hash of column information
setSupportingConstraint(AbstractForeignConstraint c)
tags the index with a column supporting constraint (unique or fk constraint, etc) that the index supp...
setSupportingConstraint(AbstractColumnSupportingConstraint c)
tags the index with a column supporting constraint (unique or fk constraint, etc) that the index supp...
bool unique
True if the index is a unique index, False if not
Definition: SqlUtil.qm.dox.h:5524
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition: SqlUtil.qm.dox.h:5531
string getName()
returns the index name
setSupportingConstraint()
clears the supporting constraint
bool equal(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
string getDropSql(string table_name)
returns a string that can be used to drop the index from the database
abstract string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
list< auto > getRecreateSql(AbstractDatasource ds, string table_name, *hash< auto > opt)
returns a list of strings to drop and recreate the current index; if there are dependent constraints,...
Columns columns
an object of class Columns representing the columns in the index
Definition: SqlUtil.qm.dox.h:5527
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:4979
bool empty()
returns True if the container is empty, False if not
list< auto > getList()
returns the list contained by this object
abstract auto get(softint i)
returns the value of the given element in the contained list if it exists, otherwise throws an ELEMEN...
auto take(int i)
removes the given element from the contained list and returns the value
add(auto val)
adds the given value to the list
bool val()
Returns False if the contained list is empty, True if not.
abstract string getElementName()
must return the name of the contained element
constructor(softlist nl)
creates the object with the list<auto> argument passed
Qore::ListIterator iterator()
Returns a ListIterator object for the contained list.
int size()
Returns the number of elements in the contained list.
represents a primary key
Definition: SqlUtil.qm.dox.h:5845
base class for sequences
Definition: SqlUtil.qm.dox.h:5939
*number max
the ending number
Definition: SqlUtil.qm.dox.h:5952
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:5943
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the sequence from the database
abstract softlist< auto > getRenameSql(string new_name, *hash< auto > opt)
returns a list of strings that can be used to rename the sequence in the database
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the sequence in the database
number start
the starting number
Definition: SqlUtil.qm.dox.h:5946
number increment
the increment
Definition: SqlUtil.qm.dox.h:5949
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_max)
creates the object from the arguments
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:30
the base class for triggers
Definition: SqlUtil.qm.dox.h:6120
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
abstract list< auto > getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the trigger in the database
abstract softlist< auto > getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
abstract list< auto > getDropSql(string table_name)
returns a string that can be used to drop the trigger in the database
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:5836
constructor(string n, *hash< auto > c, *string n_index)
creates the object from the name an a hash of column information
base class for views
Definition: SqlUtil.qm.dox.h:5975
abstract softlist< auto > getRenameSql(string new_name, *hash< auto > opt)
returns a list with command(s) that can be used to rename the view in the database
bool updatable
Flag showing if is the view updatable with DML commands.
Definition: SqlUtil.qm.dox.h:5988
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:5982
constructor(string n_name, string n_src)
creates the object from the arguments
string src
the source code
Definition: SqlUtil.qm.dox.h:5985
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the view from the database
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the view in the database
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5256
bool equal(Columns cols)
returns True if the argument has the same columns in the same order as the current object,...
add(string k, AbstractColumn val)
adds the given value to the hash with the given key name
Columns subset(softlist l)
returns a subset of the current columns according to the list<auto> argument
string getElementName()
returns "column" since this object stores column objects
AbstractIterator getSqlColumnNameIterator()
returns an iterator for column SQL names
AbstractColumn memberGate(string k)
returns the AbstractColumn object corresponding to the key given or throws a KEY-ERROR exception
AbstractColumn take(string k)
removes the given key from the contained hash and returns the value
constructor(Columns old)
creates a copy of the object
constructor(*hash c)
creates the object from the argument
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5605
AbstractConstraint memberGate(string k)
returns the AbstractConstraint object corresponding to the key given or throws a KEY-ERROR exception
AbstractConstraint take(string k)
removes the given key from the contained hash and returns the value
*AbstractUniqueConstraint findEqualUniqueConstraint(AbstractUniqueConstraint uk)
finds a unique constraint with the same columns as the unique constraint passed
add(string k, AbstractConstraint val)
adds the given value to the hash with the given key name
string getElementName()
must return the name of the contained element
a class describing a foreign constraint target
Definition: SqlUtil.qm.dox.h:5903
constructor(string t, Columns c)
creates the object and sets the target table name and the target columns
bool equal(ForeignConstraintTarget targ)
returns True if the argument is equal to the current object, False if not
Columns columns
columns in the target table
Definition: SqlUtil.qm.dox.h:5910
string table
the name of the target table
Definition: SqlUtil.qm.dox.h:5907
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5856
AbstractForeignConstraint take(string k)
removes the given key from the contained hash and returns the value
*AbstractForeignConstraint findEqual(AbstractForeignConstraint fk)
find an index with columns equal to the index passed
*hash< auto > findConstraintOn(string table, softlist< auto > cols)
returns either a hash of AbstractColumn information or NOTHING if no foreign constraint can be found ...
add(string k, AbstractForeignConstraint val)
adds the given value to the hash with the given key name
string getElementName()
returns "foreign constraint" for the type of object encapsulated
AbstractForeignConstraint memberGate(string k)
returns the AbstractForeignConstraint object corresponding to the key given or throws a KEY-ERROR exc...
function container class that throws an exception if an unknown function is accessed
Definition: SqlUtil.qm.dox.h:6082
add(string k, AbstractFunction val)
adds the given value to the hash with the given key name
AbstractFunction take(string k)
removes the given key from the contained hash and returns the value
string getElementName()
must return the name of the contained element
AbstractFunction memberGate(string k)
returns the AbstractFunction object corresponding to the key given or throws a KEY-ERROR exception
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:5471
string getElementName()
must return the name of the contained element
AbstractIndex take(string k)
removes the given key from the contained hash and returns the value
*AbstractIndex tryTake(string k)
tries to remove the given key from the contained hash and returns the value if it exists
*AbstractIndex findEqual(AbstractIndex ix)
find an index with columns equal to the index passed
add(string k, AbstractIndex val)
adds the given value to the hash with the given key name
AbstractIndex memberGate(string k)
returns the AbstractIndex object corresponding to the key given or throws a KEY-ERROR exception
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:44
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5068
AbstractTable memberGate(string k)
returns the AbstractTable object corresponding to the key given or throws a KEY-ERROR exception
Qore::AbstractIterator dropIterator()
returns an iterator for a list of cached table names in the order that can be used to drop the tables...
constructor(AbstractDatasource ds, hash tables, *hash< auto > opt)
creates and populates the object from a hash<auto> description
populate(AbstractDatasource ds, hash< auto > tables, *hash< auto > opt)
populates the object from a hash<auto> description
bool tableRenamed(string old_name, string new_name, string old_sql_name)
updates table names and internal references for renamed tables
add(AbstractTable val)
adds the given value to the hash with the given key name
list< auto > getDropList()
returns a list of cached table names in the order that can be used to drop the tables,...
add(string k, Table val)
adds the given value to the hash with the given key name
AbstractTable take(string k)
removes the given key from the contained hash and returns the value
*AbstractTable getIfExists(AbstractDatasource ds, string name)
gets a table from the database or from the cache if already cached; if the table does not exist,...
populate(AbstractDatasource ds)
populates the object from tables in the database
constructor(AbstractDatasource ds)
creates and populates the object from tables in the database
add(string k, AbstractTable val)
adds the given value to the hash with the given key name
*string getDropConstraintIfExistsSql(string tname, string cname, *hash< auto > opts)
returns an SQL string that can be used to drop an existing constraint on a table, if the table is not...
*list< auto > getDropAllForeignConstraintsOnTableSql(string name, *hash< auto > opt)
returns a list of SQL strings that can be used to drop all the foreign constraints on a particular ta...
add(Table val)
adds the given value to the hash with the given key name
*string getRenameTableIfExistsSql(string old_name, string new_name, *hash< auto > opts)
returns an SQL string that can be used to rename the given table if it exists and the target does not...
string getElementName()
returns "table" since this object stores AbstractTable objects
constructor()
creates an empty object
AbstractTable get(AbstractDatasource ds, string name)
gets a table from the database or from the cache if already cached
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:6138
AbstractTrigger memberGate(string k)
returns the AbstractTrigger object corresponding to the key given or throws a KEY-ERROR exception
AbstractTrigger take(string k)
removes the given key from the contained hash and returns the value
add(string k, AbstractTrigger val)
adds the given value to the hash with the given key name
string getElementName()
must return the name of the contained element
const False
hash< auto > hash(object obj)
string type(auto arg)
number number(softnumber n)
Qore AbstractNumericDataType class definition.
Definition: AbstractNumericDataType.qc.dox.h:31
hash< string, hash< JoinOperatorInfo > > join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for right outer joins with the given arguments for use when joining with a table other...
const COP_MAX
to return the maximum value
Definition: SqlUtil.qm.dox.h:2409
const DT_YEAR
Format unit: year.
Definition: SqlUtil.qm.dox.h:3440
const COP_OVER
the SQL "over" clause
Definition: SqlUtil.qm.dox.h:2429
hash< OperatorInfo > op_ge(auto arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
const COP_SEQ_CURRVAL
to return the last value of a sequence issued in the same session
Definition: SqlUtil.qm.dox.h:2479
const COP_LENGTH
to get the length of a text field
Definition: SqlUtil.qm.dox.h:2496
const COP_RANK
Analytic (window) function: RANK.
Definition: SqlUtil.qm.dox.h:2554
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition: SqlUtil.qm.dox.h:2384
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4168
const COP_COALESCE
to return the first non-null argument in the list
Definition: SqlUtil.qm.dox.h:2484
hash< ColumnOperatorInfo > cop_year_hour(auto column)
returns a ColumnOperatorInfo hash for the "year_hour" operator with the given argument
const OP_NE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4173
sqlutil_register_ds_deserializer(*code new_ds_get)
registers a closure or call reference taking a string type and string datasource configuration that w...
const CLOB
specifies a large variable-length character column (ie CLOB or TEXT, etc)
Definition: SqlUtil.qm.dox.h:2337
hash< ColumnOperatorInfo > cop_seq_currval(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq_currval" operator with the given argument giving the s...
hash< ColumnOperatorInfo > cop_coalesce(auto col1, auto col2)
returns a ColumnOperatorInfo hash for the "coalesce" operator with the given column arguments; the fi...
hash< ColumnOperatorInfo > cop_percent_rank()
Analytic/window function: relative rank of the current row.
hash< UpdateOperatorInfo > uop_seq(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
hash< string, hash< JoinOperatorInfo > > join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for left outer joins with the given arguments for use when joining with a table other ...
hash< ColumnOperatorInfo > cop_dense_rank()
Analytic/window function: rank of the current row without gaps.
const OP_LE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4158
const SZ_NONE
the data type does not take a size parameter
Definition: SqlUtil.qm.dox.h:2345
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4178
const COP_MIN
to return the minimum value
Definition: SqlUtil.qm.dox.h:2404
const DB_SYNONYMS
Feature: synonyms.
Definition: SqlUtil.qm.dox.h:2317
const DB_PACKAGES
Feature: packages.
Definition: SqlUtil.qm.dox.h:2305
const DefaultUopMap
a hash of valid update operators
Definition: SqlUtil.qm.dox.h:3466
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition: SqlUtil.qm.dox.h:2469
hash< string, hash< JoinOperatorInfo > > join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for standard inner joins with the given arguments for use when joining with a table ot...
sqlutil_register_ds_serializer(*code new_ds_do)
registers a closure or call reference taking a string type and string datasource configuration that w...
hash< OperatorInfo > op_substr(int start, *int count, string text)
returns an OperatorInfo hash for the "substr" operator with the given arguments; for use in where cla...
const COP_DIVIDE
the SQL "divide" operator
Definition: SqlUtil.qm.dox.h:2444
const IOP_SEQ
for using the value of a sequence
Definition: SqlUtil.qm.dox.h:4617
hash< ColumnOperatorInfo > cop_prepend(auto column, string arg)
returns a ColumnOperatorInfo hash for the "prepend" operator with the given argument
hash< ColumnOperatorInfo > cop_ntile(int value)
Analytic/window function: integer ranging from 1 to the argument value, dividing the partition as equ...
const DT_MINUTE
Format unit: minute.
Definition: SqlUtil.qm.dox.h:3452
const VARCHAR
specifies a VARCHAR column (equivalent to Qore::Type::String)
Definition: SqlUtil.qm.dox.h:2325
hash< OperatorInfo > op_cle(string arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
hash< OperatorInfo > op_ne(auto arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
const OP_IN
the SQL "in" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4218
const JopMap
a hash of valid join operators
Definition: SqlUtil.qm.dox.h:3677
hash< ColumnOperatorInfo > cop_avg(auto column)
returns a ColumnOperatorInfo hash for the "avg" operator; returns average column values
hash< ColumnOperatorInfo > cop_over(auto column, *string partitionby, *string orderby)
returns a ColumnOperatorInfo hash for the "over" clause
const OP_NOT
the SQL "not" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4223
hash< OperatorInfo > op_eq(auto arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
hash< ColumnOperatorInfo > cop_sum(auto column)
returns a ColumnOperatorInfo hash for the "sum" operator; returns the total sum of a numeric column.
const COP_YEAR
to return a date value with year information only
Definition: SqlUtil.qm.dox.h:2454
hash< string, hash< JoinOperatorInfo > > join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for standard inner joins with the given arguments
const DefaultOpMap
a hash of valid operators for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4241
hash< UpdateOperatorInfo > uop_minus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "-" operator with the given arguments
hash< UpdateOperatorInfo > uop_plus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "+" operator with the given arguments
const SqlUtilDrivers
known drivers
Definition: SqlUtil.qm.dox.h:4672
hash< OperatorInfo > op_ceq(string arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
hash< ColumnOperatorInfo > cop_value(auto arg)
returns a ColumnOperatorInfo hash for the "value" (literal) operator with the given argument
hash< InsertOperatorInfo > iop_seq_currval(string arg)
returns an InsertOperatorInfo hash for retrieving the current value of the given sequence in insert q...
hash< string, hash< JoinOperatorInfo > > join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for left outer joins with the given arguments
const DB_MVIEWS
Feature: materialized views / snapshots.
Definition: SqlUtil.qm.dox.h:2303
const COP_COUNT
to return the row count
Definition: SqlUtil.qm.dox.h:2424
hash< UpdateOperatorInfo > uop_seq_currval(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
const COP_MULTIPLY
the SQL "multiply" operator
Definition: SqlUtil.qm.dox.h:2449
hash< ColumnOperatorInfo > cop_rank()
Analytic/window function: rank of the current row with gaps.
const OP_SUBSTR
the SQL "substr" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4228
const COP_AVG
to return the average value
Definition: SqlUtil.qm.dox.h:2414
hash< ColumnOperatorInfo > cop_year_month(auto column)
returns a ColumnOperatorInfo hash for the "year_month" operator with the given argument
hash< ColumnOperatorInfo > cop_upper(auto column)
returns a ColumnOperatorInfo hash for the "upper" operator with the given argument; returns a column ...
const DT_SECOND
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3455
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4198
const COP_PLUS
the SQL "plus" operator
Definition: SqlUtil.qm.dox.h:2439
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition: SqlUtil.qm.dox.h:2512
hash< OperatorInfo > op_in()
returns an OperatorInfo hash for the "in" operator with all arguments passed to the function; for use...
hash< ColumnOperatorInfo > cop_trunc_date(auto column, string mask)
Truncates a date column or value regarding the given mask. The resulting value remains Qore::date (no...
const DefaultIopMap
a hash of default insert operator descriptions (currently empty, all operators are driver-dependent)
Definition: SqlUtil.qm.dox.h:4625
hash< OperatorInfo > op_like(string str)
returns an OperatorInfo hash for the "like" operator with the given argument for use in where clauses
hash< ColumnOperatorInfo > cop_plus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "+" operator with the given arguments
const DT_MONTH
Format unit: month.
Definition: SqlUtil.qm.dox.h:3443
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition: SqlUtil.qm.dox.h:2354
const COP_SUBSTR
to extract a substring from a column
Definition: SqlUtil.qm.dox.h:2489
const COP_SEQ
to return the next value of a sequence
Definition: SqlUtil.qm.dox.h:2474
const SZ_MAND
the data type takes a mandatory size parameter
Definition: SqlUtil.qm.dox.h:2348
hash< ColumnOperatorInfo > cop_append(auto column, string arg)
returns a ColumnOperatorInfo hash for the "append" operator with the given argument
hash< UpdateOperatorInfo > uop_divide(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "/" operator with the given arguments
const COP_APPEND
to append a string to a column on output
Definition: SqlUtil.qm.dox.h:2379
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition: SqlUtil.qm.dox.h:2334
hash< OperatorInfo > op_in_select(string table, hash< auto > select_hash)
returns an OperatorInfo hash for the "in" operator with a subquery as the argument; for use in where ...
hash< string, hash< JoinOperatorInfo > > join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for right outer joins with the given arguments
hash< ColumnOperatorInfo > cop_as(auto column, string arg)
returns a ColumnOperatorInfo hash for the "as" operator with the given argument
const DB_PROCEDURES
Feature: procedures.
Definition: SqlUtil.qm.dox.h:2307
hash< OperatorInfo > make_op(string op, auto arg)
returns an OperatorInfo hash
const COP_PERCENT_RANK
Analytic (window) function: PERCENT_RANK.
Definition: SqlUtil.qm.dox.h:2547
const COP_NTILE
Analytic (window) function: NTILE.
Definition: SqlUtil.qm.dox.h:2540
hash< ColumnOperatorInfo > cop_last_value(any column)
Analytic/window function: value evaluated at the row that is the last row of the window frame.
const OP_LT
the SQL less than (<) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4153
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4188
const COP_YEAR_MONTH
to return a date value with year to month information
Definition: SqlUtil.qm.dox.h:2459
hash< string, hash< JoinOperatorInfo > > make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash< auto > opt)
returns hash keyed with the table name assigned to a JoinOperatorInfo hash
hash< ColumnOperatorInfo > cop_lower(auto column)
returns a ColumnOperatorInfo hash for the "lower" operator with the given argument; returns a column ...
const OP_BETWEEN
the SQL "between" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4213
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
const DB_TABLES
Feature: tables.
Definition: SqlUtil.qm.dox.h:2311
hash< UpdateOperatorInfo > uop_upper(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "upper" operator with the given argument; returns a column...
hash< ColumnOperatorInfo > cop_year(auto column)
returns a ColumnOperatorInfo hash for the "year" operator with the given argument
hash< UpdateOperatorInfo > uop_prepend(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "prepend" operator with the given argument
const COP_PREPEND
to prepend a string to a column on output
Definition: SqlUtil.qm.dox.h:2374
hash< InsertOperatorInfo > make_iop(string iop, auto arg)
returns an InsertOperatorInfo hash
hash< ColumnOperatorInfo > cop_divide(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "/" operator with the given arguments
hash< OperatorInfo > op_cne(string arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
const COP_LOWER
to return column value in lower case
Definition: SqlUtil.qm.dox.h:2394
hash< UpdateOperatorInfo > make_uop(string uop, auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash
hash< string, hash< OperatorInfo > > wop_or(hash h1, hash h2)
returns an OperatorInfo hash with a fake "_OR_" column name; the list of arguments to the function is...
hash< ColumnOperatorInfo > cop_distinct(auto column)
returns a ColumnOperatorInfo hash for the "distinct" operator with the given argument; returns distin...
hash< ColumnOperatorInfo > make_cop(string cop, auto column, auto arg)
returns a ColumnOperatorInfo hash
hash< ColumnOperatorInfo > cop_multiply(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "*" operator with the given arguments
hash< OperatorInfo > op_between(auto l, auto r)
returns an OperatorInfo hash for the "between" operator with the given arguments, neither of which ca...
const DB_VIEWS
Feature: views.
Definition: SqlUtil.qm.dox.h:2315
hash< ColumnOperatorInfo > cop_length(auto column)
returns a ColumnOperatorInfo hash for the "len" operator with the given argument; returns the length ...
hash< OperatorInfo > op_cge(string arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
const COP_AS
to rename a column on output
Definition: SqlUtil.qm.dox.h:2364
hash< UpdateOperatorInfo > uop_lower(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "lower" operator with the given argument; returns a column...
const COP_CAST
to convert column value into another datatype
Definition: SqlUtil.qm.dox.h:2369
const JOP_INNER
for standard inner joins
Definition: SqlUtil.qm.dox.h:3664
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4163
const DT_HOUR
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3449
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition: SqlUtil.qm.dox.h:2561
hash< ColumnOperatorInfo > cop_count(auto column='')
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts
hash< OperatorInfo > op_clt(string arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
hash< ColumnOperatorInfo > cop_max(auto column)
returns a ColumnOperatorInfo hash for the "max" operator; returns maximum column values
const SZ_OPT
the data type takes an optional size parameter
Definition: SqlUtil.qm.dox.h:2351
const CHAR
specifies a CHAR column
Definition: SqlUtil.qm.dox.h:2331
const COP_YEAR_DAY
to return a date value with year to day information
Definition: SqlUtil.qm.dox.h:2464
hash< ColumnOperatorInfo > cop_substr(auto column, int start, *int count)
returns a ColumnOperatorInfo hash for the "substr" operator with the given arguments; returns a subst...
hash< UpdateOperatorInfo > uop_multiply(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "*" operator with the given arguments
hash< OperatorInfo > op_lt(auto arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
const OP_CNE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4203
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition: SqlUtil.qm.dox.h:2328
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition: SqlUtil.qm.dox.h:4183
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4233
const COP_UPPER
to return column value in upper case
Definition: SqlUtil.qm.dox.h:2389
const JOP_RIGHT
for right outer joins
Definition: SqlUtil.qm.dox.h:3674
hash< OperatorInfo > op_cgt(string arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
const COP_DENSE_RANK
Analytic (window) function: DENSE_RANK.
Definition: SqlUtil.qm.dox.h:2519
hash< UpdateOperatorInfo > uop_substr(int start, *int count, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "substr" operator with the given arguments; returns a subs...
const IOP_SEQ_CURRVAL
for using the last value of a sequence issued in the current session
Definition: SqlUtil.qm.dox.h:4622
const COP_TRUNC_DATE
to return the date with truncated value
Definition: SqlUtil.qm.dox.h:2505
const COP_MINUS
the SQL "minus" operator
Definition: SqlUtil.qm.dox.h:2434
hash< OperatorInfo > op_gt(auto arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
const COP_LAST_VALUE
Analytic (window) function: LAST_VALUE.
Definition: SqlUtil.qm.dox.h:2533
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition: SqlUtil.qm.dox.h:2526
hash< OperatorInfo > op_not(hash arg)
returns an OperatorInfo hash for the "not" operator; for use in where clauses
hash< ColumnOperatorInfo > cop_year_day(auto column)
returns a ColumnOperatorInfo hash for the "year_day" operator with the given argument
const DefaultCopMap
a hash of default column operator descriptions
Definition: SqlUtil.qm.dox.h:2564
const DB_FUNCTIONS
Features constants.
Definition: SqlUtil.qm.dox.h:2301
hash< OperatorInfo > op_le(auto arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
const COP_DISTINCT
to return distinct values
Definition: SqlUtil.qm.dox.h:2399
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4238
hash< UpdateOperatorInfo > uop_append(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "append" or concatenate operator with the given argument
const OP_CGT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4193
hash< ColumnOperatorInfo > cop_row_number()
Analytic/window function: number of the current row within its partition, counting from 1.
const DT_DAY
Format unit: day.
Definition: SqlUtil.qm.dox.h:3446
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence ...
const DB_SEQUENCES
Feature: sequences.
Definition: SqlUtil.qm.dox.h:2309
const DB_TYPES
Feature: named types.
Definition: SqlUtil.qm.dox.h:2313
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4208
const COP_SUM
to return the sum value
Definition: SqlUtil.qm.dox.h:2419
const OP_LIKE
the SQL "like" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4148
hash< ColumnOperatorInfo > cop_min(auto column)
returns a ColumnOperatorInfo hash for the "min" operator; returns minimum column values
hash< ColumnOperatorInfo > cop_cast(auto column, string arg, auto arg1, auto arg2)
returns a ColumnOperatorInfo hash for the "cast" operator with the given argument(s)
hash< ColumnOperatorInfo > cop_minus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "-" operator with the given arguments
hash< ColumnOperatorInfo > cop_first_value(any column)
Analytic/window function: value evaluated at the row that is the first row of the window frame.
const JOP_LEFT
for left outer joins
Definition: SqlUtil.qm.dox.h:3669
hash< InsertOperatorInfo > iop_seq(string arg)
returns an InsertOperatorInfo hash for retrieving the value of the given sequence in insert queries
column operator info hash as returned by all column operator functions
Definition: SqlUtil.qm.dox.h:2230
string cop
the column operator string code
Definition: SqlUtil.qm.dox.h:2231
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2233
auto column
column sopecifier, may be a string or a complex hash
Definition: SqlUtil.qm.dox.h:2232
generic column description hash in schema descriptions
Definition: SqlUtil.qm.dox.h:2200
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:2216
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:2218
auto default_value
the default value for the column
Definition: SqlUtil.qm.dox.h:2210
softint scale
for numeric data types, this value gives the scale
Definition: SqlUtil.qm.dox.h:2208
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition: SqlUtil.qm.dox.h:2206
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:2212
*string comment
an optional comment for the column
Definition: SqlUtil.qm.dox.h:2214
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:2202
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:2204
*bool auto_increment
True for DBs that support an auto-increment column
Definition: SqlUtil.qm.dox.h:2220
insert operator info hash as returned by all insert operator functions
Definition: SqlUtil.qm.dox.h:2237
string _iop
the insert operator string code
Definition: SqlUtil.qm.dox.h:2238
any arg
optional argument
Definition: SqlUtil.qm.dox.h:2239
join operator info hash as returned by all join operator functions
Definition: SqlUtil.qm.dox.h:2250
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition: SqlUtil.qm.dox.h:2255
*string alias
optional alias for table in the query
Definition: SqlUtil.qm.dox.h:2253
*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:2256
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition: SqlUtil.qm.dox.h:2252
*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:2254
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition: SqlUtil.qm.dox.h:2257
string jop
the join operator string code
Definition: SqlUtil.qm.dox.h:2251
SQL operator info hash as returned by all operator functions.
Definition: SqlUtil.qm.dox.h:2224
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2226
string op
the operator string code
Definition: SqlUtil.qm.dox.h:2225
A hash describing SQL and arguments for an SQL DML command.
Definition: SqlUtil.qm.dox.h:2286
string sql
the SQL string for the update
Definition: SqlUtil.qm.dox.h:2288
list< auto > args
the arguments for the string
Definition: SqlUtil.qm.dox.h:2291
column data type options
Definition: SqlUtil.qm.dox.h:2261
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition: SqlUtil.qm.dox.h:2272
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition: SqlUtil.qm.dox.h:2266
*softint maxlen
optional additional limit to the maximum length of the data
Definition: SqlUtil.qm.dox.h:2280
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition: SqlUtil.qm.dox.h:2269
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition: SqlUtil.qm.dox.h:2275
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition: SqlUtil.qm.dox.h:2263
update operator info hash as returned by all update operator functions
Definition: SqlUtil.qm.dox.h:2243
*hash nest
option nested operation hash
Definition: SqlUtil.qm.dox.h:2246
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2245
string uop
the update operator string code
Definition: SqlUtil.qm.dox.h:2244