Qore SqlUtil Module Reference  1.7.1
SqlUtil.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SqlUtil.qm Copyright (C) 2013 - 2021 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 
2130 namespace SqlUtil {
2132  public struct GenericColumnInfo {
2134  string qore_type;
2136  string native_type;
2138  softint size;
2140  softint scale;
2146  *string comment;
2148  bool notnull = False;
2150  hash<string, hash> driver;
2153  };
2154 
2156  public struct OperatorInfo {
2157  string op;
2158  auto arg;
2159  };
2160 
2162  public struct ColumnOperatorInfo {
2163  string cop;
2164  auto column;
2165  auto arg;
2166  };
2167 
2169  public struct InsertOperatorInfo {
2170  string _iop;
2171  any arg;
2172  };
2173 
2175  public struct UpdateOperatorInfo {
2176  string uop;
2177  auto arg;
2179  };
2180 
2182  public struct JoinOperatorInfo {
2183  string jop;
2184  auto table;
2185  *string alias;
2188  *string ta;
2189  *hash<auto> opt;
2190  };
2191 
2195  *string date_format;
2196 
2198  *TimeZone data_timezone;
2199 
2201  *TimeZone db_timezone;
2202 
2204  *string number_format;
2205 
2207  *softbool mandatory;
2208 
2210 
2212  *softint maxlen;
2213  };
2214 
2216 
2218  public struct SqlCommandInfo {
2220  string sql;
2221 
2223  list<auto> args;
2224  };
2225 
2231 
2233  const DB_FUNCTIONS = "functions";
2235  const DB_MVIEWS = "materialized views";
2237  const DB_PACKAGES = "packages";
2239  const DB_PROCEDURES = "procedures";
2241  const DB_SEQUENCES = "sequences";
2243  const DB_TABLES = "tables";
2245  const DB_TYPES = "named types";
2247  const DB_VIEWS = "views";
2249  const DB_SYNONYMS = "synonyms";
2251 
2252  /* @defgroup SqlTypeConstants SQL Type Constants
2253  These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
2254  */
2256  const VARCHAR = "string";
2258 
2260  const NUMERIC = "number";
2261 
2263  const CHAR = "char";
2264 
2266  const BLOB = "blob";
2267 
2269  const CLOB = "clob";
2271 
2277  const SZ_NONE = 0;
2278 
2280  const SZ_MAND = 1;
2281 
2283  const SZ_OPT = 2;
2284 
2286  const SZ_NUM = 3;
2288 
2294 
2296  const COP_AS = "as";
2297 
2299 
2301  const COP_CAST = "cast";
2302 
2304 
2306  const COP_PREPEND = "prepend";
2307 
2309 
2311  const COP_APPEND = "append";
2312 
2314 
2316  const COP_VALUE = "value";
2317 
2319 
2321  const COP_UPPER = "upper";
2322 
2324 
2326  const COP_LOWER = "lower";
2327 
2329 
2331  const COP_DISTINCT = "distinct";
2332 
2334 
2336  const COP_MIN = "min";
2337 
2339 
2341  const COP_MAX = "max";
2342 
2344 
2346  const COP_AVG = "avg";
2347 
2349 
2351  const COP_SUM = "sum";
2352 
2354 
2356  const COP_COUNT = "count";
2357 
2359 
2361  const COP_OVER = "over";
2362 
2364 
2366  const COP_MINUS = "minus";
2367 
2369 
2371  const COP_PLUS = "plus";
2372 
2374 
2376  const COP_DIVIDE = "divide";
2377 
2379 
2381  const COP_MULTIPLY = "multiply";
2382 
2384 
2386  const COP_YEAR = "year";
2387 
2389 
2391  const COP_YEAR_MONTH = "year_month";
2392 
2394 
2396  const COP_YEAR_DAY = "year_day";
2397 
2399 
2401  const COP_YEAR_HOUR = "year_hour";
2402 
2404 
2406  const COP_SEQ = "seq";
2407 
2409 
2411  const COP_SEQ_CURRVAL = "seq_currval";
2412 
2414 
2416  const COP_COALESCE = "coalesce";
2417 
2419 
2421  const COP_SUBSTR = "substr";
2422 
2424 
2428  const COP_LENGTH = "length";
2429 
2431 
2437  const COP_TRUNC_DATE = "truncate_date";
2438 
2440 
2444  const COP_CUME_DIST = "cume_dist";
2445 
2447 
2451  const COP_DENSE_RANK = "dense_rank";
2452 
2454 
2458  const COP_FIRST_VALUE = "first_value";
2459 
2461 
2465  const COP_LAST_VALUE = "last_value";
2466 
2468 
2472  const COP_NTILE = "ntile";
2473 
2475 
2479  const COP_PERCENT_RANK = "percent_rank";
2480 
2482 
2486  const COP_RANK = "rank";
2487 
2489 
2493  const COP_ROW_NUMBER = "row_number";
2494 
2496  const DefaultCopMap = ...;
2497 
2499 
2542 
2550  hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
2551 
2552 
2554 
2566  hash<ColumnOperatorInfo> cop_as(auto column, string arg);
2567 
2568 
2570 
2584  hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
2585 
2586 
2588 
2598  hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
2599 
2600 
2602 
2612  hash<ColumnOperatorInfo> cop_append(auto column, string arg);
2613 
2614 
2616 
2744  hash<ColumnOperatorInfo> cop_value(auto arg);
2745 
2746 
2748 
2757  hash<ColumnOperatorInfo> cop_upper(auto column);
2758 
2759 
2761 
2770  hash<ColumnOperatorInfo> cop_lower(auto column);
2771 
2772 
2774 
2783  hash<ColumnOperatorInfo> cop_distinct(auto column);
2784 
2785 
2787 
2796  hash<ColumnOperatorInfo> cop_min(auto column);
2797 
2798 
2800 
2809  hash<ColumnOperatorInfo> cop_max(auto column);
2810 
2811 
2813 
2822  hash<ColumnOperatorInfo> cop_avg(auto column);
2823 
2824 
2826 
2835  hash<ColumnOperatorInfo> cop_sum(auto column);
2836 
2837 
2839 
2846  hash<ColumnOperatorInfo> cop_count(auto column = '');
2847 
2848 
2850 
2857  hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
2858 
2859 
2861 
2871  hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
2872 
2873 
2875 
2885  hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
2886 
2887 
2889 
2899  hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
2900 
2901 
2903 
2913  hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
2914 
2915 
2917 
2926  hash<ColumnOperatorInfo> cop_year(auto column);
2927 
2928 
2930 
2939  hash<ColumnOperatorInfo> cop_year_month(auto column);
2940 
2941 
2943 
2952  hash<ColumnOperatorInfo> cop_year_day(auto column);
2953 
2954 
2956 
2965  hash<ColumnOperatorInfo> cop_year_hour(auto column);
2966 
2967 
2969 
2979  hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
2980 
2981 
2983 
2993  hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
2994 
2995 
2997 
3009  hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
3010 
3011 
3013 
3024  hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
3025 
3026 
3028 
3039  hash<ColumnOperatorInfo> cop_length(auto column);
3040 
3041 
3043 
3057  hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
3058 
3059 
3060 
3062 
3090  hash<ColumnOperatorInfo> cop_cume_dist();
3091 
3092 
3094 
3122  hash<ColumnOperatorInfo> cop_dense_rank();
3123 
3124 
3126 
3154  hash<ColumnOperatorInfo> cop_first_value(any column);
3155 
3156 
3158 
3186  hash<ColumnOperatorInfo> cop_last_value(any column);
3187 
3188 
3190 
3220  hash<ColumnOperatorInfo> cop_ntile(int value);
3221 
3222 
3224 
3252  hash<ColumnOperatorInfo> cop_percent_rank();
3253 
3254 
3256 
3284  hash<ColumnOperatorInfo> cop_rank();
3285 
3286 
3288 
3316  hash<ColumnOperatorInfo> cop_row_number();
3317 
3318 
3320 
3372  const DT_YEAR = "Y";
3373 
3375  const DT_MONTH = "M";
3376 
3378  const DT_DAY = "D";
3379 
3381  const DT_HOUR = "H";
3382 
3384  const DT_MINUTE = "m";
3385 
3387  const DT_SECOND = "S";
3388 
3389  // let's simulate and enum here'
3390  const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
3392 
3398  const DefaultUopMap = ...;
3399 
3401 
3424 
3432  hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
3433 
3434 
3436 
3446  hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
3447 
3448 
3450 
3460  hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
3461 
3462 
3464 
3473  hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
3474 
3475 
3477 
3486  hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
3487 
3488 
3490 
3501  hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
3502 
3503 
3505 
3515  hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
3516 
3517 
3519 
3529  hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
3530 
3531 
3533 
3543  hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
3544 
3545 
3547 
3557  hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
3558 
3559 
3561 
3570  hash<UpdateOperatorInfo> uop_seq(string seq);
3571 
3572 
3574 
3583  hash<UpdateOperatorInfo> uop_seq_currval(string seq);
3584 
3586 
3594 
3596  const JOP_INNER = "inner";
3597 
3599 
3601  const JOP_LEFT = "left";
3602 
3604 
3606  const JOP_RIGHT = "right";
3607 
3609  const JopMap = ...;
3610 
3612 
3623 
3626  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3627 
3628 
3630 
3634  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3635 
3636 
3638 
3657  hash<string, hash<JoinOperatorInfo>> join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3658 
3659 
3661 
3680  hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3681 
3682 
3684 
3703  hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3704 
3705 
3707 
3729  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3730 
3731 
3733 
3753  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3754 
3755 
3757 
3779  hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3780 
3781 
3783 
3802  hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3803 
3804 
3806 
3825  hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3826 
3827 
3829 
3850  hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3851 
3852 
3854 
3874  hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3875 
3876 
3878 
3898  hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3899 
3900 
3902 
3924  hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3925 
3926 
3928 
3947  hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3948 
3949 
3951 
3970  hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3971 
3972 
3974 
3995  hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3996 
3997 
3999 
4019  hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4020 
4021 
4023 
4043  hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4044 
4045 
4047 
4069  hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4070 
4072 
4078 
4080  const OP_LIKE = "like";
4081 
4083 
4085  const OP_LT = "<";
4086 
4088 
4090  const OP_LE = "<=";
4091 
4093 
4095  const OP_GT = ">";
4096 
4098 
4100  const OP_GE = ">=";
4101 
4103 
4105  const OP_NE = "!=";
4106 
4108 
4110  const OP_EQ = "=";
4111 
4113 
4115  const OP_CLT = "C<";
4116 
4118 
4120  const OP_CLE = "C<=";
4121 
4123 
4125  const OP_CGT = "C>";
4126 
4128 
4130  const OP_CGE = "C>=";
4131 
4133 
4135  const OP_CNE = "C!=";
4136 
4138 
4140  const OP_CEQ = "C=";
4141 
4143 
4145  const OP_BETWEEN = "between";
4146 
4148 
4150  const OP_IN = "in";
4151 
4153 
4155  const OP_NOT = "not";
4156 
4158 
4160  const OP_SUBSTR = "substr";
4161 
4163 
4165  const OP_OR = "or";
4166 
4168 
4170  const OP_IN_SELECT = "in_select";
4171 
4173  const DefaultOpMap = ...;
4174 
4176 
4201  hash<OperatorInfo> make_op(string op, auto arg);
4202 
4203 
4205 
4214  hash<OperatorInfo> op_like(string str);
4215 
4216 
4218 
4229  hash<OperatorInfo> op_lt(auto arg);
4230 
4231 
4233 
4244  hash<OperatorInfo> op_le(auto arg);
4245 
4246 
4248 
4259  hash<OperatorInfo> op_gt(auto arg);
4260 
4261 
4263 
4274  hash<OperatorInfo> op_ge(auto arg);
4275 
4276 
4278 
4291  hash<OperatorInfo> op_ne(auto arg);
4292 
4293 
4295 
4308  hash<OperatorInfo> op_eq(auto arg);
4309 
4310 
4312 
4324  hash<OperatorInfo> op_between(auto l, auto r);
4325 
4326 
4328 
4337  hash<OperatorInfo> op_in();
4338 
4339 
4341 
4348  hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
4349 
4350 
4352 
4359  hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
4360 
4361 
4363 
4370  hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
4371 
4372 
4374 
4385  hash<OperatorInfo> op_in(list<auto> args);
4386 
4387 
4389 
4396  hash<OperatorInfo> op_not(hash arg);
4397 
4398 
4400 
4411  hash<OperatorInfo> op_clt(string arg);
4412 
4413 
4415 
4426  hash<OperatorInfo> op_cle(string arg);
4427 
4428 
4430 
4441  hash<OperatorInfo> op_cgt(string arg);
4442 
4443 
4445 
4456  hash<OperatorInfo> op_cge(string arg);
4457 
4458 
4460 
4471  hash<OperatorInfo> op_cne(string arg);
4472 
4473 
4475 
4486  hash<OperatorInfo> op_ceq(string arg);
4487 
4488 
4490 
4501  hash<OperatorInfo> op_substr(int start, *int count, string text);
4502 
4503 
4505 
4515  hash<OperatorInfo> op_substr(int start, string text);
4516 
4517 
4519 
4536  hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
4537 
4539 
4547 
4549  const IOP_SEQ = "seq";
4550 
4552 
4554  const IOP_SEQ_CURRVAL = "seq_currval";
4555 
4557  const DefaultIopMap = {};
4559 
4566 
4573  hash<InsertOperatorInfo> make_iop(string iop, auto arg);
4574 
4575 
4577 
4586  hash<InsertOperatorInfo> iop_seq(string arg);
4587 
4588 
4590 
4599  hash<InsertOperatorInfo> iop_seq_currval(string arg);
4600 
4602 
4604  const SqlUtilDrivers = ...;
4605 
4606 
4607  // private variable to store the closure used to deserialize datasources (if any)
4608  extern code ds_get;
4609 
4610  // private variable to store the closure used to serialize datasources (if any)
4611  extern code ds_do;
4612 
4615 
4616 
4619 
4620 
4621  // private function used to deserialize datasources
4622  AbstractDatasource sqlutil_get_ds(string type, string config);
4623 
4624 
4625  // private function used to serialize datasources
4626  hash<auto> sqlutil_ds(AbstractDatasource ds);
4627 
4628 
4630 class AbstractHashContainer : public Serializable {
4631 
4632 public:
4633 
4634 
4635 protected:
4638 
4639 public:
4640 
4643 
4644 
4647 
4648 
4651 
4652 
4654 
4669  auto memberGate(string k);
4670 
4671 
4673 
4680 
4681 
4683  abstract auto take(string k);
4684 
4686  renameKey(string old_name, string new_name);
4687 
4688 
4690  *hash<auto> getHash();
4691 
4692 
4694 
4703  bool matchKeys(hash h1);
4704 
4705 
4707 
4716  bool matchKeys(list<auto> l);
4717 
4718 
4720 
4730 
4731 
4733 
4743 
4744 
4746 
4755  bool partialMatchKeys(list<auto> l);
4756 
4757 
4759 
4769 
4770 
4772 
4781  bool val();
4782 
4783 
4785 
4792  list<string> keys();
4793 
4794 
4796 
4803  list<auto> values();
4804 
4805 
4807 
4815 
4816 
4818 
4826 
4827 
4829 
4837 
4838 
4840  bool empty();
4841 
4842 
4844 
4851  int size();
4852 
4853 
4855 
4864  bool hasKey(string k);
4865 
4866 
4868 
4877  bool hasKeyValue(string k);
4878 
4879 
4881 
4890  *string firstKey();
4891 
4892 
4894 
4903  *string lastKey();
4904 
4905 
4907  abstract string getElementName();
4908  };
4909 
4911 class AbstractListContainer : public Serializable {
4912 
4913 public:
4914 
4915 
4916 protected:
4917  softlist l;
4918 
4919 public:
4920 
4922  constructor(softlist nl);
4923 
4924 
4926 
4937  abstract auto get(softint i);
4938 
4940  add(auto val);
4941 
4942 
4944  auto take(int i);
4945 
4946 
4948  list<auto> getList();
4949 
4950 
4952 
4961  bool val();
4962 
4963 
4965 
4973 
4974 
4976  bool empty();
4977 
4978 
4980 
4987  int size();
4988 
4989 
4991  abstract string getElementName();
4992 
4993 protected:
4994  checkIndex(int i);
4995 public:
4996 
4997  };
4998 
5001 
5002 public:
5005 
5006 
5008  constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
5009 
5010 
5012  constructor(AbstractDatasource ds);
5013 
5014 
5016  add(string k, Table val);
5017 
5018 
5020  add(string k, AbstractTable val);
5021 
5022 
5025 
5026 
5029 
5030 
5032  AbstractTable take(string k);
5033 
5034 
5036  populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
5037 
5038 
5040  populate(AbstractDatasource ds);
5041 
5042 
5044 
5058  *list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
5059 
5060 
5062 
5078 
5079 
5081  string getElementName();
5082 
5083 
5085  *AbstractTable getIfExists(AbstractDatasource ds, string name);
5086 
5087 
5089  AbstractTable get(AbstractDatasource ds, string name);
5090 
5091 
5093 
5108  *string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
5109 
5110 
5112 
5123  bool tableRenamed(string old_name, string new_name, string old_sql_name);
5124 
5125 
5126 protected:
5127  tableRenamedIntern(string old_name, string new_name, string oldsn);
5128 public:
5129 
5130 
5132 
5147  *string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
5148 
5149 
5150  list<auto> getCreateList();
5151 
5152 
5153  Qore::AbstractIterator createIterator();
5154 
5155 
5157 
5165  list<auto> getDropList();
5166 
5167 
5169 
5177 
5178 
5179 protected:
5180  getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
5181 public:
5182 
5183  };
5184 
5187 
5188 public:
5191 
5192 
5195 
5196 
5198  add(string k, AbstractColumn val);
5199 
5200 
5203 
5204 
5206 
5222 
5223 
5225  Columns subset(softlist l);
5226 
5227 
5229  string getElementName();
5230 
5231 
5233  bool equal(Columns cols);
5234 
5235 
5237  AbstractIterator getSqlColumnNameIterator();
5238 
5239  };
5240 
5242 class AbstractDdlObject : public Serializable {
5243 
5244 public:
5246  string name;
5247 
5249  string ddl_name;
5250 
5252 protected:
5254 public:
5255 
5256 
5259 
5260 
5262 
5264  abstract string getDdlName(string name);
5265  };
5266 
5269 
5270 public:
5272  string native_type;
5273 
5275  *string qore_type;
5276 
5278  int size;
5279 
5281  bool nullable;
5282 
5284  *string def_val;
5285 
5287  *string comment;
5288 
5290 protected:
5292 public:
5293 
5294 
5295  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c)
5296  ;
5297 
5298 
5301 
5302 
5305 
5306 
5308 
5317  abstract list<auto> getAddColumnSql(AbstractTable t);
5318 
5320  string getDropSql(string table_name);
5321 
5322 
5324 
5337  list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5338 
5339 
5341 
5351  abstract string getRenameSql(AbstractTable t, string new_name);
5352 
5355 
5356 
5358 protected:
5359  abstract bool equalImpl(AbstractColumn c);
5360 public:
5361 
5363 
5376 protected:
5377  abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5378 public:
5379  };
5380 
5382 class NumericColumnInfo : public Serializable {
5383 
5384 public:
5386  int scale;
5387 
5388  constructor(softint n_scale = 0);
5389 
5390 
5392  string getNativeTypeString(string native_type, int precision);
5393 
5394  };
5395 
5398 
5399 public:
5400  constructor(*hash c) ;
5401 
5402 
5404  add(string k, AbstractIndex val);
5405 
5406 
5409 
5410 
5412  AbstractIndex take(string k);
5413 
5414 
5417 
5418 
5420 
5436 
5437 
5438  string getElementName();
5439 
5440  };
5441 
5443 class AbstractIndex : public Serializable {
5444 
5445 public:
5447  string name;
5448 
5450  bool unique;
5451 
5454 
5455 protected:
5458 
5459 public:
5460 
5462  constructor(string n, bool u, hash c);
5463 
5464 
5466  string getName();
5467 
5468 
5470  bool hasColumn(string cname);
5471 
5472 
5474  abstract string getCreateSql(string table_name, *hash<auto> opt);
5475 
5477  string getDropSql(string table_name);
5478 
5479 
5482 
5483 
5486 
5487 
5489  abstract bool equalImpl(AbstractIndex ix);
5490 
5492  abstract string getRenameSql(string table_name, string new_name);
5493 
5496 
5497 
5500 
5501 
5504 
5505 
5507  list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
5508 
5509  };
5510 
5513 
5514 public:
5515  constructor(*hash c) ;
5516 
5517 
5520 
5521 
5524 
5525 
5528 
5529 
5531 
5547 
5548 
5549  string getElementName();
5550 
5551  };
5552 
5554 class AbstractConstraint : public Serializable {
5555 
5556 public:
5557 
5558 
5559 protected:
5561  string name;
5562 
5563 public:
5564 
5566  constructor(string n);
5567 
5568 
5570  string getName();
5571 
5572 
5574  rename(string n);
5575 
5576 
5578  abstract string getCreateSql(string table_name, *hash<auto> opt);
5579 
5581  string getDropSql(string table_name);
5582 
5583 
5585  abstract list<auto> getRenameSql(string table_name, string new_name);
5586 
5588  string getDisableSql(string table_name);
5589 
5590 
5592  string getEnableSql(string table_name, *hash<auto> opt);
5593 
5594 
5597 
5598 
5600 protected:
5601  abstract bool equalImpl(AbstractConstraint c);
5602 public:
5603 
5605  abstract bool setIndexBase(string ix);
5606 
5608  abstract clearIndex();
5609 
5611  bool hasColumn(string cname);
5612 
5613  };
5614 
5617 
5618 public:
5620  string src;
5621 
5623  constructor(string n, string n_src) ;
5624 
5625 
5627 protected:
5629 public:
5630 
5631 
5633  bool setIndexBase(string ix);
5634 
5635 
5638 
5639  };
5640 
5643 
5644 public:
5645 protected:
5648 
5650  *string index;
5651 
5652 public:
5653 
5655  constructor(string n, *hash c, *string n_index) ;
5656 
5657 
5659  constructor(string n, Columns c, *string n_index) ;
5660 
5661 
5663 
5668 
5669 
5671  hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
5672 
5673 
5676 
5677 
5679 
5690 
5691 
5693  removeSourceConstraint(string tname, list cols);
5694 
5695 
5697  renameSourceConstraintTable(string old_name, string new_name);
5698 
5699 
5701  bool hasColumn(string cname);
5702 
5703 
5705  *string getIndex();
5706 
5707 
5709 protected:
5711 public:
5712 
5713 
5715  bool setIndexBase(string ix);
5716 
5717 
5720 
5721 
5723  abstract string getCreateSql(string table_name, *hash<auto> opts);
5724  };
5725 
5728 
5729 public:
5731  constructor(string n, *hash c, *string n_index) ;
5732 
5733  };
5734 
5737 
5738 public:
5739  constructor() ;
5740 
5741 
5742  constructor(string n, *hash c) ;
5743 
5744  };
5745 
5748 
5749 public:
5750  constructor(*hash c) ;
5751 
5752 
5755 
5756 
5759 
5760 
5763 
5764 
5766 
5782 
5783 
5785  *hash findConstraintOn(string table, softlist cols);
5786 
5787 
5789  string getElementName();
5790 
5791  };
5792 
5794 class ForeignConstraintTarget : public Serializable {
5795 
5796 public:
5798  string table;
5799 
5802 
5804  constructor(string t, Columns c);
5805 
5806 
5809 
5810  };
5811 
5814 
5815 public:
5818 
5819  constructor(string n, Columns c, ForeignConstraintTarget t) ;
5820 
5821 
5823 protected:
5825 public:
5826 
5827  };
5828 
5830 class AbstractSequence : public Serializable {
5831 
5832 public:
5834  string name;
5835 
5838 
5841 
5844 
5846  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
5847 
5848 
5850  abstract string getCreateSql(*hash<auto> opt);
5851 
5853 
5855  string getDropSql(*hash<auto> opt);
5856 
5857 
5859 
5862  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
5863  };
5864 
5866 class AbstractView : public Serializable {
5867 
5868 public:
5869  // ! potential object schema
5870  *string schema;
5871 
5873  string name;
5874 
5876  string src;
5877 
5880 
5882  constructor(string n_name, string n_src);
5883 
5884 
5886  abstract string getCreateSql(*hash<auto> opt);
5887 
5889 
5891  string getDropSql(*hash<auto> opt);
5892 
5893 
5895 
5898  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
5899  };
5900 
5902 class AbstractFunctionBase : public Serializable {
5903 
5904 public:
5906  string name;
5907 
5909  string type;
5910 
5912  string src;
5913 
5915 
5919  constructor(string n, string n_type, string n_src);
5920 
5921 
5923  string getType();
5924 
5925 
5927 
5929  string getDropSql(*hash<auto> opt);
5930 
5931 
5934 
5935 
5937  string getNormalizedSource(string src);
5938 
5939 
5941 protected:
5943 public:
5944  };
5945 
5948 
5949 public:
5951 
5955  constructor(string n, string n_type, string n_src) ;
5956 
5957 
5959  abstract list<auto> getCreateSql(*hash<auto> opt);
5960 
5962 
5965  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
5966 
5968  setName(string new_name);
5969 
5970  };
5971 
5974 
5975 public:
5976  constructor(*hash c) ;
5977 
5978 
5981 
5982 
5985 
5986 
5988 
6004 
6005 
6006  string getElementName();
6007 
6008  };
6009 
6012 
6013 public:
6015  constructor(string n, string n_src) ;
6016 
6017 
6019  abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
6020 
6022  abstract softlist<auto> getRenameSql(string table_name, string new_name);
6023 
6025  abstract list<auto> getDropSql(string table_name);
6026  };
6027 
6030 
6031 public:
6032  constructor(*hash c) ;
6033 
6034 
6037 
6038 
6041 
6042 
6044 
6060 
6061 
6062  string getElementName();
6063 
6064  };
6065 };
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5616
string src
the source of the check clause
Definition: SqlUtil.qm.dox.h:5620
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 base class for column information
Definition: SqlUtil.qm.dox.h:5268
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:5272
*string comment
comment on the column
Definition: SqlUtil.qm.dox.h:5287
*string def_val
default value for column
Definition: SqlUtil.qm.dox.h:5284
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
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...
*string qore_type
the equivalent qore type name of the column if known
Definition: SqlUtil.qm.dox.h:5275
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:5281
bool equal(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
string getNativeTypeString()
returns the string describing the native type that can be used in SQL (for example to add the colunn ...
int size
the size of the column
Definition: SqlUtil.qm.dox.h:5278
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:5642
Qore::AbstractIterator getSourceConstraintIterator()
returns an iterator through all known source foreign constraints on the current table
clearIndex()
clears any index base for the constraint
addSourceConstraint(string tname, AbstractForeignConstraint fk)
adds a foreign constraint source to the unique constraint
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
constructor(string n, Columns c, *string n_index)
creates the object from the name and a Columns object
findMatchingIndex(*Indexes indexes)
find an index that matches the constraint and marks both objects as related
removeSourceConstraint(string tname, list cols)
removes a source constraint
constructor(string n, *hash c, *string n_index)
creates the object from the name and a hash of column information
*string getIndex()
returns the name of the associated index, if any
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
*string index
the index supporting the constraint
Definition: SqlUtil.qm.dox.h:5650
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...
*hash sourceConstraints
a hash of ForeignConstraintSources, keyed by table name, the value is a hash of foreign constraints k...
Definition: SqlUtil.qm.dox.h:5647
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
bool hasColumn(string cname)
returns True if the constraint references the named column
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5554
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:5561
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:5242
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:5249
string name
the name of the object
Definition: SqlUtil.qm.dox.h:5246
constructor(string name)
creates the object from the name
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:5813
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:5817
base class for function or objects with code
Definition: SqlUtil.qm.dox.h:5902
string getNormalizedSource(string src)
returns normalized source for comparisons
string name
the name of the object
Definition: SqlUtil.qm.dox.h:5906
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:5912
string type
the type of object
Definition: SqlUtil.qm.dox.h:5909
string getType()
returns the type of object
base class for functions
Definition: SqlUtil.qm.dox.h:5947
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:4630
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:4637
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:5443
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
abstract bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
*AbstractColumnSupportingConstraint getSupportingConstraint()
returns the supporting constraint, if any
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the index in the database
string name
the name of the index
Definition: SqlUtil.qm.dox.h:5447
constructor(string n, bool u, hash c)
creates the object from the name, a unique flag, and a hash of column information
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:5450
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition: SqlUtil.qm.dox.h:5457
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:5453
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:4911
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:5736
base class for sequences
Definition: SqlUtil.qm.dox.h:5830
*number max
the ending number
Definition: SqlUtil.qm.dox.h:5843
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:5834
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:5837
number increment
the increment
Definition: SqlUtil.qm.dox.h:5840
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:6011
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:5727
constructor(string n, *hash 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:5866
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:5879
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:5873
constructor(string n_name, string n_src)
creates the object from the arguments
string src
the source code
Definition: SqlUtil.qm.dox.h:5876
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:5186
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:5512
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:5794
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:5801
string table
the name of the target table
Definition: SqlUtil.qm.dox.h:5798
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5747
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 findConstraintOn(string table, softlist 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:5973
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:5397
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
the base class to use to extend AbstractColumn to implement numeric columns
Definition: SqlUtil.qm.dox.h:5382
int scale
the scale for numeric columns
Definition: SqlUtil.qm.dox.h:5386
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 ...
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:50
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5000
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:6029
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)
list< auto > list(...)
number number(softnumber n)
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:32
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:2341
const DT_YEAR
Format unit: year.
Definition: SqlUtil.qm.dox.h:3372
const COP_OVER
the SQL "over" clause
Definition: SqlUtil.qm.dox.h:2361
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:2411
const COP_LENGTH
to get the length of a text field
Definition: SqlUtil.qm.dox.h:2428
const COP_RANK
Analytic (window) function: RANK.
Definition: SqlUtil.qm.dox.h:2486
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition: SqlUtil.qm.dox.h:2316
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4100
const COP_COALESCE
to return the first non-null argument in the list
Definition: SqlUtil.qm.dox.h:2416
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:4105
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:2269
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:4090
const SZ_NONE
the data type does not take a size parameter
Definition: SqlUtil.qm.dox.h:2277
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4110
const COP_MIN
to return the minimum value
Definition: SqlUtil.qm.dox.h:2336
const DB_SYNONYMS
Feature: synonyms.
Definition: SqlUtil.qm.dox.h:2249
const DB_PACKAGES
Feature: packages.
Definition: SqlUtil.qm.dox.h:2237
const DefaultUopMap
a hash of valid update operators
Definition: SqlUtil.qm.dox.h:3398
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition: SqlUtil.qm.dox.h:2401
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:2376
const IOP_SEQ
for using the value of a sequence
Definition: SqlUtil.qm.dox.h:4549
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:3384
const VARCHAR
specifies a VARCHAR column (equivalent to Qore::Type::String)
Definition: SqlUtil.qm.dox.h:2257
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:4150
const JopMap
a hash of valid join operators
Definition: SqlUtil.qm.dox.h:3609
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:4155
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:2386
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:4173
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:4604
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:2235
const COP_COUNT
to return the row count
Definition: SqlUtil.qm.dox.h:2356
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:2381
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:4160
const COP_AVG
to return the average value
Definition: SqlUtil.qm.dox.h:2346
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:3387
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4130
const COP_PLUS
the SQL "plus" operator
Definition: SqlUtil.qm.dox.h:2371
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition: SqlUtil.qm.dox.h:2444
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:4557
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:3375
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition: SqlUtil.qm.dox.h:2286
const COP_SUBSTR
to extract a substring from a column
Definition: SqlUtil.qm.dox.h:2421
const COP_SEQ
to return the next value of a sequence
Definition: SqlUtil.qm.dox.h:2406
const SZ_MAND
the data type takes a mandatory size parameter
Definition: SqlUtil.qm.dox.h:2280
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:2311
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition: SqlUtil.qm.dox.h:2266
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:2239
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:2479
const COP_NTILE
Analytic (window) function: NTILE.
Definition: SqlUtil.qm.dox.h:2472
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:4085
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4120
const COP_YEAR_MONTH
to return a date value with year to month information
Definition: SqlUtil.qm.dox.h:2391
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:4145
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
const DB_TABLES
Feature: tables.
Definition: SqlUtil.qm.dox.h:2243
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:2306
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:2326
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:2247
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:2296
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:2301
const JOP_INNER
for standard inner joins
Definition: SqlUtil.qm.dox.h:3596
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4095
const DT_HOUR
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3381
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition: SqlUtil.qm.dox.h:2493
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:2283
const CHAR
specifies a CHAR column
Definition: SqlUtil.qm.dox.h:2263
const COP_YEAR_DAY
to return a date value with year to day information
Definition: SqlUtil.qm.dox.h:2396
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:4135
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition: SqlUtil.qm.dox.h:2260
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition: SqlUtil.qm.dox.h:4115
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4165
const COP_UPPER
to return column value in upper case
Definition: SqlUtil.qm.dox.h:2321
const JOP_RIGHT
for right outer joins
Definition: SqlUtil.qm.dox.h:3606
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:2451
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:4554
const COP_TRUNC_DATE
to return the date with truncated value
Definition: SqlUtil.qm.dox.h:2437
const COP_MINUS
the SQL "minus" operator
Definition: SqlUtil.qm.dox.h:2366
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:2465
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition: SqlUtil.qm.dox.h:2458
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:2496
const DB_FUNCTIONS
Features constants.
Definition: SqlUtil.qm.dox.h:2233
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:2331
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4170
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:4125
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:3378
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:2241
const DB_TYPES
Feature: named types.
Definition: SqlUtil.qm.dox.h:2245
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4140
const COP_SUM
to return the sum value
Definition: SqlUtil.qm.dox.h:2351
const OP_LIKE
the SQL "like" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4080
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:3601
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:2162
string cop
the column operator string code
Definition: SqlUtil.qm.dox.h:2163
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2165
auto column
column sopecifier, may be a string or a complex hash
Definition: SqlUtil.qm.dox.h:2164
generic column description hash in schema descriptions
Definition: SqlUtil.qm.dox.h:2132
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:2148
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:2150
auto default_value
the default value for the column
Definition: SqlUtil.qm.dox.h:2142
softint scale
for numeric data types, this value gives the scale
Definition: SqlUtil.qm.dox.h:2140
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition: SqlUtil.qm.dox.h:2138
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:2144
*string comment
an optional comment for the column
Definition: SqlUtil.qm.dox.h:2146
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:2134
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:2136
*bool auto_increment
True for DBs that support an auto-increment column
Definition: SqlUtil.qm.dox.h:2152
insert operator info hash as returned by all insert operator functions
Definition: SqlUtil.qm.dox.h:2169
string _iop
the insert operator string code
Definition: SqlUtil.qm.dox.h:2170
any arg
optional argument
Definition: SqlUtil.qm.dox.h:2171
join operator info hash as returned by all join operator functions
Definition: SqlUtil.qm.dox.h:2182
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition: SqlUtil.qm.dox.h:2187
*string alias
optional alias for table in the query
Definition: SqlUtil.qm.dox.h:2185
*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:2188
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition: SqlUtil.qm.dox.h:2184
*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:2186
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition: SqlUtil.qm.dox.h:2189
string jop
the join operator string code
Definition: SqlUtil.qm.dox.h:2183
SQL operator info hash as returned by all operator functions.
Definition: SqlUtil.qm.dox.h:2156
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2158
string op
the operator string code
Definition: SqlUtil.qm.dox.h:2157
A hash describing SQL and arguments for an SQL DML command.
Definition: SqlUtil.qm.dox.h:2218
string sql
the SQL string for the update
Definition: SqlUtil.qm.dox.h:2220
list< auto > args
the arguments for the string
Definition: SqlUtil.qm.dox.h:2223
column data type options
Definition: SqlUtil.qm.dox.h:2193
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition: SqlUtil.qm.dox.h:2204
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition: SqlUtil.qm.dox.h:2198
*softint maxlen
optional additional limit to the maximum length of the data
Definition: SqlUtil.qm.dox.h:2212
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition: SqlUtil.qm.dox.h:2201
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition: SqlUtil.qm.dox.h:2207
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition: SqlUtil.qm.dox.h:2195
update operator info hash as returned by all update operator functions
Definition: SqlUtil.qm.dox.h:2175
*hash nest
option nested operation hash
Definition: SqlUtil.qm.dox.h:2178
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2177
string uop
the update operator string code
Definition: SqlUtil.qm.dox.h:2176