 |
Qore SqlUtil Module Reference
1.6
|
2491 "code":
string (
string cve,
string arg, reference<hash<auto>> psch) {
2494 psch{arg.substr(1, -1)} = cve;
2497 return sprintf(
"%s as %s", cve, arg);
2503 "code":
string (
string cve,
string arg) {
2504 return sprintf(
"%s || %s", arg, cve);
2510 "code":
string (
string cve,
string arg) {
2511 return sprintf(
"%s || %s", cve, arg);
2517 "code":
string (*
string cve,
auto arg) {
2522 "code":
string (
string cve,
auto arg) {
2523 return sprintf(
"upper(%s)", cve);
2527 "code":
string (
string cve,
auto arg) {
2528 return sprintf(
"lower(%s)", cve);
2532 "code":
string (
string cve,
auto arg) {
2533 return sprintf(
"distinct %s", cve);
2537 "code":
string (
string cve,
auto arg) {
2538 return sprintf(
"min(%s)", cve);
2543 "code":
string (
string cve,
auto arg) {
2544 return sprintf(
"max(%s)", cve);
2549 "code":
string (
string cve,
auto arg) {
2550 return sprintf(
"avg(%s)", cve);
2555 "code":
string (
string cve,
auto arg) {
2556 return sprintf(
"sum(%s)", cve);
2562 "code":
string (*
string cve,
auto arg) {
2563 return sprintf(
"count(%s)", cve ? cve :
"*");
2568 "code":
string (
string arg1,
string arg2) {
2569 return sprintf(
"%s - %s", arg1, arg2);
2574 "code":
string (
string arg1,
string arg2) {
2575 return sprintf(
"%s + %s", arg1, arg2);
2580 "code":
string (
string arg1,
string arg2) {
2581 return sprintf(
"%s / %s", arg1, arg2);
2586 "code":
string (
string arg1,
string arg2) {
2587 return sprintf(
"%s * %s", arg1, arg2);
2592 "code":
string (*
string cve, hash<auto> arg) {
2593 throw "SEQUENCE-ERROR",
sprintf(
"cannot select sequence %y because this database does not support sequences", arg.seq);
2598 "code":
string (*
string cve, hash<auto> arg) {
2599 throw "SEQUENCE-ERROR",
sprintf(
"cannot select the current value of sequence %y because this database does not support sequences", arg.seq);
2604 "code":
string (*
string cve, hash<auto> arg) {
2605 return sprintf(
"coalesce(%s)", (foldl $1 +
"," + $2, arg.args));
2609 "code":
string (
string cve, list<auto> args) {
2611 return sprintf(
"substring(%s from %d)", cve, args[0]);
2612 return sprintf(
"substring(%s from %d for %d)", cve, args[0], args[1]);
2616 "code":
string (
string cve,
auto arg) {
2617 return sprintf(
"length(%s)", cve);
2621 "columnargs" :
True,
2622 "columnargs_ignore_nothings" :
True,
2623 "code":
string (*
string cve, hash<auto> args)
2625 *
string partitionby = args.args[0];
2626 *
string orderby = args.args[1];
2629 string sql = cve +
" over (";
2631 sql +=
sprintf(
"partition by %s", partitionby);
2633 sql +=
sprintf(
" order by %s", orderby);
2640 "code":
string (*
string cve,
auto arg) {
2641 return "cume_dist()";
2646 "code":
string (*
string cve,
auto arg) {
2647 return "dense_rank()";
2651 "code":
string (
string cve) {
2652 return sprintf(
"first_value(%s)", cve);
2656 "code":
string (
string cve) {
2657 return sprintf(
"last_value(%s)", cve);
2663 "code":
string (*
string cve,
auto arg) {
2664 return sprintf(
"ntile(%d)", arg);
2669 "code":
string (*
string cve,
auto arg) {
2670 return "percent_rank()";
2675 "code":
string (*
string cve,
auto arg) {
2681 "code":
string (*
string cve,
auto arg) {
2682 return "row_number()";
2738 hash<ColumnOperatorInfo>
make_cop(
string cop,
auto column,
auto arg);
2754 hash<ColumnOperatorInfo>
cop_as(
auto column,
string arg);
2772 hash<ColumnOperatorInfo>
cop_cast(
auto column,
string arg,
auto arg1,
auto arg2);
2786 hash<ColumnOperatorInfo>
cop_prepend(
auto column,
string arg);
2800 hash<ColumnOperatorInfo>
cop_append(
auto column,
string arg);
2932 hash<ColumnOperatorInfo>
cop_value(
auto arg);
2945 hash<ColumnOperatorInfo>
cop_upper(
auto column);
2958 hash<ColumnOperatorInfo>
cop_lower(
auto column);
2984 hash<ColumnOperatorInfo>
cop_min(
auto column);
2997 hash<ColumnOperatorInfo>
cop_max(
auto column);
3010 hash<ColumnOperatorInfo>
cop_avg(
auto column);
3023 hash<ColumnOperatorInfo>
cop_sum(
auto column);
3034 hash<ColumnOperatorInfo>
cop_count(
auto column =
'');
3045 hash<ColumnOperatorInfo>
cop_over(
auto column, *
string partitionby, *
string orderby);
3059 hash<ColumnOperatorInfo>
cop_minus(
auto column1,
auto column2);
3073 hash<ColumnOperatorInfo>
cop_plus(
auto column1,
auto column2);
3087 hash<ColumnOperatorInfo>
cop_divide(
auto column1,
auto column2);
3101 hash<ColumnOperatorInfo>
cop_multiply(
auto column1,
auto column2);
3114 hash<ColumnOperatorInfo>
cop_year(
auto column);
3167 hash<ColumnOperatorInfo>
cop_seq(
string seq, *
string as);
3197 hash<ColumnOperatorInfo>
cop_coalesce(
auto col1,
auto col2);
3212 hash<ColumnOperatorInfo>
cop_substr(
auto column,
int start, *
int count);
3227 hash<ColumnOperatorInfo>
cop_length(
auto column);
3245 hash<ColumnOperatorInfo>
cop_trunc_date(
auto column,
string mask);
3408 hash<ColumnOperatorInfo>
cop_ntile(
int value);
3472 hash<ColumnOperatorInfo>
cop_rank();
3593 "code":
string (
string cve,
auto arg) {
3594 return sprintf(
"%s - %s", cve, arg);
3599 "code":
string (
string cve,
auto arg) {
3600 return sprintf(
"%s + %s", cve, arg);
3605 "code":
string (
string cve,
auto arg) {
3606 return sprintf(
"%s / %s", cve, arg);
3611 "code":
string (
string cve,
auto arg) {
3612 return sprintf(
"%s * %s", cve, arg);
3618 "code":
string (*
string cve,
string arg) {
3619 throw "SEQUENCE-ERROR",
sprintf(
"cannot select sequence %y because this database does not support sequences", arg);
3624 "code":
string (*
string cve,
string arg) {
3625 throw "SEQUENCE-ERROR",
sprintf(
"cannot select the current value of sequence %y because this database does not support sequences", arg);
3630 "code":
string (*
string cve, softlist<auto> args) {
3631 return sprintf(
"coalesce(%s)", (foldl $1 +
"," + $2, args));
3667 hash<UpdateOperatorInfo>
make_uop(
string uop,
auto arg, *hash<UpdateOperatorInfo> nest);
3681 hash<UpdateOperatorInfo>
uop_prepend(
string arg, *hash<UpdateOperatorInfo> nest);
3695 hash<UpdateOperatorInfo>
uop_append(
string arg, *hash<UpdateOperatorInfo> nest);
3708 hash<UpdateOperatorInfo>
uop_upper(*hash<UpdateOperatorInfo> nest);
3721 hash<UpdateOperatorInfo>
uop_lower(*hash<UpdateOperatorInfo> nest);
3736 hash<UpdateOperatorInfo>
uop_substr(
int start, *
int count, *hash<UpdateOperatorInfo> nest);
3750 hash<UpdateOperatorInfo>
uop_plus(
auto arg, *hash<UpdateOperatorInfo> nest);
3764 hash<UpdateOperatorInfo>
uop_minus(
auto arg, *hash<UpdateOperatorInfo> nest);
3778 hash<UpdateOperatorInfo>
uop_multiply(
auto arg, *hash<UpdateOperatorInfo> nest);
3792 hash<UpdateOperatorInfo>
uop_divide(
auto arg, *hash<UpdateOperatorInfo> nest);
3805 hash<UpdateOperatorInfo>
uop_seq(
string seq);
3864 hash<string, hash<JoinOperatorInfo>>
make_jop(
string jop, AbstractTable table, *
string alias, *
hash jcols, *
hash cond, *
string ta, *hash<auto> opt);
3872 hash<string, hash<JoinOperatorInfo>>
make_jop(
string jop,
string table_name, *
string alias, *
hash jcols, *
hash cond, *
string ta, *hash<auto> opt);
3895 hash<string, hash<JoinOperatorInfo>>
join_inner(AbstractTable table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
3918 hash<string, hash<JoinOperatorInfo>>
join_inner(Table table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
3941 hash<string, hash<JoinOperatorInfo>>
join_inner(
string table_name, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
3967 hash<string, hash<JoinOperatorInfo>>
join_inner(
string ta, AbstractTable table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
3991 hash<string, hash<JoinOperatorInfo>>
join_inner(
string ta, Table table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4017 hash<string, hash<JoinOperatorInfo>>
join_inner_alias(
string ta,
string table_name, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4040 hash<string, hash<JoinOperatorInfo>>
join_left(AbstractTable table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4063 hash<string, hash<JoinOperatorInfo>>
join_left(Table table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4088 hash<string, hash<JoinOperatorInfo>>
join_left(
string table_name, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4112 hash<string, hash<JoinOperatorInfo>>
join_left(
string ta, AbstractTable table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4136 hash<string, hash<JoinOperatorInfo>>
join_left(
string ta, Table table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4162 hash<string, hash<JoinOperatorInfo>>
join_left_alias(
string ta,
string table_name, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4185 hash<string, hash<JoinOperatorInfo>>
join_right(AbstractTable table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4208 hash<string, hash<JoinOperatorInfo>>
join_right(Table table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4233 hash<string, hash<JoinOperatorInfo>>
join_right(
string table_name, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4257 hash<string, hash<JoinOperatorInfo>>
join_right(
string ta, AbstractTable table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4281 hash<string, hash<JoinOperatorInfo>>
join_right(
string ta, Table table, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4307 hash<string, hash<JoinOperatorInfo>>
join_right_alias(
string ta,
string table_name, *
string alias, *
hash jcols, *
hash cond, *hash<auto> opt);
4413 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4415 return sprintf(
"%s like %v", cn);
4419 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4421 return sprintf(
"%s < %v", cn);
4425 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4427 return sprintf(
"%s <= %v", cn);
4431 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4433 return sprintf(
"%s > %v", cn);
4437 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4439 return sprintf(
"%s >= %v", cn);
4443 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4445 return sprintf(
"%s is not null", cn);
4447 return sprintf(
"(%s != %v or %s is null)", cn, cn);
4451 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4453 return sprintf(
"%s is null", cn);
4455 return sprintf(
"%s = %v", cn);
4459 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4462 return sprintf(
"%s between %v and %v", cn);
4466 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4467 *
string ins = (foldl $1 +
"," + $2, (map t.getSqlValue($1), arg));
4468 return exists ins ?
sprintf(
"%s in (%s)", cn, ins) :
"1 != 1";
4472 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch, *hash<auto> opt) {
4476 subtable = arg.table;
4480 string subsql = subtable.getSelectSql(arg.select_hash, \subargs);
4482 return sprintf(
"%s in (%s)", cn, subsql);
4488 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4489 return sprintf(
"not (%s)", cn);
4494 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4495 return sprintf(
"%s < %s", cn, arg);
4500 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4501 return sprintf(
"%s <= %s", cn, arg);
4506 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4507 return sprintf(
"%s > %s", cn, arg);
4512 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4513 return sprintf(
"%s >= %s", cn, arg);
4518 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4519 return sprintf(
"%s != %s", cn, arg);
4524 "code":
string (
object t,
string cn,
string arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4525 return sprintf(
"%s = %s", cn, arg);
4529 "code":
string (
object t,
string cn,
auto arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4535 return sprintf(
"substring(%s from %v for %v) = %v", cn);
4539 "code":
string (
object t,
string cn, list<auto> arg, reference<list<auto>> args, *hash<auto> jch,
bool join =
False, *hash<auto> ch, *hash<auto> psch) {
4540 return t.getOrClause(arg, \args, jch,
join, ch, psch);
4569 hash<OperatorInfo>
make_op(
string op,
auto arg);
4583 hash<OperatorInfo>
op_like(
string str);
4598 hash<OperatorInfo>
op_lt(
auto arg);
4613 hash<OperatorInfo>
op_le(
auto arg);
4628 hash<OperatorInfo>
op_gt(
auto arg);
4643 hash<OperatorInfo>
op_ge(
auto arg);
4660 hash<OperatorInfo>
op_ne(
auto arg);
4677 hash<OperatorInfo>
op_eq(
auto arg);
4693 hash<OperatorInfo>
op_between(
auto l,
auto r);
4706 hash<OperatorInfo>
op_in();
4717 hash<OperatorInfo>
op_in_select(
string table, hash<auto> select_hash);
4728 hash<OperatorInfo>
op_in_select(AbstractTable table, hash<auto> select_hash);
4739 hash<OperatorInfo>
op_in_select(Table table, hash<auto> select_hash);
4754 hash<OperatorInfo>
op_in(list<auto> args);
4780 hash<OperatorInfo>
op_clt(
string arg);
4795 hash<OperatorInfo>
op_cle(
string arg);
4810 hash<OperatorInfo>
op_cgt(
string arg);
4825 hash<OperatorInfo>
op_cge(
string arg);
4840 hash<OperatorInfo>
op_cne(
string arg);
4855 hash<OperatorInfo>
op_ceq(
string arg);
4870 hash<OperatorInfo>
op_substr(
int start, *
int count,
string text);
4884 hash<OperatorInfo>
op_substr(
int start,
string text);
4942 hash<InsertOperatorInfo>
make_iop(
string iop,
auto arg);
4955 hash<InsertOperatorInfo>
iop_seq(
string arg);
4996 AbstractDatasource sqlutil_get_ds(
string type,
string config);
5000 hash<auto> sqlutil_ds(AbstractDatasource ds);
5057 abstract auto take(
string k);
5060 renameKey(
string old_name,
string new_name);
5166 list<string>
keys();
5311 abstract auto get(softint i);
5410 populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
5497 bool tableRenamed(
string old_name,
string new_name,
string old_sql_name);
5501 tableRenamedIntern(
string old_name,
string new_name,
string oldsn);
5524 list<auto> getCreateList();
5554 getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
5669 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string c)
5762 constructor(softint n_scale = 0);
5774 constructor(*
hash c) ;
5848 abstract string getCreateSql(
string table_name, *hash<auto> opt);
5866 abstract string getRenameSql(
string table_name,
string new_name);
5881 list<auto>
getRecreateSql(AbstractDatasource ds,
string table_name, *hash<auto> opt);
5889 constructor(*
hash c) ;
5952 abstract string getCreateSql(
string table_name, *hash<auto> opt);
5959 abstract list<auto>
getRenameSql(
string table_name,
string new_name);
5966 string getEnableSql(
string table_name, *hash<auto> opt);
6097 abstract string getCreateSql(
string table_name, *hash<auto> opts);
6116 constructor(
string n, *
hash c) ;
6124 constructor(*
hash c) ;
6236 abstract softlist<auto>
getRenameSql(
string new_name, *hash<auto> opt);
6272 abstract softlist<auto>
getRenameSql(
string new_name, *hash<auto> opt);
6293 constructor(
string n,
string n_type,
string n_src);
6329 constructor(
string n,
string n_type,
string n_src) ;
6339 abstract softlist<auto>
getRenameSql(
string new_name, *hash<auto> opt);
6350 constructor(*
hash c) ;
6393 abstract list<auto>
getCreateSql(
string table_name, *hash<auto> opt);
6396 abstract softlist<auto>
getRenameSql(
string table_name,
string new_name);
6399 abstract list<auto>
getDropSql(
string table_name);
6406 constructor(*
hash c) ;
string getElementName()
must return the name of the contained element
const COP_COUNT
to return the row count
Definition: SqlUtil.qm.dox.h:2347
hash< OperatorInfo > op_cge(string arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
const SqlUtilDrivers
known drivers
Definition: SqlUtil.qm.dox.h:4973
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4378
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2156
const COP_MINUS
the SQL "minus" operator
Definition: SqlUtil.qm.dox.h:2357
hash< ColumnOperatorInfo > cop_divide(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "/" operator with the given arguments
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< 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 ...
string getType()
returns the type of object
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition: SqlUtil.qm.dox.h:2277
AbstractFunction memberGate(string k)
returns the AbstractFunction object corresponding to the key given or throws a KEY-ERROR exception
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the sequence from the database
const IOP_SEQ
for using the value of a sequence
Definition: SqlUtil.qm.dox.h:4918
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
softint scale
for numeric data types, this value gives the scale
Definition: SqlUtil.qm.dox.h:2131
const COP_YEAR
to return a date value with year information only
Definition: SqlUtil.qm.dox.h:2377
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition: SqlUtil.qm.dox.h:2251
list< string > keys()
Returns a list of key names of the contained hash.
const CHAR
specifies a CHAR column
Definition: SqlUtil.qm.dox.h:2254
const COP_DENSE_RANK
Analytic (window) function: DENSE_RANK.
Definition: SqlUtil.qm.dox.h:2442
*string firstKey()
Returns the first key name in the contained hash or NOTHING if the contained hash has no keys.
Qore::AbstractIterator iterator()
Returns a HashIterator object for the contained hash.
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_max)
creates the object from the arguments
abstract string getElementName()
must return the name of the contained element
AbstractColumn take(string k)
removes the given key from the contained hash and returns the value
list< auto > getDropList()
returns a list of cached table names in the order that can be used to drop the tables,...
const COP_UPPER
to return column value in upper case
Definition: SqlUtil.qm.dox.h:2312
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
abstract list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that can be used to create the function in the database
hash< OperatorInfo > op_in()
returns an OperatorInfo hash for the "in" operator with all arguments passed to the function; for use...
const OP_CNE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4373
const DB_SEQUENCES
Feature: sequences.
Definition: SqlUtil.qm.dox.h:2232
base class for sequences
Definition: SqlUtil.qm.dox.h:6204
hash< OperatorInfo > op_like(string str)
returns an OperatorInfo hash for the "like" operator with the given argument for use in where clauses
string getName()
returns the index name
const COP_YEAR_MONTH
to return a date value with year to month information
Definition: SqlUtil.qm.dox.h:2382
clearIndex()
clears any index base for the constraint
hash< ColumnOperatorInfo > cop_row_number()
Analytic/window function: number of the current row within its partition, counting from 1.
hash< InsertOperatorInfo > iop_seq(string arg)
returns an InsertOperatorInfo hash for retrieving the value of the given sequence in insert queries
Columns subset(softlist l)
returns a subset of the current columns according to the list<auto> argument
const DT_MONTH
Format unit: month.
Definition: SqlUtil.qm.dox.h:3563
addSourceConstraint(string tname, AbstractForeignConstraint fk)
adds a foreign constraint source to the unique constraint
hash< ColumnOperatorInfo > cop_length(auto column)
returns a ColumnOperatorInfo hash for the "len" operator with the given argument; returns the length ...
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2149
string getName()
returns the constraint name
the base class for triggers
Definition: SqlUtil.qm.dox.h:6385
string getElementName()
must return the name of the contained element
const SZ_OPT
the data type takes an optional size parameter
Definition: SqlUtil.qm.dox.h:2274
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:6101
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6121
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition: SqlUtil.qm.dox.h:2484
any arg
optional argument
Definition: SqlUtil.qm.dox.h:2162
hash< UpdateOperatorInfo > uop_divide(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "/" operator with the given arguments
Qore::AbstractIterator keyIterator()
Returns a HashKeyIterator object for the contained hash.
const DT_HOUR
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3569
bool equal(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
bool partialMatchKeys(hash h1)
returns True if the hash argument has at least the same keys (in any order, can have more keys),...
string name
the name of the constraint
Definition: SqlUtil.qm.dox.h:5935
const DefaultCopMap
a hash of default column operator descriptions
Definition: SqlUtil.qm.dox.h:2487
hash< OperatorInfo > op_cle(string arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
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< InsertOperatorInfo > iop_seq_currval(string arg)
returns an InsertOperatorInfo hash for retrieving the current value of the given sequence in insert q...
const OP_NE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4343
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 ...
hash< ColumnOperatorInfo > cop_rank()
Analytic/window function: rank of the current row with gaps.
add(string k, AbstractTrigger val)
adds the given value to the hash with the given key name
auto memberGate(string k)
returns the value of the given key in the contained hash if it exists, otherwise throws a KEY-ERROR e...
*string comment
an optional comment for the column
Definition: SqlUtil.qm.dox.h:2137
a class describing a foreign constraint target
Definition: SqlUtil.qm.dox.h:6168
Columns columns
an object of class Columns representing the columns in the index
Definition: SqlUtil.qm.dox.h:5827
const COP_LENGTH
to get the length of a text field
Definition: SqlUtil.qm.dox.h:2419
*number max
the ending number
Definition: SqlUtil.qm.dox.h:6217
const COP_OVER
the SQL "over" clause
Definition: SqlUtil.qm.dox.h:2352
list< auto > args
the arguments for the string
Definition: SqlUtil.qm.dox.h:2214
insert operator info hash as returned by all insert operator functions
Definition: SqlUtil.qm.dox.h:2160
*string qore_type
the equivalent qore type name of the column if known
Definition: SqlUtil.qm.dox.h:5649
AbstractForeignConstraint take(string k)
removes the given key from the contained hash and returns the value
hash< OperatorInfo > op_ne(auto arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
string native_type
the native database column type; if both native_type and qore_type are given then native_type is used
Definition: SqlUtil.qm.dox.h:2127
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition: SqlUtil.qm.dox.h:2129
string sql
the SQL string for the update
Definition: SqlUtil.qm.dox.h:2211
const COP_LAST_VALUE
Analytic (window) function: LAST_VALUE.
Definition: SqlUtil.qm.dox.h:2456
string string(softstring str, *string enc)
AbstractIndex take(string k)
removes the given key from the contained hash and returns the value
*string ta
optional table name or alias of the other table to join with when not joining with the primary table
Definition: SqlUtil.qm.dox.h:2179
hash< ColumnOperatorInfo > cop_coalesce(auto col1, auto col2)
returns a ColumnOperatorInfo hash for the "coalesce" operator with the given column arguments; the fi...
update operator info hash as returned by all update operator functions
Definition: SqlUtil.qm.dox.h:2166
base class for functions
Definition: SqlUtil.qm.dox.h:6321
abstract bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
hash< ColumnOperatorInfo > cop_dense_rank()
Analytic/window function: rank of the current row without gaps.
const DB_PACKAGES
Feature: packages.
Definition: SqlUtil.qm.dox.h:2228
bool equalImpl(AbstractConstraint con)
returns True if the argument is equal to the current object, False if not
hash< ColumnOperatorInfo > cop_upper(auto column)
returns a ColumnOperatorInfo hash for the "upper" operator with the given argument; returns a column ...
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
const JOP_LEFT
for left outer joins
Definition: SqlUtil.qm.dox.h:3836
hash< UpdateOperatorInfo > uop_append(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "append" or concatenate operator with the given argument
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition: SqlUtil.qm.dox.h:2257
bool nullable
True if the column can hold a NULL value, False if not
Definition: SqlUtil.qm.dox.h:5655
hash< InsertOperatorInfo > make_iop(string iop, auto arg)
returns an InsertOperatorInfo hash
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4338
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4333
string getElementName()
must return the name of the contained element
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...
string qore_type
a qore type string that will be converted to a native DB type with some default conversion
Definition: SqlUtil.qm.dox.h:2125
string getNormalizedSource(string src)
returns normalized source for comparisons
const OP_BETWEEN
the SQL "between" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4383
hash< ColumnOperatorInfo > cop_percent_rank()
Analytic/window function: relative rank of the current row.
const COP_TRUNC_DATE
to return the date with truncated value
Definition: SqlUtil.qm.dox.h:2428
const JOP_INNER
for standard inner joins
Definition: SqlUtil.qm.dox.h:3831
*string index
the index supporting the constraint
Definition: SqlUtil.qm.dox.h:6024
hash< UpdateOperatorInfo > uop_minus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "-" operator with the given arguments
AbstractFunction take(string k)
removes the given key from the contained hash and returns the value
const COP_NTILE
Analytic (window) function: NTILE.
Definition: SqlUtil.qm.dox.h:2463
const OP_NOT
the SQL "not" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4393
the base class to use to extend AbstractColumn to implement numeric columns
Definition: SqlUtil.qm.dox.h:5756
bool val()
Returns False if the contained hash has no keys, True if it does.
bool equal(ForeignConstraintTarget targ)
returns True if the argument is equal to the current object, False if not
function container class that throws an exception if an unknown function is accessed
Definition: SqlUtil.qm.dox.h:6347
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition: SqlUtil.qm.dox.h:5831
string getDropSql(string table_name)
returns a string that can be used to drop the index from the database
ForeignConstraintTarget target
a ForeignConstraintTarget object to describe the target table and columns
Definition: SqlUtil.qm.dox.h:6191
hash< ColumnOperatorInfo > cop_minus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "-" operator with the given arguments
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:6187
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
auto column
column sopecifier, may be a string or a complex hash
Definition: SqlUtil.qm.dox.h:2155
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition: SqlUtil.qm.dox.h:2195
const COP_APPEND
to append a string to a column on output
Definition: SqlUtil.qm.dox.h:2302
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...
bool default_value_native
a boolean flag to say if a default_value should be validated against table column type (False) or use...
Definition: SqlUtil.qm.dox.h:2135
string jop
the join operator string code
Definition: SqlUtil.qm.dox.h:2174
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...
const DT_DAY
Format unit: day.
Definition: SqlUtil.qm.dox.h:3566
clear()
purges the contained data
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the function from the database
bool empty()
returns True if the container is empty, False if not
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:50
hash< ColumnOperatorInfo > cop_sum(auto column)
returns a ColumnOperatorInfo hash for the "sum" operator; returns the total sum of a numeric column.
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition: SqlUtil.qm.dox.h:2198
hash< UpdateOperatorInfo > uop_lower(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "lower" operator with the given argument; returns a column...
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
column operator info hash as returned by all column operator functions
Definition: SqlUtil.qm.dox.h:2153
constructor()
empty constructor for subclasses
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< ColumnOperatorInfo > cop_first_value(any column)
Analytic/window function: value evaluated at the row that is the first row of the window frame.
bool unique
True if the index is a unique index, False if not
Definition: SqlUtil.qm.dox.h:5824
AbstractIndex memberGate(string k)
returns the AbstractIndex object corresponding to the key given or throws a KEY-ERROR exception
generic column description hash in schema descriptions
Definition: SqlUtil.qm.dox.h:2123
*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...
hash< ColumnOperatorInfo > cop_lower(auto column)
returns a ColumnOperatorInfo hash for the "lower" operator with the given argument; returns a column ...
bool hasColumn(string cname)
returns True if the constraint references the named column
abstract bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
const VARCHAR
specifies a VARCHAR column (equivalent to Qore::Type::String)
Definition: SqlUtil.qm.dox.h:2248
add(string k, AbstractFunction val)
adds the given value to the hash with the given key name
const COP_SEQ
to return the next value of a sequence
Definition: SqlUtil.qm.dox.h:2397
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
column data type options
Definition: SqlUtil.qm.dox.h:2184
hash< ColumnOperatorInfo > cop_ntile(int value)
Analytic/window function: integer ranging from 1 to the argument value, dividing the partition as equ...
int scale
the scale for numeric columns
Definition: SqlUtil.qm.dox.h:5760
const DefaultIopMap
a hash of default insert operator descriptions (currently empty, all operators are driver-dependent)
Definition: SqlUtil.qm.dox.h:4926
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
hash< UpdateOperatorInfo > uop_plus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "+" operator with the given arguments
int size()
Returns the number of keys in the contained hash.
const COP_MAX
to return the maximum value
Definition: SqlUtil.qm.dox.h:2332
const COP_SUBSTR
to extract a substring from a column
Definition: SqlUtil.qm.dox.h:2412
bool hasKey(string k)
Returns True if the key exists in the contained hash (may or may not be assigned a value),...
bool val()
Returns False if the contained list is empty, True if not.
const COP_DISTINCT
to return distinct values
Definition: SqlUtil.qm.dox.h:2322
hash< OperatorInfo > op_not(hash arg)
returns an OperatorInfo hash for the "not" operator; for use in where clauses
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:5285
const DB_TABLES
Feature: tables.
Definition: SqlUtil.qm.dox.h:2234
AbstractForeignConstraint memberGate(string k)
returns the AbstractForeignConstraint object corresponding to the key given or throws a KEY-ERROR exc...
A hash describing SQL and arguments for an SQL DML command.
Definition: SqlUtil.qm.dox.h:2209
abstract bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
AbstractTrigger memberGate(string k)
returns the AbstractTrigger object corresponding to the key given or throws a KEY-ERROR exception
string getElementName()
returns "column" since this object stores column objects
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...
*string alias
optional alias for table in the query
Definition: SqlUtil.qm.dox.h:2176
*AbstractIndex findEqual(AbstractIndex ix)
find an index with columns equal to the index passed
number start
the starting number
Definition: SqlUtil.qm.dox.h:6211
constructor(string n, *hash c, *string n_index)
creates the object from the name and a hash of column information
const COP_CAST
to convert column value into another datatype
Definition: SqlUtil.qm.dox.h:2292
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition: SqlUtil.qm.dox.h:2180
hash< ColumnOperatorInfo > cop_distinct(auto column)
returns a ColumnOperatorInfo hash for the "distinct" operator with the given argument; returns distin...
abstract list< auto > getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the trigger in the database
const COP_PLUS
the SQL "plus" operator
Definition: SqlUtil.qm.dox.h:2362
hash< UpdateOperatorInfo > uop_multiply(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "*" operator with the given arguments
hash< OperatorInfo > op_eq(auto arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
the base class for column information
Definition: SqlUtil.qm.dox.h:5642
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,...
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5817
add(string k, AbstractIndex val)
adds the given value to the hash with the given key name
AbstractIterator getSqlColumnNameIterator()
returns an iterator for column SQL names
*string comment
comment on the column
Definition: SqlUtil.qm.dox.h:5661
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_min(auto column)
returns a ColumnOperatorInfo hash for the "min" operator; returns minimum column values
hash< ColumnOperatorInfo > make_cop(string cop, auto column, auto arg)
returns a ColumnOperatorInfo hash
const OP_IN
the SQL "in" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4388
const COP_MULTIPLY
the SQL "multiply" operator
Definition: SqlUtil.qm.dox.h:2372
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database; if disabli...
const COP_PERCENT_RANK
Analytic (window) function: PERCENT_RANK.
Definition: SqlUtil.qm.dox.h:2470
*AbstractIndex tryTake(string k)
tries to remove the given key from the contained hash and returns the value if it exists
Qore::ListIterator iterator()
Returns a ListIterator object for the contained list.
*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(string k, AbstractConstraint val)
adds the given value to the hash with the given key name
add(string k, AbstractForeignConstraint val)
adds the given value to the hash with the given key name
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
const OP_LT
the SQL less than (<) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4323
string getNativeTypeString()
returns the string describing the native type that can be used in SQL (for example to add the colunn ...
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
string ddl_name
the name of the object for DDL (in case it's a reserved word)
Definition: SqlUtil.qm.dox.h:5623
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the index in the database
hash< ColumnOperatorInfo > cop_plus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "+" operator with the given arguments
hash< OperatorInfo > op_gt(auto arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
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...
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the constraint in the database
constructor(string n_name, string n_src)
creates the object from the arguments
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:5004
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition: SqlUtil.qm.dox.h:2178
join operator info hash as returned by all join operator functions
Definition: SqlUtil.qm.dox.h:2173
*string def_val
default value for column
Definition: SqlUtil.qm.dox.h:5658
const DT_MINUTE
Format unit: minute.
Definition: SqlUtil.qm.dox.h:3572
const DB_FUNCTIONS
Features constants.
Definition: SqlUtil.qm.dox.h:2224
*string getIndex()
returns the name of the associated index, if any
string getCreateSql(AbstractTable t)
returns an sql string that can be used to add the column to a table
string name
the name of the object
Definition: SqlUtil.qm.dox.h:6280
const DT_YEAR
Format unit: year.
Definition: SqlUtil.qm.dox.h:3560
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5990
const COP_SUM
to return the sum value
Definition: SqlUtil.qm.dox.h:2342
string src
the source code
Definition: SqlUtil.qm.dox.h:6250
*hash h
the data to be contained
Definition: SqlUtil.qm.dox.h:5011
constructor(string n, string n_src)
creates the object and sets its name and the check clause source
string getElementName()
returns "foreign constraint" for the type of object encapsulated
const OP_CGT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4363
setSupportingConstraint()
clears the supporting constraint
abstract string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
hash< ColumnOperatorInfo > cop_year_hour(auto column)
returns a ColumnOperatorInfo hash for the "year_hour" operator with the given argument
string op
the operator string code
Definition: SqlUtil.qm.dox.h:2148
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
constructor(string n, bool u, hash c)
creates the object from the name, a unique flag, and a hash of column information
*hash findConstraintOn(string table, softlist cols)
returns either a hash of AbstractColumn information or NOTHING if no foreign constraint can be found ...
findMatchingIndex(*Indexes indexes)
find an index that matches the constraint and marks both objects as related
*hash jcols
the columns to use for the join, the keys will be columns in the source table and the values are colu...
Definition: SqlUtil.qm.dox.h:2177
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition: SqlUtil.qm.dox.h:2392
base class for function or objects with code
Definition: SqlUtil.qm.dox.h:6276
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition: SqlUtil.qm.dox.h:2175
abstract string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
hash< ColumnOperatorInfo > cop_year_month(auto column)
returns a ColumnOperatorInfo hash for the "year_month" operator with the given argument
string uop
the update operator string code
Definition: SqlUtil.qm.dox.h:2167
hash< ColumnOperatorInfo > cop_avg(auto column)
returns a ColumnOperatorInfo hash for the "avg" operator; returns average column values
rename(string n)
renames the constraint
const COP_YEAR_DAY
to return a date value with year to day information
Definition: SqlUtil.qm.dox.h:2387
const DefaultOpMap
a hash of valid operators for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4411
hash< ColumnOperatorInfo > cop_multiply(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "*" operator with the given arguments
hash< ColumnOperatorInfo > cop_year_day(auto column)
returns a ColumnOperatorInfo hash for the "year_day" operator with the given argument
abstract auto get(softint i)
returns the value of the given element in the contained list if it exists, otherwise throws an ELEMEN...
const COP_LOWER
to return column value in lower case
Definition: SqlUtil.qm.dox.h:2317
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition: SqlUtil.qm.dox.h:2189
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...
copy(AbstractHashContainer old)
creates a "deep copy" of the object
const DB_TYPES
Feature: named types.
Definition: SqlUtil.qm.dox.h:2236
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5560
AbstractConstraint take(string k)
removes the given key from the contained hash and returns the value
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:5771
const COP_SEQ_CURRVAL
to return the last value of a sequence issued in the same session
Definition: SqlUtil.qm.dox.h:2402
hash< OperatorInfo > op_le(auto arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:36
list< auto > getList()
returns the list contained by this object
hash< ColumnOperatorInfo > cop_append(auto column, string arg)
returns a ColumnOperatorInfo hash for the "append" operator with the given argument
number increment
the increment
Definition: SqlUtil.qm.dox.h:6214
const SZ_MAND
the data type takes a mandatory size parameter
Definition: SqlUtil.qm.dox.h:2271
const COP_PREPEND
to prepend a string to a column on output
Definition: SqlUtil.qm.dox.h:2297
removeSourceConstraint(string tname, list cols)
removes a source constraint
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< ColumnOperatorInfo > cop_prepend(auto column, string arg)
returns a ColumnOperatorInfo hash for the "prepend" operator with the given argument
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2168
sqlutil_register_ds_deserializer(*code new_ds_get)
registers a closure or call reference taking a string type and string datasource configuration that w...
bool notnull
if the column should have a "not null" constraint on it; if missing the default value is False
Definition: SqlUtil.qm.dox.h:2139
string _iop
the insert operator string code
Definition: SqlUtil.qm.dox.h:2161
constructor(string n)
creates the object and sets its name
Qore::AbstractIterator dropIterator()
returns an iterator for a list of cached table names in the order that can be used to drop the tables...
hash< auto > hash(object obj)
const DB_VIEWS
Feature: views.
Definition: SqlUtil.qm.dox.h:2238
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:6016
bool tableRenamed(string old_name, string new_name, string old_sql_name)
updates table names and internal references for renamed tables
bool updatable
Flag showing if is the view updatable with DML commands.
Definition: SqlUtil.qm.dox.h:6253
*hash sourceConstraints
a hash of ForeignConstraintSources, keyed by table name, the value is a hash of foreign constraints k...
Definition: SqlUtil.qm.dox.h:6021
string table
the name of the target table
Definition: SqlUtil.qm.dox.h:6172
renameKey(string old_name, string new_name)
renames the given key; maintains the key order
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:6403
string sprintf(string fmt,...)
hash< UpdateOperatorInfo > uop_prepend(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "prepend" operator with the given argument
const DefaultUopMap
a hash of valid update operators
Definition: SqlUtil.qm.dox.h:3586
*AbstractForeignConstraint findEqual(AbstractForeignConstraint fk)
find an index with columns equal to the index passed
Qore::AbstractIterator pairIterator()
Returns a HashPairIterator object for the contained hash.
hash< ColumnOperatorInfo > cop_year(auto column)
returns a ColumnOperatorInfo hash for the "year" operator with the given argument
hash< ColumnOperatorInfo > cop_as(auto column, string arg)
returns a ColumnOperatorInfo hash for the "as" operator with the given argument
abstract string getElementName()
must return the name of the contained element
sqlutil_register_ds_serializer(*code new_ds_do)
registers a closure or call reference taking a string type and string datasource configuration that w...
constructor(string t, Columns c)
creates the object and sets the target table name and the target columns
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the sequence in the database
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the view from the database
string native_type
the native type name of the column
Definition: SqlUtil.qm.dox.h:5646
const DB_PROCEDURES
Feature: procedures.
Definition: SqlUtil.qm.dox.h:2230
string join(string str,...)
abstract list< auto > getDropSql(string table_name)
returns a string that can be used to drop the trigger in the database
const COP_DIVIDE
the SQL "divide" operator
Definition: SqlUtil.qm.dox.h:2367
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4358
hash< UpdateOperatorInfo > uop_seq_currval(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
string getElementName()
returns "table" since this object stores AbstractTable objects
list< auto > values()
Returns a list of values of the contained hash.
abstract list< auto > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
int size()
Returns the number of elements in the contained list.
const OP_LE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4328
abstract string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition: SqlUtil.qm.dox.h:2186
base class for views
Definition: SqlUtil.qm.dox.h:6240
hash< ColumnOperatorInfo > cop_over(auto column, *string partitionby, *string orderby)
returns a ColumnOperatorInfo hash for the "over" clause
bool hasColumn(string cname)
returns True if the constraint references the named column
represents a primary key
Definition: SqlUtil.qm.dox.h:6110
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4368
const JopMap
a hash of valid join operators
Definition: SqlUtil.qm.dox.h:3844
hash< OperatorInfo > op_cgt(string arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4403
const IOP_SEQ_CURRVAL
for using the last value of a sequence issued in the current session
Definition: SqlUtil.qm.dox.h:4923
*softint maxlen
optional additional limit to the maximum length of the data
Definition: SqlUtil.qm.dox.h:2203
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition: SqlUtil.qm.dox.h:2435
clearIndex()
clears any index base for the constraint
const COP_MIN
to return the minimum value
Definition: SqlUtil.qm.dox.h:2327
bool equal(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
abstract clearIndex()
clears any index base for the constraint
const OP_SUBSTR
the SQL "substr" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4398
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the view in the database
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 ...
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 ...
bool hasKeyValue(string k)
Returns True if the key exists in the contained hash and is assigned a value, False if not.
string getElementName()
must return the name of the contained element
AbstractTable memberGate(string k)
returns the AbstractTable object corresponding to the key given or throws a KEY-ERROR exception
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition: SqlUtil.qm.dox.h:2192
hash< ColumnOperatorInfo > cop_value(auto arg)
returns a ColumnOperatorInfo hash for the "value" (literal) operator with the given argument
the base class for named objects
Definition: SqlUtil.qm.dox.h:5616
constructor(*hash nh)
creates the object with the hash argument passed
bool empty()
returns True if the container is empty, False if not
string src
the source of the check clause
Definition: SqlUtil.qm.dox.h:5994
auto take(int i)
removes the given element from the contained list and returns the value
*hash< auto > getHash()
returns the hash contained by this object
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5886
AbstractColumn memberGate(string k)
returns the AbstractColumn object corresponding to the key given or throws a KEY-ERROR exception
hash< UpdateOperatorInfo > make_uop(string uop, auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash
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)
AbstractTable take(string k)
removes the given key from the contained hash and returns the value
abstract bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
AbstractConstraint memberGate(string k)
returns the AbstractConstraint object corresponding to the key given or throws a KEY-ERROR exception
hash< OperatorInfo > op_cne(string arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
hash< ColumnOperatorInfo > cop_max(auto column)
returns a ColumnOperatorInfo hash for the "max" operator; returns maximum column values
Columns columns
columns in the target table
Definition: SqlUtil.qm.dox.h:6175
int size
the size of the column
Definition: SqlUtil.qm.dox.h:5652
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:32
string type
the type of object
Definition: SqlUtil.qm.dox.h:6283
abstract string getCreateSql(string table_name, *hash< auto > opts)
returns a string that can be used to create the constraint in the database
abstract auto take(string k)
removes the given key from the contained hash and returns the value
hash< OperatorInfo > op_between(auto l, auto r)
returns an OperatorInfo hash for the "between" operator with the given arguments, neither of which ca...
*AbstractColumnSupportingConstraint getSupportingConstraint()
returns the supporting constraint, if any
const COP_AS
to rename a column on output
Definition: SqlUtil.qm.dox.h:2287
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_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition: SqlUtil.qm.dox.h:2307
*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,...
AbstractTable get(AbstractDatasource ds, string name)
gets a table from the database or from the cache if already cached
renameSourceConstraintTable(string old_name, string new_name)
renames a table in a source constraint
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5374
hash< ColumnOperatorInfo > cop_count(auto column='')
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts
*bool auto_increment
True for DBs that support an auto-increment column
Definition: SqlUtil.qm.dox.h:2143
bool equal(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
constructor(string n, *hash c, *string n_index)
creates the object from the name an a hash of column information
const COP_COALESCE
to return the first non-null argument in the list
Definition: SqlUtil.qm.dox.h:2407
hash< ColumnOperatorInfo > cop_last_value(any column)
Analytic/window function: value evaluated at the row that is the last row of the window frame.
bool equal(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
string name
the name of the index
Definition: SqlUtil.qm.dox.h:5821
*string lastKey()
Returns the last key name in the contained hash or NOTHING if the contained hash has no keys.
hash< OperatorInfo > op_ceq(string arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
const JOP_RIGHT
for right outer joins
Definition: SqlUtil.qm.dox.h:3841
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6247
setName(string new_name)
sets the new name of the object
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...
abstract softlist< auto > getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
constructor(*hash c)
creates the object from the argument
AbstractTrigger take(string k)
removes the given key from the contained hash and returns the value
hash< ColumnOperatorInfo > cop_seq_currval(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq_currval" operator with the given argument giving the s...
number number(softnumber n)
const OP_LIKE
the SQL "like" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4318
hash< UpdateOperatorInfo > uop_upper(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "upper" operator with the given argument; returns a column...
constructor(softlist nl)
creates the object with the list<auto> argument passed
hash< string, hash > driver
this key can optionally contain a hash keyed by driver name which contains a hash of values that will...
Definition: SqlUtil.qm.dox.h:2141
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition: SqlUtil.qm.dox.h:4353
Qore::AbstractIterator getSourceConstraintIterator()
returns an iterator through all known source foreign constraints on the current table
string name
the name of the object
Definition: SqlUtil.qm.dox.h:5620
hash< OperatorInfo > make_op(string op, auto arg)
returns an OperatorInfo hash
add(string k, Table val)
adds the given value to the hash with the given key name
constructor()
empty constructor for subclasses
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
const CLOB
specifies a large variable-length character column (ie CLOB or TEXT, etc)
Definition: SqlUtil.qm.dox.h:2260
string cop
the column operator string code
Definition: SqlUtil.qm.dox.h:2154
constructor()
creates an empty object
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 COP_RANK
Analytic (window) function: RANK.
Definition: SqlUtil.qm.dox.h:2477
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence ...
string getDropSql(string table_name)
returns a string that can be used to drop the column from the table
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
SQL operator info hash as returned by all operator functions.
Definition: SqlUtil.qm.dox.h:2147
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...
hash< OperatorInfo > op_lt(auto arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5928
const DB_MVIEWS
Feature: materialized views / snapshots.
Definition: SqlUtil.qm.dox.h:2226
string src
the source of the object
Definition: SqlUtil.qm.dox.h:6286
hash< UpdateOperatorInfo > uop_seq(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
abstract bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
bool equal(Columns cols)
returns True if the argument has the same columns in the same order as the current object,...
populate(AbstractDatasource ds, hash< auto > tables, *hash< auto > opt)
populates the object from a hash<auto> description
const DT_SECOND
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3575
add(string k, AbstractColumn val)
adds the given value to the hash with the given key name
const COP_AVG
to return the average value
Definition: SqlUtil.qm.dox.h:2337
*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...
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition: SqlUtil.qm.dox.h:2449
add(auto val)
adds the given value to the list
bool matchKeys(hash h1)
returns True if the hash argument has the same keys (in any order), False if not
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4348
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6208
*hash nest
option nested operation hash
Definition: SqlUtil.qm.dox.h:2169
auto default_value
the default value for the column
Definition: SqlUtil.qm.dox.h:2133
const SZ_NONE
the data type does not take a size parameter
Definition: SqlUtil.qm.dox.h:2268
const DB_SYNONYMS
Feature: synonyms.
Definition: SqlUtil.qm.dox.h:2240
*AbstractUniqueConstraint findEqualUniqueConstraint(AbstractUniqueConstraint uk)
finds a unique constraint with the same columns as the unique constraint passed
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4408