2776 hash<ColumnOperatorInfo>
make_cop(
string cop,
auto column,
auto arg);
2792 hash<ColumnOperatorInfo>
cop_as(
auto column,
string arg);
2810 hash<ColumnOperatorInfo>
cop_cast(
auto column,
string arg,
auto arg1,
auto arg2);
3083 hash<ColumnOperatorInfo>
cop_over(
auto column, *
string partitionby, *
string orderby);
3097 hash<ColumnOperatorInfo>
cop_minus(
auto column1,
auto column2);
3111 hash<ColumnOperatorInfo>
cop_plus(
auto column1,
auto column2);
3205 hash<ColumnOperatorInfo>
cop_seq(
string seq, *
string as);
3250 hash<ColumnOperatorInfo>
cop_substr(
auto column,
int start, *
int count);
3658 hash<UpdateOperatorInfo>
make_uop(
string uop,
auto arg, *hash<UpdateOperatorInfo> nest);
3672 hash<UpdateOperatorInfo>
uop_prepend(
string arg, *hash<UpdateOperatorInfo> nest);
3686 hash<UpdateOperatorInfo>
uop_append(
string arg, *hash<UpdateOperatorInfo> nest);
3699 hash<UpdateOperatorInfo>
uop_upper(*hash<UpdateOperatorInfo> nest);
3712 hash<UpdateOperatorInfo>
uop_lower(*hash<UpdateOperatorInfo> nest);
3727 hash<UpdateOperatorInfo>
uop_substr(
int start, *
int count, *hash<UpdateOperatorInfo> nest);
3741 hash<UpdateOperatorInfo>
uop_plus(
auto arg, *hash<UpdateOperatorInfo> nest);
3755 hash<UpdateOperatorInfo>
uop_minus(
auto arg, *hash<UpdateOperatorInfo> nest);
3769 hash<UpdateOperatorInfo>
uop_multiply(
auto arg, *hash<UpdateOperatorInfo> nest);
3783 hash<UpdateOperatorInfo>
uop_divide(
auto arg, *hash<UpdateOperatorInfo> nest);
3855 hash<string, hash<JoinOperatorInfo>>
make_jop(
string jop,
AbstractTable table, *
string alias, *hash jcols, *hash cond, *
string ta, *hash<auto> opt);
3863 hash<string, hash<JoinOperatorInfo>>
make_jop(
string jop,
string table_name, *
string alias, *hash jcols, *hash cond, *
string ta, *hash<auto> opt);
3909 hash<string, hash<JoinOperatorInfo>>
join_inner(
Table table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
3932 hash<string, hash<JoinOperatorInfo>>
join_inner(
string table_name, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
3958 hash<string, hash<JoinOperatorInfo>>
join_inner(
string ta,
AbstractTable table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
3982 hash<string, hash<JoinOperatorInfo>>
join_inner(
string ta,
Table table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4008 hash<string, hash<JoinOperatorInfo>>
join_inner_alias(
string ta,
string table_name, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4031 hash<string, hash<JoinOperatorInfo>>
join_left(
AbstractTable table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4054 hash<string, hash<JoinOperatorInfo>>
join_left(
Table table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4079 hash<string, hash<JoinOperatorInfo>>
join_left(
string table_name, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4103 hash<string, hash<JoinOperatorInfo>>
join_left(
string ta,
AbstractTable table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4127 hash<string, hash<JoinOperatorInfo>>
join_left(
string ta,
Table table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4153 hash<string, hash<JoinOperatorInfo>>
join_left_alias(
string ta,
string table_name, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4199 hash<string, hash<JoinOperatorInfo>>
join_right(
Table table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4224 hash<string, hash<JoinOperatorInfo>>
join_right(
string table_name, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4248 hash<string, hash<JoinOperatorInfo>>
join_right(
string ta,
AbstractTable table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4272 hash<string, hash<JoinOperatorInfo>>
join_right(
string ta,
Table table, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4298 hash<string, hash<JoinOperatorInfo>>
join_right_alias(
string ta,
string table_name, *
string alias, *hash jcols, *hash cond, *hash<auto> opt);
4405 "exp": AbstractDataProvider::GenericExpressions{DP_OP_AND},
4406 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4408 + (foldl $1 +
" and " + $2,
4409 (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap.
"bool"), args))
4414 "exp": AbstractDataProvider::GenericExpressions{DP_OP_OR},
4415 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4417 + (foldl $1 +
" or " + $2,
4418 (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap.
"bool"), args))
4423 "exp": <DataProviderExpressionInfo>{
4424 "type": DET_Operator,
4427 "desc":
"The value to bind as the 'like' value (ex: '%some string%')",
4430 DataProviderSignatureStringType,
4431 DataProviderSignatureStringValueType,
4433 "return_type": AbstractDataProviderTypeMap.
"bool",
4435 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4436 return sprintf(
"%s like %s",
4437 info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"string"),
4438 info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"string"));
4442 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LT},
4443 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4444 return sprintf(
"%s < %s",
4445 info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any"),
4446 info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any"));
4450 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LE},
4451 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4452 return sprintf(
"%s <= %s",
4453 info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any"),
4454 info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any"));
4458 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GT},
4459 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4460 return sprintf(
"%s > %s",
4461 info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any"),
4462 info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any"));
4466 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GE},
4467 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4468 return sprintf(
"%s >= %s",
4469 info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any"),
4470 info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any"));
4474 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NE},
4475 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4476 bool null0 = (args[0] === NULL || !exists args[0]);
4477 bool null1 = (args[1] === NULL || !exists args[1]);
4478 if (null0 && null1) {
4482 return sprintf(
"%s is not null",
4483 info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any"));
4486 return sprintf(
"%s is not null",
4487 info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any"));
4489 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any");
4490 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any");
4491 return sprintf(
"%s != %s", exp0, exp1);
4495 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_EQ},
4496 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4497 bool null0 = (args[0] === NULL || !exists args[0]);
4498 bool null1 = (args[1] === NULL || !exists args[1]);
4499 if (null0 && null1) {
4503 return sprintf(
"%s is null",
4504 info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any"));
4507 return sprintf(
"%s is null",
4508 info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any"));
4510 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any");
4511 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any");
4512 return sprintf(
"%s = %s", exp0, exp1);
4516 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_BETWEEN},
4517 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4518 return sprintf(
"%s between %s and %s",
4519 info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any"),
4520 info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any"),
4521 info.table.getExpressionArg(\info, role, args[2], AbstractDataProviderTypeMap.
"any"));
4525 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_IN},
4526 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4527 string exp0 = info.table.getExpressionArg(\info, role, shift args, AbstractDataProviderTypeMap.
"any");
4528 *
string ins = (foldl $1 +
"," + $2, (map info.table.getExpressionArg(\info, role, $1,
4529 AbstractDataProviderTypeMap.
"any"), args));
4530 return exists ins ? sprintf(
"%s in (%s)", exp0, ins) :
"1 != 1";
4534 "exp": AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NOT},
4535 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4536 return sprintf(
"not (%s)", info.table.getExpressionArg(\info, role, args[0],
4537 AbstractDataProviderTypeMap.
"bool"));
4541 "exp": <DataProviderExpressionInfo>{
4542 "type": DET_Operator,
4545 "desc":
"returns a substring from a string; args: string, int start char, [int length]",
4548 DataProviderSignatureStringType,
4549 DataProviderSignatureIntValueType,
4550 DataProviderSignatureOptionalIntValueType,
4552 "return_type": AbstractDataProviderTypeMap.
"string",
4554 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4555 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"string");
4556 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"int");
4557 if (!exists args[2]) {
4558 return sprintf(
"substring(%s from %s)", exp0, exp1);
4560 return sprintf(
"substring(%s from %s for %s)", exp0, exp1,
4561 info.table.getExpressionArg(\info, role, args[2], AbstractDataProviderTypeMap.
"int"));
4565 "exp": <DataProviderExpressionInfo>{
4566 "type": DET_Operator,
4567 "label":
"in_select",
4568 "name":
"in_select",
4569 "desc":
"check if a value is in a sub-select; args: value, table name for the subselect, subselect "
4571 "symbol":
"in_select",
4573 DataProviderSignatureAnyType, # any value, expression, or field reference
4574 DataProviderSignatureStringValueType, # table name
4575 DataProviderSignatureHashValueType, # query hash
4577 "return_type": AbstractDataProviderTypeMap.
"bool",
4579 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4580 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any");
4581 object subtable = info.table.getSubtableFromString(args[1], info.query_options);
4583 string subsql = subtable.getSelectSql(args[2], \subargs);
4585 return sprintf(
"%s in (%s)", exp0, subsql);
4589 "exp": <DataProviderExpressionInfo>{
4590 "type": DET_Operator,
4593 "desc":
"aliases a result; args: expression or value, string label",
4597 DataProviderSignatureAnyType,
4598 DataProviderSignatureStringValueType,
4600 "return_type": AbstractDataProviderTypeMap.
"any",
4602 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4603 string exp = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any");
4604 string arg = args[1];
4605 info.pseudo_column_map{arg} = exp;
4606 return sprintf(
"%s as %s", exp, info.table.getColumnSqlName(arg));
4610 "exp": <DataProviderExpressionInfo>{
4611 "type": DET_Operator,
4614 "desc":
"prepends a string to another string; args: string to be prepended, string to prepend to the "
4618 DataProviderSignatureStringType,
4619 DataProviderSignatureStringType,
4621 "return_type": AbstractDataProviderTypeMap.
"string",
4623 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4624 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"string");
4625 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"string");
4626 return sprintf(
"%s || %s", exp1, exp0);
4630 "exp": <DataProviderExpressionInfo>{
4631 "type": DET_Operator,
4634 "desc":
"appends or catenates a string to another string; args: string to be appended, string to "
4635 "append or concatenate to the first string",
4638 DataProviderSignatureStringType,
4639 DataProviderSignatureStringType,
4641 "return_type": AbstractDataProviderTypeMap.
"string",
4643 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4644 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"string");
4645 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"string");
4646 return sprintf(
"%s || %s", exp0, exp1);
4650 "exp": <DataProviderExpressionInfo>{
4651 "type": DET_Operator,
4654 "desc":
"converts a string to all upper case; arg: string",
4657 DataProviderSignatureStringType,
4659 "return_type": AbstractDataProviderTypeMap.
"string",
4661 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4662 return sprintf(
"upper(%s)", info.table.getExpressionArg(\info, role, args[0],
4663 AbstractDataProviderTypeMap.
"string"));
4667 "exp": <DataProviderExpressionInfo>{
4668 "type": DET_Operator,
4671 "desc":
"converts a string to all lower case; arg: string",
4674 DataProviderSignatureStringType,
4676 "return_type": AbstractDataProviderTypeMap.
"string",
4678 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4679 return sprintf(
"lower(%s)", info.table.getExpressionArg(\info, role, args[0],
4680 AbstractDataProviderTypeMap.
"string"));
4684 "exp": <DataProviderExpressionInfo>{
4685 "type": DET_Operator,
4688 "desc":
"indicates that only records with distinct values of the given field should be returned",
4692 DataProviderSignatureAnyType,
4694 "return_type": AbstractDataProviderTypeMap.
"any",
4696 "code":
string sub (reference<hash<QueryInfo>> info,
int role, *list<auto> args) {
4697 return sprintf(
"distinct %s", info.table.getExpressionArg(\info, role, args[0],
4698 AbstractDataProviderTypeMap.
"any"));
4702 "exp": <DataProviderExpressionInfo>{
4703 "type": DET_Operator,
4706 "desc":
"Returns the minimum value in the group",
4710 DataProviderSignatureAnyType,
4712 "return_type": AbstractDataProviderTypeMap.
"any",
4714 "code":
string sub (reference<hash<QueryInfo>> info,
int role, *list<auto> args) {
4715 return sprintf(
"min(%s)", info.table.getExpressionArg(\info, role, args[0],
4716 AbstractDataProviderTypeMap.
"any"));
4721 "exp": <DataProviderExpressionInfo>{
4722 "type": DET_Operator,
4725 "desc":
"Returns the maximum value in the group",
4729 DataProviderSignatureAnyType,
4731 "return_type": AbstractDataProviderTypeMap.
"any",
4733 "code":
string sub (reference<hash<QueryInfo>> info,
int role, *list<auto> args) {
4734 return sprintf(
"max(%s)", info.table.getExpressionArg(\info, role, args[0],
4735 AbstractDataProviderTypeMap.
"any"));
4740 "exp": <DataProviderExpressionInfo>{
4741 "type": DET_Operator,
4744 "desc":
"Returns the average of the given values in the group",
4748 DataProviderSignatureAnyType,
4750 "return_type": AbstractDataProviderTypeMap.
"any",
4752 "code":
string sub (reference<hash<QueryInfo>> info,
int role, *list<auto> args) {
4753 return sprintf(
"avg(%s)", info.table.getExpressionArg(\info, role, args[0],
4754 AbstractDataProviderTypeMap.
"any"));
4759 "exp": <DataProviderExpressionInfo>{
4760 "type": DET_Operator,
4763 "desc":
"Returns the sum of the given values",
4767 DataProviderSignatureAnyType,
4769 "return_type": AbstractDataProviderTypeMap.
"any",
4771 "code":
string sub (reference<hash<QueryInfo>> info,
int role, *list<auto> args) {
4772 return sprintf(
"sum(%s)", info.table.getExpressionArg(\info, role, args[0],
4773 AbstractDataProviderTypeMap.
"any"));
4778 "exp": <DataProviderExpressionInfo>{
4779 "type": DET_Operator,
4782 "desc":
"Count the number of rows in the group",
4786 DataProviderSignatureAnyType,
4788 "return_type": AbstractDataProviderTypeMap.
"int",
4790 "code":
string sub (reference<hash<QueryInfo>> info,
int role, *list<auto> args) {
4791 if (exists args[0] && args[0] != NULL) {
4792 return sprintf(
"count(%s)", info.table.getExpressionArg(\info, role, args[0],
4793 AbstractDataProviderTypeMap.
"any"));
4799 "exp": <DataProviderExpressionInfo>{
4800 "type": DET_Operator,
4803 "desc":
"Subtracts one number from another",
4806 DataProviderSignatureAnyType,
4807 DataProviderSignatureAnyType,
4809 "return_type": AbstractDataProviderTypeMap.
"any",
4811 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4812 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any");
4813 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any");
4814 return sprintf(
"%s - %s", exp0, exp1);
4818 "exp": <DataProviderExpressionInfo>{
4819 "type": DET_Operator,
4822 "desc":
"Adds two numbers",
4825 DataProviderSignatureAnyType,
4826 DataProviderSignatureAnyType,
4828 "return_type": AbstractDataProviderTypeMap.
"any",
4830 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4831 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any");
4832 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any");
4833 return sprintf(
"%s + %s", exp0, exp1);
4837 "exp": <DataProviderExpressionInfo>{
4838 "type": DET_Operator,
4841 "desc":
"Divides one number by another",
4844 DataProviderSignatureAnyType,
4845 DataProviderSignatureAnyType,
4847 "return_type": AbstractDataProviderTypeMap.
"any",
4849 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4850 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any");
4851 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any");
4852 return sprintf(
"%s / %s", exp0, exp1);
4856 "exp": <DataProviderExpressionInfo>{
4857 "type": DET_Operator,
4860 "desc":
"Multiplies two numbers",
4863 DataProviderSignatureAnyType,
4864 DataProviderSignatureAnyType,
4866 "return_type": AbstractDataProviderTypeMap.
"any",
4868 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4869 string exp0 = info.table.getExpressionArg(\info, role, args[0], AbstractDataProviderTypeMap.
"any");
4870 string exp1 = info.table.getExpressionArg(\info, role, args[1], AbstractDataProviderTypeMap.
"any");
4871 return sprintf(
"%s * %s", exp0, exp1);
4875 "exp": <DataProviderExpressionInfo>{
4876 "type": DET_Operator,
4879 "desc":
"Returns the value of the first expression with a value",
4882 DataProviderSignatureAnyType,
4885 "return_type": AbstractDataProviderTypeMap.
"any",
4887 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4888 return sprintf(
"coalesce(%s)", (foldl $1 +
"," + $2,
4889 (map info.table.getExpressionArg(\info, role, $1, AbstractDataProviderTypeMap.
"any"), args)));
4893 "exp": <DataProviderExpressionInfo>{
4894 "type": DET_Operator,
4897 "desc":
"Returns the length of the argument",
4900 DataProviderSignatureAnyType,
4902 "return_type": AbstractDataProviderTypeMap.
"int",
4904 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4905 return sprintf(
"length(%s)", info.table.getExpressionArg(\info, role, args[0],
4906 AbstractDataProviderTypeMap.
"any"));
4910 "exp": <DataProviderExpressionInfo>{
4911 "type": DET_Operator,
4914 "desc":
"returns the next value in the given sequence; args: sequence name",
4917 DataProviderSignatureStringValueType,
4919 "return_type": AbstractDataProviderTypeMap.
"int",
4921 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4922 throw "SEQUENCE-ERROR", sprintf(
"cannot select sequence %y because this database does not support "
4923 "sequences", args[0]);
4927 "exp": <DataProviderExpressionInfo>{
4928 "type": DET_Operator,
4931 "desc":
"returns the current value in the given sequence; args: sequence name",
4934 DataProviderSignatureStringValueType,
4936 "return_type": AbstractDataProviderTypeMap.
"int",
4938 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4939 throw "SEQUENCE-ERROR", sprintf(
"cannot select the current value of sequence %y because this "
4940 "database does not support sequences", args[0]);
4944 "exp": <DataProviderExpressionInfo>{
4945 "type": DET_Operator,
4948 "desc":
"returns the output of the SQL window given by the arguments; args: *string partiion by, "
4952 DataProviderSignatureFieldType,
4953 DataProviderSignatureOptionalStringValueType,
4954 DataProviderSignatureOptionalStringValueType,
4957 "return_type": AbstractDataProviderTypeMap.
"any",
4959 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
4960 string column_name = args[0];
4961 *
string partitionby = args[1];
4962 *
string orderby = args[2];
4963 if (!exists partitionby && exists orderby) {
4964 throw "OVER-ERROR",
"Argument 2 (partition by) must be given in case of usage of argument 3 "
4967 string sql = column_name +
" over (";
4969 if (exists partitionby) {
4970 if (!info.pseudo_column_map{partitionby}) {
4971 cols = info.table.describe();
4972 if (!exists cols{partitionby}) {
4973 throw "OVER-ERROR", sprintf(
"Argument 2 (partition by) %y is not an alias or an "
4974 "accessible column", partitionby);
4977 sql += sprintf(
"partition by %s", partitionby);
4979 if (exists orderby) {
4980 if (!info.pseudo_column_map{orderby}) {
4982 cols = info.table.describe();
4983 if (!exists cols{orderby}) {
4984 throw "OVER-ERROR", sprintf(
"Argument 3 (order by) %y is not an alias or an "
4985 "accessible column", orderby);
4989 sql += sprintf(
" order by %s", orderby);
4996 "exp": <DataProviderExpressionInfo>{
4997 "type": DET_Operator,
5000 "desc":
"Returns the rank of a row in an ordered group of rows as a number",
5004 "return_type": AbstractDataProviderTypeMap.
"any",
5006 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
5007 return "dense_rank()";
5011 "exp": <DataProviderExpressionInfo>{
5012 "type": DET_Operator,
5015 "desc":
"Returns the first value in an ordered group of rows",
5018 DataProviderSignatureFieldType,
5021 "return_type": AbstractDataProviderTypeMap.
"any",
5023 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
5024 return sprintf(
"first_value(%s)", args[0]);
5028 "exp": <DataProviderExpressionInfo>{
5029 "type": DET_Operator,
5032 "desc":
"Returns the last value in an ordered group of rows",
5035 DataProviderSignatureFieldType,
5038 "return_type": AbstractDataProviderTypeMap.
"any",
5040 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
5041 return sprintf(
"last_value(%s)", args[0]);
5045 "exp": <DataProviderExpressionInfo>{
5046 "type": DET_Operator,
5049 "desc":
"Returns the group number of an ordered group of rows",
5052 DataProviderSignatureIntValueType,
5055 "return_type": AbstractDataProviderTypeMap.
"int",
5057 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
5058 return sprintf(
"ntile(%d)", args[0]);
5062 "exp": <DataProviderExpressionInfo>{
5063 "type": DET_Operator,
5066 "desc":
"Returns the percent rank of a row in an ordered group of rows",
5070 "return_type": AbstractDataProviderTypeMap.
"int",
5072 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
5073 return "percent_rank()";
5077 "exp": <DataProviderExpressionInfo>{
5078 "type": DET_Operator,
5081 "desc":
"Returns the row number of a row in an ordered group of rows",
5085 "return_type": AbstractDataProviderTypeMap.
"int",
5087 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
5092 "exp": <DataProviderExpressionInfo>{
5093 "type": DET_Operator,
5096 "desc":
"Returns the row number of a result set",
5100 "return_type": AbstractDataProviderTypeMap.
"int",
5102 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
5103 return "row_number()";
5111 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5113 return sprintf(
"%s like %v", cn);
5116 "args": (DataProviderSignatureStringType, DataProviderSignatureStringValueType),
5117 "return_type": AbstractDataProviderTypeMap.
"bool",
5118 "desc":
"The value to bind as the 'like' value (ex: '%some string%')",
5120 OP_LT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LT} + (
5121 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5123 return sprintf(
"%s < %v", cn);
5126 OP_LE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LE} + (
5127 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5129 return sprintf(
"%s <= %v", cn);
5132 OP_GT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GT} + (
5133 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5135 return sprintf(
"%s > %v", cn);
5138 OP_GE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GE} + (
5139 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5141 return sprintf(
"%s >= %v", cn);
5144 OP_NE: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NE} + (
5145 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5146 if (arg === NULL || !exists arg)
5147 return sprintf(
"%s is not null", cn);
5149 return sprintf(
"(%s != %v or %s is null)", cn, cn);
5152 OP_EQ: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_EQ} + (
5153 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5154 if (arg === NULL || !exists arg)
5155 return sprintf(
"%s is null", cn);
5157 return sprintf(
"%s = %v", cn);
5160 OP_BETWEEN: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_BETWEEN} + (
5161 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5162 info.args += arg[0];
5163 info.args += arg[1];
5164 return sprintf(
"%s between %v and %v", cn);
5167 OP_IN: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_IN} + (
5168 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5169 *
string ins = (foldl $1 +
"," + $2, (map info.table.getSqlValue($1), arg));
5170 return exists ins ? sprintf(
"%s in (%s)", cn, ins) :
"1 != 1";
5174 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg,
5177 if (arg.table.typeCode() == NT_STRING) {
5178 subtable = info.table.getSubtableFromString(arg.table, opt);
5180 subtable = arg.table;
5184 string subsql = subtable.getSelectSql(arg.select_hash, \subargs);
5185 info.args += subargs;
5186 return sprintf(
"%s in (%s)", cn, subsql);
5190 OP_NOT: AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NOT} + (
5192 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5193 return sprintf(
"not (%s)", cn);
5198 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5199 return sprintf(
"%s < %s", cn, arg);
5202 "type": AbstractDataProviderType::get(StringType),
5203 "desc":
"a column name for less than comparisons; if the field value is less than the column argument's "
5204 "value, then the operation returns true; the other column must have a compatible type",
5208 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5209 return sprintf(
"%s <= %s", cn, arg);
5211 "name":
"column <=",
5212 "type": AbstractDataProviderType::get(StringType),
5213 "desc":
"a column name for less than or equals comparisons; if the field value is less than or equal to "
5214 "the column argument's, then the operation returns true; the other column must have a compatible type",
5218 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5219 return sprintf(
"%s > %s", cn, arg);
5222 "type": AbstractDataProviderType::get(StringType),
5223 "desc":
"a column name for less than comparisons; if the field value is less than the column argument's, "
5224 "then the operation returns true; the other column must have a compatible type",
5228 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5229 return sprintf(
"%s >= %s", cn, arg);
5231 "name":
"column >=",
5232 "type": AbstractDataProviderType::get(StringType),
5233 "desc":
"a column name for greater than or equals comparisons; if the field value is greater than or "
5234 "equal to the column argument's, then the operation returns true; the other column must have a "
5239 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5240 return sprintf(
"%s != %s", cn, arg);
5242 "name":
"column !=",
5243 "type": AbstractDataProviderType::get(StringType),
5244 "desc":
"a column name for not=equals comparisons; the other column must have a compatible type",
5248 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
string arg) {
5249 return sprintf(
"%s = %s", cn, arg);
5252 "type": AbstractDataProviderType::get(StringType),
5253 "desc":
"a value for equality comparisons; the other column must have a compatible type",
5256 "code":
string sub (reference<hash<QueryInfo>> info,
string cn,
auto arg) {
5257 info.args += arg[0];
5258 if (!exists arg[1]) {
5259 info.args += arg[2]; # text
5260 return sprintf(
"substring(%s from %v) = %v", cn);
5262 info.args += arg[1]; # count
5263 info.args += arg[2]; # text
5264 return sprintf(
"substring(%s from %v for %v) = %v", cn);
5268 "code":
string sub (reference<hash<QueryInfo>> info,
string cn, list<auto> arg) {
5269 return info.table.getOrClause(\info, arg);
5483 hash<OperatorInfo>
op_in(list<auto> args);
5599 hash<OperatorInfo>
op_substr(
int start, *
int count,
string text);
5634 hash<string, hash<OperatorInfo>>
wop_or(hash h1, hash h2);
5671 hash<InsertOperatorInfo>
make_iop(
string iop,
auto arg);
5720 AbstractDatasource sqlutil_get_ds(
string type,
string config);
5724 hash<auto> sqlutil_ds(AbstractDatasource ds);
6134 populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
6227 tableRenamedIntern(
string old_name,
string new_name,
string oldsn);
6250 list<auto> getCreateList();
6280 getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
6401 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string c, *
int scale) ;
6629 list<auto>
getRecreateSql(AbstractDatasource ds,
string table_name, *hash<auto> opt);
6880 constructor(
string n, *hash<auto> c) ;
6984 constructor(
string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:6738
string src
the source of the check clause
Definition: SqlUtil.qm.dox.h:6742
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:6764
*string index
the index supporting the constraint
Definition: SqlUtil.qm.dox.h:6769
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:6368
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
hash< GenericColumnInfo > getDescriptionHash()
Returns a description hash of the column.
string native_type
the native type name of the column
Definition: SqlUtil.qm.dox.h:6372
abstract list< auto > getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash< auto > opt)
returns a list of sql strings that can be used to modify the column to the new definition
*string comment
comment on the column
Definition: SqlUtil.qm.dox.h:6387
*string def_val
default value for column
Definition: SqlUtil.qm.dox.h:6384
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
*string qore_type
the equivalent qore type name of the column if known
Definition: SqlUtil.qm.dox.h:6375
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:6381
bool equal(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
const DefaultVarcharSize
Default VARCHAR column size.
Definition: SqlUtil.qm.dox.h:6393
string getNativeTypeString()
returns the string describing the native type that can be used in SQL
int size
the size of the column
Definition: SqlUtil.qm.dox.h:6378
*int scale
the scale for numeric columns
Definition: SqlUtil.qm.dox.h:6390
abstract list< auto > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
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:6791
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:6796
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:6676
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
bool hasColumn(string cname)
returns True if the constraint references the named column
rename(string n)
renames the constraint
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
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:6683
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:6342
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:6349
string name
the name of the object
Definition: SqlUtil.qm.dox.h:6346
constructor(string name)
creates the object from the name
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:6951
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:6955
base class for function or objects with code
Definition: SqlUtil.qm.dox.h:7040
string getNormalizedSource(string src)
returns normalized source for comparisons
string name
the name of the object
Definition: SqlUtil.qm.dox.h:7044
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:7050
string type
the type of object
Definition: SqlUtil.qm.dox.h:7047
string getType()
returns the type of object
base class for functions
Definition: SqlUtil.qm.dox.h:7085
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:5728
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
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),...
renameKey(string old_name, string new_name)
renames the given key; maintains the key order
list< auto > values()
Returns a list of values of the contained hash.
*string lastKey()
Returns the last key name in the contained hash or NOTHING if the contained hash has no keys.
*hash< auto > getHash()
returns the hash contained by this object
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:5735
abstract string getElementName()
must return the name of the contained element
list< string > keys()
Returns a list of key names of the contained hash.
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:6546
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:6563
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
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:6550
*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:6553
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition: SqlUtil.qm.dox.h:6560
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
*list< AbstractColumnConstraint > getAllSupportingConstraints()
returns all supporting constraints, if any
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
Columns columns
an object of class Columns representing the columns in the index
Definition: SqlUtil.qm.dox.h:6556
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,...
abstract container class that throws an exception if an unknown key is accessed
Definition: SqlUtil.qm.dox.h:6009
list< auto > getList()
returns the list contained by this object
bool empty()
returns True if the container is empty, False if not
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:6874
base class for sequences
Definition: SqlUtil.qm.dox.h:6968
*number max
the ending number
Definition: SqlUtil.qm.dox.h:6981
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:6972
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:6975
number increment
the increment
Definition: SqlUtil.qm.dox.h:6978
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:7149
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
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
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:6865
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:7004
bool updatable
Flag showing if is the view updatable with DML commands.
Definition: SqlUtil.qm.dox.h:7017
string name
the name of the sequence
Definition: SqlUtil.qm.dox.h:7011
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_name, string n_src)
creates the object from the arguments
string src
the source code
Definition: SqlUtil.qm.dox.h:7014
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:6286
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:6634
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:6932
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:6939
string table
the name of the target table
Definition: SqlUtil.qm.dox.h:6936
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6885
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
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
*hash< auto > findConstraintOn(string table, softlist< auto > cols)
returns either a hash of AbstractColumn information or NOTHING if no foreign constraint can be found ...
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:7111
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:6500
string getElementName()
must return the name of the contained element
AbstractIndex take(string k)
removes the given key from the contained hash and returns the value
*AbstractIndex tryTake(string k)
tries to remove the given key from the contained hash and returns the value if it exists
*AbstractIndex findEqual(AbstractIndex ix)
find an index with columns equal to the index passed
add(string k, AbstractIndex val)
adds the given value to the hash with the given key name
AbstractIndex memberGate(string k)
returns the AbstractIndex object corresponding to the key given or throws a KEY-ERROR exception
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:44
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:6098
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
*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...
list< auto > getDropList()
returns a list of cached table names in the order that can be used to drop the tables,...
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
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...
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:7167
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 SZ_NONE
Definition: SqlUtil.qm.dox.h:2470
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition: SqlUtil.qm.dox.h:2479
const SZ_MAND
the data type takes a mandatory size parameter
Definition: SqlUtil.qm.dox.h:2473
const SZ_OPT
the data type takes an optional size parameter
Definition: SqlUtil.qm.dox.h:2476
const CLOB
specifies a large variable-length character column (ie CLOB or TEXT, etc)
Definition: SqlUtil.qm.dox.h:2462
const DB_SYNONYMS
Feature: synonyms.
Definition: SqlUtil.qm.dox.h:2442
const DB_PACKAGES
Feature: packages.
Definition: SqlUtil.qm.dox.h:2430
const VARCHAR
Definition: SqlUtil.qm.dox.h:2450
const DB_MVIEWS
Feature: materialized views / snapshots.
Definition: SqlUtil.qm.dox.h:2428
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition: SqlUtil.qm.dox.h:2459
const DB_PROCEDURES
Feature: procedures.
Definition: SqlUtil.qm.dox.h:2432
const DB_TABLES
Feature: tables.
Definition: SqlUtil.qm.dox.h:2436
const DB_VIEWS
Feature: views.
Definition: SqlUtil.qm.dox.h:2440
const CHAR
specifies a CHAR column
Definition: SqlUtil.qm.dox.h:2456
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition: SqlUtil.qm.dox.h:2453
const DB_FUNCTIONS
Feature: functions.
Definition: SqlUtil.qm.dox.h:2426
const DB_SEQUENCES
Feature: sequences.
Definition: SqlUtil.qm.dox.h:2434
const DB_TYPES
Feature: named types.
Definition: SqlUtil.qm.dox.h:2438
hash< ColumnOperatorInfo > cop_plus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "+" operator with the given arguments
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
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_year_day(auto column)
returns a ColumnOperatorInfo hash for the "year_day" operator with the given argument
hash< ColumnOperatorInfo > cop_year_month(auto column)
returns a ColumnOperatorInfo hash for the "year_month" operator with the given argument
hash< ColumnOperatorInfo > cop_count(auto column='')
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts
hash< ColumnOperatorInfo > cop_append(auto column, string arg)
returns a ColumnOperatorInfo hash for the "append" operator with the given argument
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_dense_rank()
Analytic/window function: rank of the current row without gaps.
hash< ColumnOperatorInfo > cop_length(auto column)
returns a ColumnOperatorInfo hash for the "len" operator with the given argument; returns the length ...
hash< ColumnOperatorInfo > cop_lower(auto column)
returns a ColumnOperatorInfo hash for the "lower" operator with the given argument; returns a column ...
hash< ColumnOperatorInfo > cop_multiply(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "*" operator with the given arguments
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence ...
hash< ColumnOperatorInfo > cop_value(auto arg)
returns a ColumnOperatorInfo hash for the "value" (literal) operator with the given argument
hash< ColumnOperatorInfo > cop_last_value(any column)
Analytic/window function: value evaluated at the row that is the last row of the window frame.
hash< ColumnOperatorInfo > cop_prepend(auto column, string arg)
returns a ColumnOperatorInfo hash for the "prepend" operator with the given argument
hash< ColumnOperatorInfo > cop_rank()
Analytic/window function: rank of the current row with gaps.
hash< ColumnOperatorInfo > cop_min(auto column)
returns a ColumnOperatorInfo hash for the "min" operator; returns minimum column values
hash< ColumnOperatorInfo > cop_row_number()
Analytic/window function: number of the current row within its partition, counting from 1.
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
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_upper(auto column)
returns a ColumnOperatorInfo hash for the "upper" operator with the given argument; returns a column ...
hash< ColumnOperatorInfo > cop_avg(auto column)
returns a ColumnOperatorInfo hash for the "avg" operator; returns average column values
hash< ColumnOperatorInfo > cop_percent_rank()
Analytic/window function: relative rank of the current row.
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_sum(auto column)
returns a ColumnOperatorInfo hash for the "sum" operator; returns the total sum of a numeric column.
hash< ColumnOperatorInfo > cop_distinct(auto column)
returns a ColumnOperatorInfo hash for the "distinct" operator with the given argument; returns distin...
hash< ColumnOperatorInfo > cop_minus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "-" operator with the given arguments
hash< ColumnOperatorInfo > cop_over(auto column, *string partitionby, *string orderby)
returns a ColumnOperatorInfo hash for the "over" clause
hash< ColumnOperatorInfo > make_cop(string cop, auto column, auto arg)
hash< ColumnOperatorInfo > cop_divide(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "/" operator with the given arguments
hash< ColumnOperatorInfo > cop_ntile(int value)
Analytic/window function: integer ranging from 1 to the argument value, dividing the partition as equ...
hash< ColumnOperatorInfo > cop_first_value(any column)
Analytic/window function: value evaluated at the row that is the first row of the window frame.
hash< ColumnOperatorInfo > cop_max(auto column)
returns a ColumnOperatorInfo hash for the "max" operator; returns maximum column values
hash< ColumnOperatorInfo > cop_year_hour(auto column)
returns a ColumnOperatorInfo hash for the "year_hour" operator with the given argument
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 DT_YEAR
Definition: SqlUtil.qm.dox.h:3598
const DT_MINUTE
Format unit: minute.
Definition: SqlUtil.qm.dox.h:3610
const DT_SECOND
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3613
const DT_MONTH
Format unit: month.
Definition: SqlUtil.qm.dox.h:3601
const DT_HOUR
Format unit: hour.
Definition: SqlUtil.qm.dox.h:3607
const DT_DAY
Format unit: day.
Definition: SqlUtil.qm.dox.h:3604
const COP_MAX
to return the maximum value
Definition: SqlUtil.qm.dox.h:2534
const COP_OVER
the SQL "over" clause
Definition: SqlUtil.qm.dox.h:2554
const COP_SEQ_CURRVAL
to return the last value of a sequence issued in the same session
Definition: SqlUtil.qm.dox.h:2604
const COP_LENGTH
to get the length of a text field
Definition: SqlUtil.qm.dox.h:2621
const COP_RANK
Analytic (window) function: RANK.
Definition: SqlUtil.qm.dox.h:2679
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition: SqlUtil.qm.dox.h:2509
const COP_COALESCE
to return the first non-null argument in the list
Definition: SqlUtil.qm.dox.h:2609
const COP_MIN
to return the minimum value
Definition: SqlUtil.qm.dox.h:2529
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition: SqlUtil.qm.dox.h:2594
const COP_DIVIDE
the SQL "divide" operator
Definition: SqlUtil.qm.dox.h:2569
const COP_YEAR
to return a date value with year information only
Definition: SqlUtil.qm.dox.h:2579
const COP_COUNT
to return the row count
Definition: SqlUtil.qm.dox.h:2549
const COP_MULTIPLY
the SQL "multiply" operator
Definition: SqlUtil.qm.dox.h:2574
const COP_AVG
to return the average value
Definition: SqlUtil.qm.dox.h:2539
const COP_PLUS
the SQL "plus" operator
Definition: SqlUtil.qm.dox.h:2564
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition: SqlUtil.qm.dox.h:2637
const COP_SUBSTR
to extract a substring from a column
Definition: SqlUtil.qm.dox.h:2614
const COP_SEQ
to return the next value of a sequence
Definition: SqlUtil.qm.dox.h:2599
const COP_APPEND
to append a string to a column on output
Definition: SqlUtil.qm.dox.h:2504
const COP_PERCENT_RANK
Analytic (window) function: PERCENT_RANK.
Definition: SqlUtil.qm.dox.h:2672
const COP_NTILE
Analytic (window) function: NTILE.
Definition: SqlUtil.qm.dox.h:2665
const COP_YEAR_MONTH
to return a date value with year to month information
Definition: SqlUtil.qm.dox.h:2584
const COP_PREPEND
to prepend a string to a column on output
Definition: SqlUtil.qm.dox.h:2499
const COP_LOWER
to return column value in lower case
Definition: SqlUtil.qm.dox.h:2519
const COP_AS
Definition: SqlUtil.qm.dox.h:2489
const COP_CAST
to convert column value into another datatype
Definition: SqlUtil.qm.dox.h:2494
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition: SqlUtil.qm.dox.h:2686
const COP_YEAR_DAY
to return a date value with year to day information
Definition: SqlUtil.qm.dox.h:2589
const COP_UPPER
to return column value in upper case
Definition: SqlUtil.qm.dox.h:2514
const COP_DENSE_RANK
Analytic (window) function: DENSE_RANK.
Definition: SqlUtil.qm.dox.h:2644
const COP_TRUNC_DATE
to return the date with truncated value
Definition: SqlUtil.qm.dox.h:2630
const COP_MINUS
the SQL "minus" operator
Definition: SqlUtil.qm.dox.h:2559
const COP_LAST_VALUE
Analytic (window) function: LAST_VALUE.
Definition: SqlUtil.qm.dox.h:2658
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition: SqlUtil.qm.dox.h:2651
const DefaultCopMap
a hash of default column operator descriptions
Definition: SqlUtil.qm.dox.h:2722
const COP_DISTINCT
to return distinct values
Definition: SqlUtil.qm.dox.h:2524
const COP_SUM
to return the sum value
Definition: SqlUtil.qm.dox.h:2544
hash< InsertOperatorInfo > make_iop(string iop, auto arg)
hash< InsertOperatorInfo > iop_seq_currval(string arg)
returns an InsertOperatorInfo hash for retrieving the current value of the given sequence in insert q...
hash< InsertOperatorInfo > iop_seq(string arg)
returns an InsertOperatorInfo hash for retrieving the value of the given sequence in insert queries
const IOP_SEQ
Definition: SqlUtil.qm.dox.h:5647
const DefaultIopMap
a hash of default insert operator descriptions (currently empty, all operators are driver-dependent)
Definition: SqlUtil.qm.dox.h:5655
const IOP_SEQ_CURRVAL
for using the last value of a sequence issued in the current session
Definition: SqlUtil.qm.dox.h:5652
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...
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< 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...
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
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< string, hash< JoinOperatorInfo > > make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash< auto > opt)
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 JopMap
a hash of valid join operators
Definition: SqlUtil.qm.dox.h:3835
const JOP_INNER
Definition: SqlUtil.qm.dox.h:3822
const JOP_RIGHT
for right outer joins
Definition: SqlUtil.qm.dox.h:3832
const JOP_LEFT
for left outer joins
Definition: SqlUtil.qm.dox.h:3827
hash< OperatorInfo > op_ceq(string arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_clt(string arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_between(auto l, auto r)
returns an OperatorInfo hash for the "between" operator with the given arguments, neither of which ca...
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_cne(string arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
hash< OperatorInfo > op_cgt(string arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_ne(auto arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
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< OperatorInfo > make_op(string op, auto arg)
hash< OperatorInfo > op_lt(auto arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
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...
hash< OperatorInfo > op_like(string str)
returns an OperatorInfo hash for the "like" operator with the given argument for use in where clauses
hash< OperatorInfo > op_gt(auto arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
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< OperatorInfo > op_ge(auto arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
hash< OperatorInfo > op_not(hash arg)
returns an OperatorInfo hash for the "not" operator; for use in where clauses
hash< OperatorInfo > op_eq(auto arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
hash< OperatorInfo > op_cge(string arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
hash< OperatorInfo > op_in()
returns an OperatorInfo hash for the "in" operator with all arguments passed to the function; for use...
hash< OperatorInfo > op_le(auto arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4329
const OP_NE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4334
const OP_LE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4319
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4339
const OP_IN
the SQL "in" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4379
const OP_NOT
the SQL "not" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4384
const DefaultExpressionMap
Default expressions to be supported by all SqlUtil modules.
Definition: SqlUtil.qm.dox.h:4402
const DefaultOpMap
a hash of valid operators for use in Where Clauses
Definition: SqlUtil.qm.dox.h:5109
const OP_SUBSTR
the SQL "substr" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4389
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4359
const OP_LT
the SQL less than (<) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4314
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4349
const OP_BETWEEN
the SQL "between" operator for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4374
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4324
const OP_CNE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4364
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition: SqlUtil.qm.dox.h:4344
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4394
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4399
const OP_CGT
the SQL greater than operator (>) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4354
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition: SqlUtil.qm.dox.h:4369
const OP_LIKE
Definition: SqlUtil.qm.dox.h:4309
hash< UpdateOperatorInfo > uop_plus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "+" operator with the given arguments
hash< UpdateOperatorInfo > uop_seq_currval(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
hash< UpdateOperatorInfo > uop_prepend(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "prepend" operator with the given argument
hash< UpdateOperatorInfo > uop_seq(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
hash< UpdateOperatorInfo > uop_upper(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "upper" operator with the given argument; returns a column...
hash< UpdateOperatorInfo > uop_divide(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "/" operator with the given arguments
hash< UpdateOperatorInfo > uop_append(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "append" or concatenate operator with the given argument
hash< UpdateOperatorInfo > make_uop(string uop, auto arg, *hash< UpdateOperatorInfo > nest)
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...
hash< UpdateOperatorInfo > uop_multiply(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "*" operator with the given arguments
hash< UpdateOperatorInfo > uop_lower(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "lower" operator with the given argument; returns a column...
hash< UpdateOperatorInfo > uop_minus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "-" operator with the given arguments
const DefaultUopMap
Definition: SqlUtil.qm.dox.h:3624
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:26
sqlutil_register_ds_deserializer(*code new_ds_get)
registers a closure or call reference taking a string type and string datasource configuration that w...
sqlutil_register_ds_serializer(*code new_ds_do)
registers a closure or call reference taking a string type and string datasource configuration that w...
const SqlUtilDrivers
known drivers
Definition: SqlUtil.qm.dox.h:5702
column operator info hash as returned by all column operator functions
Definition: SqlUtil.qm.dox.h:2355
string cop
the column operator string code
Definition: SqlUtil.qm.dox.h:2356
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2358
auto column
column sopecifier, may be a string or a complex hash
Definition: SqlUtil.qm.dox.h:2357
generic column description hash in schema descriptions
Definition: SqlUtil.qm.dox.h:2325
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:2341
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:2343
auto default_value
the default value for the column
Definition: SqlUtil.qm.dox.h:2335
softint scale
for numeric data types, this value gives the scale
Definition: SqlUtil.qm.dox.h:2333
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition: SqlUtil.qm.dox.h:2331
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:2337
*string comment
an optional comment for the column
Definition: SqlUtil.qm.dox.h:2339
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:2327
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:2329
*bool auto_increment
True for DBs that support an auto-increment column
Definition: SqlUtil.qm.dox.h:2345
insert operator info hash as returned by all insert operator functions
Definition: SqlUtil.qm.dox.h:2362
string _iop
the insert operator string code
Definition: SqlUtil.qm.dox.h:2363
any arg
optional argument
Definition: SqlUtil.qm.dox.h:2364
join operator info hash as returned by all join operator functions
Definition: SqlUtil.qm.dox.h:2375
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition: SqlUtil.qm.dox.h:2380
*string alias
optional alias for table in the query
Definition: SqlUtil.qm.dox.h:2378
*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:2381
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition: SqlUtil.qm.dox.h:2377
*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:2379
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition: SqlUtil.qm.dox.h:2382
string jop
the join operator string code
Definition: SqlUtil.qm.dox.h:2376
SQL operator info hash as returned by all operator functions.
Definition: SqlUtil.qm.dox.h:2349
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2351
string op
the operator string code
Definition: SqlUtil.qm.dox.h:2350
Query information.
Definition: SqlUtil.qm.dox.h:2689
*hash< auto > expression_map
The expression map.
Definition: SqlUtil.qm.dox.h:2709
*hash< string, AbstractTable > join_map
Tables in this join; table alias -> table.
Definition: SqlUtil.qm.dox.h:2700
*hash< auto > pseudo_column_map
Any valid pseudocolumns or aliases generated in th query.
Definition: SqlUtil.qm.dox.h:2706
*hash< auto > where_operator_map
The old-style backwards-compatible "where operator" map.
Definition: SqlUtil.qm.dox.h:2712
object table
The primary table object.
Definition: SqlUtil.qm.dox.h:2691
*hash< auto > query_hash
The original query hash.
Definition: SqlUtil.qm.dox.h:2694
*hash< auto > column_operator_map
Any custom column operator map.
Definition: SqlUtil.qm.dox.h:2715
list< auto > args
arguments to bind in the query generated
Definition: SqlUtil.qm.dox.h:2718
*hash< auto > query_options
Any query options.
Definition: SqlUtil.qm.dox.h:2697
*hash< string, bool > subquery_column_map
When executing a superquery, we can only reference colums in the subquery.
Definition: SqlUtil.qm.dox.h:2703
A hash describing SQL and arguments for an SQL DML command.
Definition: SqlUtil.qm.dox.h:2411
string sql
the SQL string for the update
Definition: SqlUtil.qm.dox.h:2413
list< auto > args
the arguments for the string
Definition: SqlUtil.qm.dox.h:2416
column data type options
Definition: SqlUtil.qm.dox.h:2386
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition: SqlUtil.qm.dox.h:2397
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition: SqlUtil.qm.dox.h:2391
*softint maxlen
optional additional limit to the maximum length of the data
Definition: SqlUtil.qm.dox.h:2405
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition: SqlUtil.qm.dox.h:2394
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition: SqlUtil.qm.dox.h:2400
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition: SqlUtil.qm.dox.h:2388
update operator info hash as returned by all update operator functions
Definition: SqlUtil.qm.dox.h:2368
*hash nest
option nested operation hash
Definition: SqlUtil.qm.dox.h:2371
auto arg
optional argument
Definition: SqlUtil.qm.dox.h:2370
string uop
the update operator string code
Definition: SqlUtil.qm.dox.h:2369