Qore SqlUtil Module Reference  1.7.4
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 
2146 namespace SqlUtil {
2148  public struct GenericColumnInfo {
2150  string qore_type;
2152  string native_type;
2154  softint size;
2156  softint scale;
2162  *string comment;
2164  bool notnull = False;
2166  hash<string, hash> driver;
2169  };
2170 
2172  public struct OperatorInfo {
2173  string op;
2174  auto arg;
2175  };
2176 
2178  public struct ColumnOperatorInfo {
2179  string cop;
2180  auto column;
2181  auto arg;
2182  };
2183 
2185  public struct InsertOperatorInfo {
2186  string _iop;
2187  any arg;
2188  };
2189 
2191  public struct UpdateOperatorInfo {
2192  string uop;
2193  auto arg;
2195  };
2196 
2198  public struct JoinOperatorInfo {
2199  string jop;
2200  auto table;
2201  *string alias;
2204  *string ta;
2205  *hash<auto> opt;
2206  };
2207 
2211  *string date_format;
2212 
2214  *TimeZone data_timezone;
2215 
2217  *TimeZone db_timezone;
2218 
2220  *string number_format;
2221 
2223  *softbool mandatory;
2224 
2226 
2228  *softint maxlen;
2229  };
2230 
2232 
2234  public struct SqlCommandInfo {
2236  string sql;
2237 
2239  list<auto> args;
2240  };
2241 
2247 
2249  const DB_FUNCTIONS = "functions";
2251  const DB_MVIEWS = "materialized views";
2253  const DB_PACKAGES = "packages";
2255  const DB_PROCEDURES = "procedures";
2257  const DB_SEQUENCES = "sequences";
2259  const DB_TABLES = "tables";
2261  const DB_TYPES = "named types";
2263  const DB_VIEWS = "views";
2265  const DB_SYNONYMS = "synonyms";
2267 
2268  /* @defgroup SqlTypeConstants SQL Type Constants
2269  These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
2270  */
2272  const VARCHAR = "string";
2274 
2276  const NUMERIC = "number";
2277 
2279  const CHAR = "char";
2280 
2282  const BLOB = "blob";
2283 
2285  const CLOB = "clob";
2287 
2293  const SZ_NONE = 0;
2294 
2296  const SZ_MAND = 1;
2297 
2299  const SZ_OPT = 2;
2300 
2302  const SZ_NUM = 3;
2304 
2310 
2312  const COP_AS = "as";
2313 
2315 
2317  const COP_CAST = "cast";
2318 
2320 
2322  const COP_PREPEND = "prepend";
2323 
2325 
2327  const COP_APPEND = "append";
2328 
2330 
2332  const COP_VALUE = "value";
2333 
2335 
2337  const COP_UPPER = "upper";
2338 
2340 
2342  const COP_LOWER = "lower";
2343 
2345 
2347  const COP_DISTINCT = "distinct";
2348 
2350 
2352  const COP_MIN = "min";
2353 
2355 
2357  const COP_MAX = "max";
2358 
2360 
2362  const COP_AVG = "avg";
2363 
2365 
2367  const COP_SUM = "sum";
2368 
2370 
2372  const COP_COUNT = "count";
2373 
2375 
2377  const COP_OVER = "over";
2378 
2380 
2382  const COP_MINUS = "minus";
2383 
2385 
2387  const COP_PLUS = "plus";
2388 
2390 
2392  const COP_DIVIDE = "divide";
2393 
2395 
2397  const COP_MULTIPLY = "multiply";
2398 
2400 
2402  const COP_YEAR = "year";
2403 
2405 
2407  const COP_YEAR_MONTH = "year_month";
2408 
2410 
2412  const COP_YEAR_DAY = "year_day";
2413 
2415 
2417  const COP_YEAR_HOUR = "year_hour";
2418 
2420 
2422  const COP_SEQ = "seq";
2423 
2425 
2427  const COP_SEQ_CURRVAL = "seq_currval";
2428 
2430 
2432  const COP_COALESCE = "coalesce";
2433 
2435 
2437  const COP_SUBSTR = "substr";
2438 
2440 
2444  const COP_LENGTH = "length";
2445 
2447 
2453  const COP_TRUNC_DATE = "truncate_date";
2454 
2456 
2460  const COP_CUME_DIST = "cume_dist";
2461 
2463 
2467  const COP_DENSE_RANK = "dense_rank";
2468 
2470 
2474  const COP_FIRST_VALUE = "first_value";
2475 
2477 
2481  const COP_LAST_VALUE = "last_value";
2482 
2484 
2488  const COP_NTILE = "ntile";
2489 
2491 
2495  const COP_PERCENT_RANK = "percent_rank";
2496 
2498 
2502  const COP_RANK = "rank";
2503 
2505 
2509  const COP_ROW_NUMBER = "row_number";
2510 
2512  const DefaultCopMap = ...;
2513 
2515 
2558 
2566  hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
2567 
2568 
2570 
2582  hash<ColumnOperatorInfo> cop_as(auto column, string arg);
2583 
2584 
2586 
2600  hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
2601 
2602 
2604 
2614  hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
2615 
2616 
2618 
2628  hash<ColumnOperatorInfo> cop_append(auto column, string arg);
2629 
2630 
2632 
2760  hash<ColumnOperatorInfo> cop_value(auto arg);
2761 
2762 
2764 
2773  hash<ColumnOperatorInfo> cop_upper(auto column);
2774 
2775 
2777 
2786  hash<ColumnOperatorInfo> cop_lower(auto column);
2787 
2788 
2790 
2799  hash<ColumnOperatorInfo> cop_distinct(auto column);
2800 
2801 
2803 
2812  hash<ColumnOperatorInfo> cop_min(auto column);
2813 
2814 
2816 
2825  hash<ColumnOperatorInfo> cop_max(auto column);
2826 
2827 
2829 
2838  hash<ColumnOperatorInfo> cop_avg(auto column);
2839 
2840 
2842 
2851  hash<ColumnOperatorInfo> cop_sum(auto column);
2852 
2853 
2855 
2862  hash<ColumnOperatorInfo> cop_count(auto column = '');
2863 
2864 
2866 
2873  hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
2874 
2875 
2877 
2887  hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
2888 
2889 
2891 
2901  hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
2902 
2903 
2905 
2915  hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
2916 
2917 
2919 
2929  hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
2930 
2931 
2933 
2942  hash<ColumnOperatorInfo> cop_year(auto column);
2943 
2944 
2946 
2955  hash<ColumnOperatorInfo> cop_year_month(auto column);
2956 
2957 
2959 
2968  hash<ColumnOperatorInfo> cop_year_day(auto column);
2969 
2970 
2972 
2981  hash<ColumnOperatorInfo> cop_year_hour(auto column);
2982 
2983 
2985 
2995  hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
2996 
2997 
2999 
3009  hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
3010 
3011 
3013 
3025  hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
3026 
3027 
3029 
3040  hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
3041 
3042 
3044 
3055  hash<ColumnOperatorInfo> cop_length(auto column);
3056 
3057 
3059 
3073  hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
3074 
3075 
3076 
3078 
3106  hash<ColumnOperatorInfo> cop_cume_dist();
3107 
3108 
3110 
3138  hash<ColumnOperatorInfo> cop_dense_rank();
3139 
3140 
3142 
3170  hash<ColumnOperatorInfo> cop_first_value(any column);
3171 
3172 
3174 
3202  hash<ColumnOperatorInfo> cop_last_value(any column);
3203 
3204 
3206 
3236  hash<ColumnOperatorInfo> cop_ntile(int value);
3237 
3238 
3240 
3268  hash<ColumnOperatorInfo> cop_percent_rank();
3269 
3270 
3272 
3300  hash<ColumnOperatorInfo> cop_rank();
3301 
3302 
3304 
3332  hash<ColumnOperatorInfo> cop_row_number();
3333 
3334 
3336 
3388  const DT_YEAR = "Y";
3389 
3391  const DT_MONTH = "M";
3392 
3394  const DT_DAY = "D";
3395 
3397  const DT_HOUR = "H";
3398 
3400  const DT_MINUTE = "m";
3401 
3403  const DT_SECOND = "S";
3404 
3405  // let's simulate and enum here'
3406  const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
3408 
3414  const DefaultUopMap = ...;
3415 
3417 
3440 
3448  hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
3449 
3450 
3452 
3462  hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
3463 
3464 
3466 
3476  hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
3477 
3478 
3480 
3489  hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
3490 
3491 
3493 
3502  hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
3503 
3504 
3506 
3517  hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
3518 
3519 
3521 
3531  hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
3532 
3533 
3535 
3545  hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
3546 
3547 
3549 
3559  hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
3560 
3561 
3563 
3573  hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
3574 
3575 
3577 
3586  hash<UpdateOperatorInfo> uop_seq(string seq);
3587 
3588 
3590 
3599  hash<UpdateOperatorInfo> uop_seq_currval(string seq);
3600 
3602 
3610 
3612  const JOP_INNER = "inner";
3613 
3615 
3617  const JOP_LEFT = "left";
3618 
3620 
3622  const JOP_RIGHT = "right";
3623 
3625  const JopMap = ...;
3626 
3628 
3639 
3642  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3643 
3644 
3646 
3650  hash<string, hash<JoinOperatorInfo>> make_jop(string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash<auto> opt);
3651 
3652 
3654 
3673  hash<string, hash<JoinOperatorInfo>> join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3674 
3675 
3677 
3696  hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3697 
3698 
3700 
3719  hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3720 
3721 
3723 
3745  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3746 
3747 
3749 
3769  hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3770 
3771 
3773 
3795  hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3796 
3797 
3799 
3818  hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3819 
3820 
3822 
3841  hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3842 
3843 
3845 
3866  hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3867 
3868 
3870 
3890  hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3891 
3892 
3894 
3914  hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3915 
3916 
3918 
3940  hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3941 
3942 
3944 
3963  hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3964 
3965 
3967 
3986  hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
3987 
3988 
3990 
4011  hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4012 
4013 
4015 
4035  hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4036 
4037 
4039 
4059  hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4060 
4061 
4063 
4085  hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
4086 
4088 
4094 
4096  const OP_LIKE = "like";
4097 
4099 
4101  const OP_LT = "<";
4102 
4104 
4106  const OP_LE = "<=";
4107 
4109 
4111  const OP_GT = ">";
4112 
4114 
4116  const OP_GE = ">=";
4117 
4119 
4121  const OP_NE = "!=";
4122 
4124 
4126  const OP_EQ = "=";
4127 
4129 
4131  const OP_CLT = "C<";
4132 
4134 
4136  const OP_CLE = "C<=";
4137 
4139 
4141  const OP_CGT = "C>";
4142 
4144 
4146  const OP_CGE = "C>=";
4147 
4149 
4151  const OP_CNE = "C!=";
4152 
4154 
4156  const OP_CEQ = "C=";
4157 
4159 
4161  const OP_BETWEEN = "between";
4162 
4164 
4166  const OP_IN = "in";
4167 
4169 
4171  const OP_NOT = "not";
4172 
4174 
4176  const OP_SUBSTR = "substr";
4177 
4179 
4181  const OP_OR = "or";
4182 
4184 
4186  const OP_IN_SELECT = "in_select";
4187 
4189  const DefaultOpMap = ...;
4190 
4192 
4217  hash<OperatorInfo> make_op(string op, auto arg);
4218 
4219 
4221 
4230  hash<OperatorInfo> op_like(string str);
4231 
4232 
4234 
4245  hash<OperatorInfo> op_lt(auto arg);
4246 
4247 
4249 
4260  hash<OperatorInfo> op_le(auto arg);
4261 
4262 
4264 
4275  hash<OperatorInfo> op_gt(auto arg);
4276 
4277 
4279 
4290  hash<OperatorInfo> op_ge(auto arg);
4291 
4292 
4294 
4307  hash<OperatorInfo> op_ne(auto arg);
4308 
4309 
4311 
4324  hash<OperatorInfo> op_eq(auto arg);
4325 
4326 
4328 
4340  hash<OperatorInfo> op_between(auto l, auto r);
4341 
4342 
4344 
4353  hash<OperatorInfo> op_in();
4354 
4355 
4357 
4364  hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
4365 
4366 
4368 
4375  hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
4376 
4377 
4379 
4386  hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
4387 
4388 
4390 
4401  hash<OperatorInfo> op_in(list<auto> args);
4402 
4403 
4405 
4412  hash<OperatorInfo> op_not(hash arg);
4413 
4414 
4416 
4427  hash<OperatorInfo> op_clt(string arg);
4428 
4429 
4431 
4442  hash<OperatorInfo> op_cle(string arg);
4443 
4444 
4446 
4457  hash<OperatorInfo> op_cgt(string arg);
4458 
4459 
4461 
4472  hash<OperatorInfo> op_cge(string arg);
4473 
4474 
4476 
4487  hash<OperatorInfo> op_cne(string arg);
4488 
4489 
4491 
4502  hash<OperatorInfo> op_ceq(string arg);
4503 
4504 
4506 
4517  hash<OperatorInfo> op_substr(int start, *int count, string text);
4518 
4519 
4521 
4531  hash<OperatorInfo> op_substr(int start, string text);
4532 
4533 
4535 
4552  hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
4553 
4555 
4563 
4565  const IOP_SEQ = "seq";
4566 
4568 
4570  const IOP_SEQ_CURRVAL = "seq_currval";
4571 
4573  const DefaultIopMap = {};
4575 
4582 
4589  hash<InsertOperatorInfo> make_iop(string iop, auto arg);
4590 
4591 
4593 
4602  hash<InsertOperatorInfo> iop_seq(string arg);
4603 
4604 
4606 
4615  hash<InsertOperatorInfo> iop_seq_currval(string arg);
4616 
4618 
4620  const SqlUtilDrivers = ...;
4621 
4622 
4623  // private variable to store the closure used to deserialize datasources (if any)
4624  extern code ds_get;
4625 
4626  // private variable to store the closure used to serialize datasources (if any)
4627  extern code ds_do;
4628 
4631 
4632 
4635 
4636 
4637  // private function used to deserialize datasources
4638  AbstractDatasource sqlutil_get_ds(string type, string config);
4639 
4640 
4641  // private function used to serialize datasources
4642  hash<auto> sqlutil_ds(AbstractDatasource ds);
4643 
4644 
4646 class AbstractHashContainer : public Serializable {
4647 
4648 public:
4649 
4650 
4651 protected:
4654 
4655 public:
4656 
4659 
4660 
4663 
4664 
4667 
4668 
4670 
4685  auto memberGate(string k);
4686 
4687 
4689 
4696 
4697 
4699  abstract auto take(string k);
4700 
4702  renameKey(string old_name, string new_name);
4703 
4704 
4706  *hash<auto> getHash();
4707 
4708 
4710 
4719  bool matchKeys(hash h1);
4720 
4721 
4723 
4732  bool matchKeys(list<auto> l);
4733 
4734 
4736 
4746 
4747 
4749 
4759 
4760 
4762 
4771  bool partialMatchKeys(list<auto> l);
4772 
4773 
4775 
4785 
4786 
4788 
4797  bool val();
4798 
4799 
4801 
4808  list<string> keys();
4809 
4810 
4812 
4819  list<auto> values();
4820 
4821 
4823 
4831 
4832 
4834 
4842 
4843 
4845 
4853 
4854 
4856  bool empty();
4857 
4858 
4860 
4867  int size();
4868 
4869 
4871 
4880  bool hasKey(string k);
4881 
4882 
4884 
4893  bool hasKeyValue(string k);
4894 
4895 
4897 
4906  *string firstKey();
4907 
4908 
4910 
4919  *string lastKey();
4920 
4921 
4923  abstract string getElementName();
4924  };
4925 
4927 class AbstractListContainer : public Serializable {
4928 
4929 public:
4930 
4931 
4932 protected:
4933  softlist l;
4934 
4935 public:
4936 
4938  constructor(softlist nl);
4939 
4940 
4942 
4953  abstract auto get(softint i);
4954 
4956  add(auto val);
4957 
4958 
4960  auto take(int i);
4961 
4962 
4964  list<auto> getList();
4965 
4966 
4968 
4977  bool val();
4978 
4979 
4981 
4989 
4990 
4992  bool empty();
4993 
4994 
4996 
5003  int size();
5004 
5005 
5007  abstract string getElementName();
5008 
5009 protected:
5010  checkIndex(int i);
5011 public:
5012 
5013  };
5014 
5017 
5018 public:
5021 
5022 
5024  constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
5025 
5026 
5028  constructor(AbstractDatasource ds);
5029 
5030 
5032  add(string k, Table val);
5033 
5034 
5036  add(string k, AbstractTable val);
5037 
5038 
5041 
5042 
5045 
5046 
5048  AbstractTable take(string k);
5049 
5050 
5052  populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
5053 
5054 
5056  populate(AbstractDatasource ds);
5057 
5058 
5060 
5076  *list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
5077 
5078 
5080 
5096 
5097 
5099  string getElementName();
5100 
5101 
5103  *AbstractTable getIfExists(AbstractDatasource ds, string name);
5104 
5105 
5107  AbstractTable get(AbstractDatasource ds, string name);
5108 
5109 
5111 
5126  *string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
5127 
5128 
5130 
5141  bool tableRenamed(string old_name, string new_name, string old_sql_name);
5142 
5143 
5144 protected:
5145  tableRenamedIntern(string old_name, string new_name, string oldsn);
5146 public:
5147 
5148 
5150 
5165  *string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
5166 
5167 
5168  list<auto> getCreateList();
5169 
5170 
5171  Qore::AbstractIterator createIterator();
5172 
5173 
5175 
5183  list<auto> getDropList();
5184 
5185 
5187 
5195 
5196 
5197 protected:
5198  getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
5199 public:
5200 
5201  };
5202 
5205 
5206 public:
5209 
5210 
5213 
5214 
5216  add(string k, AbstractColumn val);
5217 
5218 
5221 
5222 
5224 
5240 
5241 
5243  Columns subset(softlist l);
5244 
5245 
5247  string getElementName();
5248 
5249 
5251  bool equal(Columns cols);
5252 
5253 
5255  AbstractIterator getSqlColumnNameIterator();
5256 
5257  };
5258 
5260 class AbstractDdlObject : public Serializable {
5261 
5262 public:
5264  string name;
5265 
5267  string ddl_name;
5268 
5270 protected:
5272 public:
5273 
5274 
5277 
5278 
5280 
5282  abstract string getDdlName(string name);
5283  };
5284 
5287 
5288 public:
5290  string native_type;
5291 
5293  *string qore_type;
5294 
5296  int size;
5297 
5299  bool nullable;
5300 
5302  *string def_val;
5303 
5305  *string comment;
5306 
5308 protected:
5310 public:
5311 
5312 
5313  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c)
5314  ;
5315 
5316 
5319 
5320 
5323 
5324 
5326 
5335  abstract list<auto> getAddColumnSql(AbstractTable t);
5336 
5338  string getDropSql(string table_name);
5339 
5340 
5342 
5355  list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5356 
5357 
5359 
5369  abstract string getRenameSql(AbstractTable t, string new_name);
5370 
5373 
5374 
5376 protected:
5377  abstract bool equalImpl(AbstractColumn c);
5378 public:
5379 
5381 
5394 protected:
5395  abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
5396 public:
5397  };
5398 
5400 class NumericColumnInfo : public Serializable {
5401 
5402 public:
5404  int scale;
5405 
5406  constructor(softint n_scale = 0);
5407 
5408 
5410  string getNativeTypeString(string native_type, int precision);
5411 
5412  };
5413 
5416 
5417 public:
5418  constructor(*hash c) ;
5419 
5420 
5422  add(string k, AbstractIndex val);
5423 
5424 
5427 
5428 
5430  AbstractIndex take(string k);
5431 
5432 
5435 
5436 
5438 
5454 
5455 
5456  string getElementName();
5457 
5458  };
5459 
5461 class AbstractIndex : public Serializable {
5462 
5463 public:
5465  string name;
5466 
5468  bool unique;
5469 
5472 
5473 protected:
5476 
5479 
5480 public:
5481 
5483  constructor(string n, bool u, hash c);
5484 
5485 
5487  string getName();
5488 
5489 
5491  bool hasColumn(string cname);
5492 
5493 
5495  abstract string getCreateSql(string table_name, *hash<auto> opt);
5496 
5498  string getDropSql(string table_name);
5499 
5500 
5503 
5504 
5507 
5508 
5510  abstract bool equalImpl(AbstractIndex ix);
5511 
5513  abstract string getRenameSql(string table_name, string new_name);
5514 
5517 
5518 
5521 
5522 
5525 
5526 
5529 
5530 
5533 
5534 
5537 
5538 
5540  *list<AbstractColumnConstraint> getAllSupportingConstraints();
5541 
5542 
5544  list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
5545 
5546  };
5547 
5550 
5551 public:
5552  constructor(*hash c) ;
5553 
5554 
5557 
5558 
5561 
5562 
5565 
5566 
5568 
5584 
5585 
5586  string getElementName();
5587 
5588  };
5589 
5591 class AbstractConstraint : public Serializable {
5592 
5593 public:
5594 
5595 
5596 protected:
5598  string name;
5599 
5600 public:
5601 
5603  constructor(string n);
5604 
5605 
5607  string getName();
5608 
5609 
5611  rename(string n);
5612 
5613 
5615  abstract string getCreateSql(string table_name, *hash<auto> opt);
5616 
5618  string getDropSql(string table_name);
5619 
5620 
5622  abstract list<auto> getRenameSql(string table_name, string new_name);
5623 
5625  string getDisableSql(string table_name);
5626 
5627 
5629  string getEnableSql(string table_name, *hash<auto> opt);
5630 
5631 
5634 
5635 
5637 protected:
5638  abstract bool equalImpl(AbstractConstraint c);
5639 public:
5640 
5642  abstract bool setIndexBase(string ix);
5643 
5645  abstract clearIndex();
5646 
5648  bool hasColumn(string cname);
5649 
5650  };
5651 
5654 
5655 public:
5657  string src;
5658 
5660  constructor(string n, string n_src) ;
5661 
5662 
5664 protected:
5666 public:
5667 
5668 
5670  bool setIndexBase(string ix);
5671 
5672 
5675 
5676  };
5677 
5680 
5681 public:
5682 protected:
5684  *string index;
5685 
5686 public:
5687 
5689  constructor(string name, *hash<auto> cols, *string index) ;
5690 
5691 
5693  constructor(string name, Columns cols, *string index) ;
5694 
5695 
5697  bool setIndexBase(string ix);
5698 
5699 
5702 
5703  };
5704 
5707 
5708 public:
5709 protected:
5711  *hash<string, hash<string, AbstractForeignConstraint>> sourceConstraints;
5712 
5713 public:
5714 
5716  constructor(string name, *hash<auto> cols, *string index) ;
5717 
5718 
5720  constructor(string name, Columns cols, *string index) ;
5721 
5722 
5724 
5729 
5730 
5732  hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
5733 
5734 
5737 
5738 
5740 
5751 
5752 
5754  removeSourceConstraint(string tname, list<auto> cols);
5755 
5756 
5758  renameSourceConstraintTable(string old_name, string new_name);
5759 
5760 
5762  bool hasColumn(string cname);
5763 
5764 
5766  *string getIndex();
5767 
5768 
5770 protected:
5772 public:
5773 
5774 
5776  abstract string getCreateSql(string table_name, *hash<auto> opts);
5777  };
5778 
5781 
5782 public:
5784  constructor(string n, *hash<auto> c, *string n_index) ;
5785 
5786  };
5787 
5790 
5791 public:
5792  constructor() ;
5793 
5794 
5795  constructor(string n, *hash<auto> c) ;
5796 
5797  };
5798 
5801 
5802 public:
5803  constructor(*hash<auto> c) ;
5804 
5805 
5808 
5809 
5812 
5813 
5816 
5817 
5819 
5835 
5836 
5838  *hash<auto> findConstraintOn(string table, softlist<auto> cols);
5839 
5840 
5842  string getElementName();
5843 
5844  };
5845 
5847 class ForeignConstraintTarget : public Serializable {
5848 
5849 public:
5851  string table;
5852 
5855 
5857  constructor(string t, Columns c);
5858 
5859 
5862 
5863  };
5864 
5867 
5868 public:
5871 
5872  constructor(string name, Columns cols, ForeignConstraintTarget t) ;
5873 
5874 
5876 protected:
5878 public:
5879 
5880  };
5881 
5883 class AbstractSequence : public Serializable {
5884 
5885 public:
5887  string name;
5888 
5891 
5894 
5897 
5899  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
5900 
5901 
5903  abstract string getCreateSql(*hash<auto> opt);
5904 
5906 
5908  string getDropSql(*hash<auto> opt);
5909 
5910 
5912 
5915  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
5916  };
5917 
5919 class AbstractView : public Serializable {
5920 
5921 public:
5922  // ! potential object schema
5923  *string schema;
5924 
5926  string name;
5927 
5929  string src;
5930 
5933 
5935  constructor(string n_name, string n_src);
5936 
5937 
5939  abstract string getCreateSql(*hash<auto> opt);
5940 
5942 
5944  string getDropSql(*hash<auto> opt);
5945 
5946 
5948 
5951  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
5952  };
5953 
5955 class AbstractFunctionBase : public Serializable {
5956 
5957 public:
5959  string name;
5960 
5962  string type;
5963 
5965  string src;
5966 
5968 
5972  constructor(string n, string n_type, string n_src);
5973 
5974 
5976  string getType();
5977 
5978 
5980 
5982  string getDropSql(*hash<auto> opt);
5983 
5984 
5987 
5988 
5990  string getNormalizedSource(string src);
5991 
5992 
5994 protected:
5996 public:
5997  };
5998 
6001 
6002 public:
6004 
6008  constructor(string n, string n_type, string n_src) ;
6009 
6010 
6012  abstract list<auto> getCreateSql(*hash<auto> opt);
6013 
6015 
6018  abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
6019 
6021  setName(string new_name);
6022 
6023  };
6024 
6027 
6028 public:
6029  constructor(*hash c) ;
6030 
6031 
6034 
6035 
6038 
6039 
6041 
6057 
6058 
6059  string getElementName();
6060 
6061  };
6062 
6065 
6066 public:
6068  constructor(string n, string n_src) ;
6069 
6070 
6072  abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
6073 
6075  abstract softlist<auto> getRenameSql(string table_name, string new_name);
6076 
6078  abstract list<auto> getDropSql(string table_name);
6079  };
6080 
6083 
6084 public:
6085  constructor(*hash c) ;
6086 
6087 
6090 
6091 
6094 
6095 
6097 
6113 
6114 
6115  string getElementName();
6116 
6117  };
6118 };
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5653
string src
the source of the check clause
Definition: SqlUtil.qm.dox.h:5657
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:5679
*string index
the index supporting the constraint
Definition: SqlUtil.qm.dox.h:5684
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:5286
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:5290
*string comment
comment on the column
Definition: SqlUtil.qm.dox.h:5305
*string def_val
default value for column
Definition: SqlUtil.qm.dox.h:5302
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:5293
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:5299
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:5296
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:5706
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:5711
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:5591
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:5598
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:5260
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:5267
string name
the name of the object
Definition: SqlUtil.qm.dox.h:5264
constructor(string name)
creates the object from the name
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:5866
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:5870
base class for function or objects with code
Definition: SqlUtil.qm.dox.h:5955
string getNormalizedSource(string src)
returns normalized source for comparisons
string name
the name of the object
Definition: SqlUtil.qm.dox.h:5959
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:5965
string type
the type of object
Definition: SqlUtil.qm.dox.h:5962
string getType()
returns the type of object
base class for functions
Definition: SqlUtil.qm.dox.h:6000
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:4646
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:4653
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:5461
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:5478
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:5465
*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:5468
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition: SqlUtil.qm.dox.h:5475
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:5471
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:4927
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:5789
base class for sequences
Definition: SqlUtil.qm.dox.h:5883
*number max
the ending number
Definition: SqlUtil.qm.dox.h:5896
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:5887
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:5890
number increment
the increment
Definition: SqlUtil.qm.dox.h:5893
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:6064
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:5780
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:5919
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:5932
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:5926
constructor(string n_name, string n_src)
creates the object from the arguments
string src
the source code
Definition: SqlUtil.qm.dox.h:5929
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:5204
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:5549
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:5847
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:5854
string table
the name of the target table
Definition: SqlUtil.qm.dox.h:5851
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5800
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:6026
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:5415
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:5400
int scale
the scale for numeric columns
Definition: SqlUtil.qm.dox.h:5404
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:44
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5016
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:6082
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 AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:26
hash< string, hash< JoinOperatorInfo > > join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for right outer joins with the given arguments for use when joining with a table other...
const COP_MAX
to return the maximum value
Definition: SqlUtil.qm.dox.h:2357
const DT_YEAR
Format unit: year.
Definition: SqlUtil.qm.dox.h:3388
const COP_OVER
the SQL "over" clause
Definition: SqlUtil.qm.dox.h:2377
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:2427
const COP_LENGTH
to get the length of a text field
Definition: SqlUtil.qm.dox.h:2444
const COP_RANK
Analytic (window) function: RANK.
Definition: SqlUtil.qm.dox.h:2502
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition: SqlUtil.qm.dox.h:2332
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4116
const COP_COALESCE
to return the first non-null argument in the list
Definition: SqlUtil.qm.dox.h:2432
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:4121
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:2285
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:4106
const SZ_NONE
the data type does not take a size parameter
Definition: SqlUtil.qm.dox.h:2293
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4126
const COP_MIN
to return the minimum value
Definition: SqlUtil.qm.dox.h:2352
const DB_SYNONYMS
Feature: synonyms.
Definition: SqlUtil.qm.dox.h:2265
const DB_PACKAGES
Feature: packages.
Definition: SqlUtil.qm.dox.h:2253
const DefaultUopMap
a hash of valid update operators
Definition: SqlUtil.qm.dox.h:3414
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition: SqlUtil.qm.dox.h:2417
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:2392
const IOP_SEQ
for using the value of a sequence
Definition: SqlUtil.qm.dox.h:4565
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:3400
const VARCHAR
specifies a VARCHAR column (equivalent to Qore::Type::String)
Definition: SqlUtil.qm.dox.h:2273
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:4166
const JopMap
a hash of valid join operators
Definition: SqlUtil.qm.dox.h:3625
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:4171
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:2402
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:4189
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:4620
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:2251
const COP_COUNT
to return the row count
Definition: SqlUtil.qm.dox.h:2372
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:2397
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:4176
const COP_AVG
to return the average value
Definition: SqlUtil.qm.dox.h:2362
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:3403
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4146
const COP_PLUS
the SQL "plus" operator
Definition: SqlUtil.qm.dox.h:2387
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition: SqlUtil.qm.dox.h:2460
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:4573
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:3391
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition: SqlUtil.qm.dox.h:2302
const COP_SUBSTR
to extract a substring from a column
Definition: SqlUtil.qm.dox.h:2437
const COP_SEQ
to return the next value of a sequence
Definition: SqlUtil.qm.dox.h:2422
const SZ_MAND
the data type takes a mandatory size parameter
Definition: SqlUtil.qm.dox.h:2296
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:2327
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition: SqlUtil.qm.dox.h:2282
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:2255
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:2495
const COP_NTILE
Analytic (window) function: NTILE.
Definition: SqlUtil.qm.dox.h:2488
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:4101
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4136
const COP_YEAR_MONTH
to return a date value with year to month information
Definition: SqlUtil.qm.dox.h:2407
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:4161
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
const DB_TABLES
Feature: tables.
Definition: SqlUtil.qm.dox.h:2259
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:2322
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:2342
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:2263
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:2312
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:2317
const JOP_INNER
for standard inner joins
Definition: SqlUtil.qm.dox.h:3612
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4111
const DT_HOUR
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3397
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition: SqlUtil.qm.dox.h:2509
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:2299
const CHAR
specifies a CHAR column
Definition: SqlUtil.qm.dox.h:2279
const COP_YEAR_DAY
to return a date value with year to day information
Definition: SqlUtil.qm.dox.h:2412
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:4151
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition: SqlUtil.qm.dox.h:2276
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition: SqlUtil.qm.dox.h:4131
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4181
const COP_UPPER
to return column value in upper case
Definition: SqlUtil.qm.dox.h:2337
const JOP_RIGHT
for right outer joins
Definition: SqlUtil.qm.dox.h:3622
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:2467
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:4570
const COP_TRUNC_DATE
to return the date with truncated value
Definition: SqlUtil.qm.dox.h:2453
const COP_MINUS
the SQL "minus" operator
Definition: SqlUtil.qm.dox.h:2382
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:2481
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition: SqlUtil.qm.dox.h:2474
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:2512
const DB_FUNCTIONS
Features constants.
Definition: SqlUtil.qm.dox.h:2249
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:2347
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4186
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:4141
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:3394
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:2257
const DB_TYPES
Feature: named types.
Definition: SqlUtil.qm.dox.h:2261
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4156
const COP_SUM
to return the sum value
Definition: SqlUtil.qm.dox.h:2367
const OP_LIKE
the SQL "like" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4096
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:3617
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:2178
string cop
the column operator string code
Definition: SqlUtil.qm.dox.h:2179
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2181
auto column
column sopecifier, may be a string or a complex hash
Definition: SqlUtil.qm.dox.h:2180
generic column description hash in schema descriptions
Definition: SqlUtil.qm.dox.h:2148
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:2164
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:2166
auto default_value
the default value for the column
Definition: SqlUtil.qm.dox.h:2158
softint scale
for numeric data types, this value gives the scale
Definition: SqlUtil.qm.dox.h:2156
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition: SqlUtil.qm.dox.h:2154
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:2160
*string comment
an optional comment for the column
Definition: SqlUtil.qm.dox.h:2162
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:2150
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:2152
*bool auto_increment
True for DBs that support an auto-increment column
Definition: SqlUtil.qm.dox.h:2168
insert operator info hash as returned by all insert operator functions
Definition: SqlUtil.qm.dox.h:2185
string _iop
the insert operator string code
Definition: SqlUtil.qm.dox.h:2186
any arg
optional argument
Definition: SqlUtil.qm.dox.h:2187
join operator info hash as returned by all join operator functions
Definition: SqlUtil.qm.dox.h:2198
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition: SqlUtil.qm.dox.h:2203
*string alias
optional alias for table in the query
Definition: SqlUtil.qm.dox.h:2201
*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:2204
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition: SqlUtil.qm.dox.h:2200
*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:2202
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition: SqlUtil.qm.dox.h:2205
string jop
the join operator string code
Definition: SqlUtil.qm.dox.h:2199
SQL operator info hash as returned by all operator functions.
Definition: SqlUtil.qm.dox.h:2172
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2174
string op
the operator string code
Definition: SqlUtil.qm.dox.h:2173
A hash describing SQL and arguments for an SQL DML command.
Definition: SqlUtil.qm.dox.h:2234
string sql
the SQL string for the update
Definition: SqlUtil.qm.dox.h:2236
list< auto > args
the arguments for the string
Definition: SqlUtil.qm.dox.h:2239
column data type options
Definition: SqlUtil.qm.dox.h:2209
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition: SqlUtil.qm.dox.h:2220
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition: SqlUtil.qm.dox.h:2214
*softint maxlen
optional additional limit to the maximum length of the data
Definition: SqlUtil.qm.dox.h:2228
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition: SqlUtil.qm.dox.h:2217
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition: SqlUtil.qm.dox.h:2223
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition: SqlUtil.qm.dox.h:2211
update operator info hash as returned by all update operator functions
Definition: SqlUtil.qm.dox.h:2191
*hash nest
option nested operation hash
Definition: SqlUtil.qm.dox.h:2194
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2193
string uop
the update operator string code
Definition: SqlUtil.qm.dox.h:2192