Loading...
Searching...
No Matches
SqlUtil.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* SqlUtil.qm Copyright (C) 2013 - 2024 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// minimum required Qore version
// requires the Util module
// requires the DataProvider module
// don't use "$" signs for variables and class members, assume local variable scope
// require type definitions everywhere
// enable all warnings
// version history is included below in the docs
namespace SqlUtil {
public struct GenericColumnInfo {
string qore_type;
string native_type;
softint size;
softint scale;
auto default_value;
bool default_value_native = False;
*string comment;
bool notnull = False;
hash<string, hash> driver;
*bool auto_increment;
};
public struct OperatorInfo {
string op;
auto arg;
};
public struct ColumnOperatorInfo {
string cop;
auto column;
auto arg;
};
public struct InsertOperatorInfo {
string _iop;
any arg;
};
public struct UpdateOperatorInfo {
string uop;
auto arg;
*hash nest;
};
public struct JoinOperatorInfo {
string jop;
auto table;
*string alias;
*hash jcols;
*hash cond;
*string ta;
*hash<auto> opt;
};
public struct SqlUtilDataTypeOptionInfo {
*string date_format;
*TimeZone data_timezone;
*TimeZone db_timezone;
*string number_format;
*softbool mandatory;
*softint maxlen;
};
public struct SqlCommandInfo {
string sql;
list<auto> args;
};
const DB_FUNCTIONS = "functions";
const DB_MVIEWS = "materialized views";
const DB_PACKAGES = "packages";
const DB_PROCEDURES = "procedures";
const DB_SEQUENCES = "sequences";
const DB_TABLES = "tables";
const DB_TYPES = "named types";
const DB_VIEWS = "views";
const DB_SYNONYMS = "synonyms";
/* @defgroup SqlTypeConstants SQL Type Constants
These constants can be used for the \c "qore_type" values when creating columns to specify additional SQL column types
*/
const VARCHAR = "string";
const NUMERIC = "number";
const CHAR = "char";
const BLOB = "blob";
const CLOB = "clob";
const SZ_NONE = 0;
const SZ_MAND = 1;
const SZ_OPT = 2;
const SZ_NUM = 3;
const COP_AS = "as";
const COP_CAST = "cast";
const COP_PREPEND = "prepend";
const COP_APPEND = "append";
const COP_VALUE = "value";
const COP_UPPER = "upper";
const COP_LOWER = "lower";
const COP_DISTINCT = "distinct";
const COP_MIN = "min";
const COP_MAX = "max";
const COP_AVG = "avg";
const COP_SUM = "sum";
const COP_COUNT = "count";
const COP_OVER = "over";
const COP_MINUS = "minus";
const COP_PLUS = "plus";
const COP_DIVIDE = "divide";
const COP_MULTIPLY = "multiply";
const COP_YEAR = "year";
const COP_YEAR_MONTH = "year_month";
const COP_YEAR_DAY = "year_day";
const COP_YEAR_HOUR = "year_hour";
const COP_SEQ = "seq";
const COP_SEQ_CURRVAL = "seq_currval";
const COP_COALESCE = "coalesce";
const COP_SUBSTR = "substr";
const COP_LENGTH = "length";
const COP_TRUNC_DATE = "truncate_date";
const COP_CUME_DIST = "cume_dist";
const COP_DENSE_RANK = "dense_rank";
const COP_FIRST_VALUE = "first_value";
const COP_LAST_VALUE = "last_value";
const COP_NTILE = "ntile";
const COP_PERCENT_RANK = "percent_rank";
const COP_RANK = "rank";
const COP_ROW_NUMBER = "row_number";
public struct QueryInfo {
object table;
*hash<auto> query_hash;
*hash<auto> query_options;
*hash<string, AbstractTable> join_map;
*hash<string, bool> subquery_column_map;
*hash<auto> pseudo_column_map;
*hash<auto> expression_map;
*hash<auto> where_operator_map;
*hash<auto> column_operator_map;
list<auto> args;
};
const DefaultCopMap = ...;
hash<ColumnOperatorInfo> make_cop(string cop, auto column, auto arg);
hash<ColumnOperatorInfo> cop_as(auto column, string arg);
hash<ColumnOperatorInfo> cop_cast(auto column, string arg, auto arg1, auto arg2);
hash<ColumnOperatorInfo> cop_prepend(auto column, string arg);
hash<ColumnOperatorInfo> cop_append(auto column, string arg);
hash<ColumnOperatorInfo> cop_value(auto arg);
hash<ColumnOperatorInfo> cop_upper(auto column);
hash<ColumnOperatorInfo> cop_lower(auto column);
hash<ColumnOperatorInfo> cop_distinct(auto column);
hash<ColumnOperatorInfo> cop_min(auto column);
hash<ColumnOperatorInfo> cop_max(auto column);
hash<ColumnOperatorInfo> cop_avg(auto column);
hash<ColumnOperatorInfo> cop_sum(auto column);
hash<ColumnOperatorInfo> cop_count(auto column = '');
hash<ColumnOperatorInfo> cop_over(auto column, *string partitionby, *string orderby);
hash<ColumnOperatorInfo> cop_minus(auto column1, auto column2);
hash<ColumnOperatorInfo> cop_plus(auto column1, auto column2);
hash<ColumnOperatorInfo> cop_divide(auto column1, auto column2);
hash<ColumnOperatorInfo> cop_multiply(auto column1, auto column2);
hash<ColumnOperatorInfo> cop_year(auto column);
hash<ColumnOperatorInfo> cop_year_month(auto column);
hash<ColumnOperatorInfo> cop_year_day(auto column);
hash<ColumnOperatorInfo> cop_year_hour(auto column);
hash<ColumnOperatorInfo> cop_seq(string seq, *string as);
hash<ColumnOperatorInfo> cop_seq_currval(string seq, *string as);
hash<ColumnOperatorInfo> cop_coalesce(auto col1, auto col2);
hash<ColumnOperatorInfo> cop_substr(auto column, int start, *int count);
hash<ColumnOperatorInfo> cop_length(auto column);
hash<ColumnOperatorInfo> cop_trunc_date(auto column, string mask);
hash<ColumnOperatorInfo> cop_cume_dist();
hash<ColumnOperatorInfo> cop_dense_rank();
hash<ColumnOperatorInfo> cop_first_value(any column);
hash<ColumnOperatorInfo> cop_last_value(any column);
hash<ColumnOperatorInfo> cop_ntile(int value);
hash<ColumnOperatorInfo> cop_percent_rank();
hash<ColumnOperatorInfo> cop_rank();
hash<ColumnOperatorInfo> cop_row_number();
const DT_YEAR = "Y";
const DT_MONTH = "M";
const DT_DAY = "D";
const DT_HOUR = "H";
const DT_MINUTE = "m";
const DT_SECOND = "S";
// let's simulate and enum here'
const DT_ALL_VALUES = ( DT_YEAR, DT_MONTH, DT_DAY, DT_HOUR, DT_MINUTE, DT_SECOND );
const DefaultUopMap = ...;
hash<UpdateOperatorInfo> make_uop(string uop, auto arg, *hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_prepend(string arg, *hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_append(string arg, *hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_upper(*hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_lower(*hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_substr(int start, *int count, *hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_plus(auto arg, *hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_minus(auto arg, *hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_multiply(auto arg, *hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_divide(auto arg, *hash<UpdateOperatorInfo> nest);
hash<UpdateOperatorInfo> uop_seq(string seq);
hash<UpdateOperatorInfo> uop_seq_currval(string seq);
const JOP_INNER = "inner";
const JOP_LEFT = "left";
const JOP_RIGHT = "right";
const JopMap = ...;
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>> make_jop(string jop, string table_name, *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);
hash<string, hash<JoinOperatorInfo>> join_inner(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_inner(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_inner(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_inner(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_left(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_left(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_left(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_left(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_left(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_left_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_right(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_right(Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_right(string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_right(string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_right(string ta, Table table, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
hash<string, hash<JoinOperatorInfo>> join_right_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash<auto> opt);
const OP_LIKE = "like";
const OP_LT = "<";
const OP_LE = "<=";
const OP_GT = ">";
const OP_GE = ">=";
const OP_NE = "!=";
const OP_EQ = "=";
const OP_CLT = "C<";
const OP_CLE = "C<=";
const OP_CGT = "C>";
const OP_CGE = "C>=";
const OP_CNE = "C!=";
const OP_CEQ = "C=";
const OP_BETWEEN = "between";
const OP_IN = "in";
const OP_NOT = "not";
const OP_SUBSTR = "substr";
const OP_OR = "or";
const OP_IN_SELECT = "in_select";
const DefaultExpressionMap = ...;
const DefaultOpMap = ...;
hash<OperatorInfo> make_op(string op, auto arg);
hash<OperatorInfo> op_like(string str);
hash<OperatorInfo> op_lt(auto arg);
hash<OperatorInfo> op_le(auto arg);
hash<OperatorInfo> op_gt(auto arg);
hash<OperatorInfo> op_ge(auto arg);
hash<OperatorInfo> op_ne(auto arg);
hash<OperatorInfo> op_eq(auto arg);
hash<OperatorInfo> op_between(auto l, auto r);
hash<OperatorInfo> op_in();
hash<OperatorInfo> op_in_select(string table, hash<auto> select_hash);
hash<OperatorInfo> op_in_select(AbstractTable table, hash<auto> select_hash);
hash<OperatorInfo> op_in_select(Table table, hash<auto> select_hash);
hash<OperatorInfo> op_in(list<auto> args);
hash<OperatorInfo> op_not(hash arg);
hash<OperatorInfo> op_clt(string arg);
hash<OperatorInfo> op_cle(string arg);
hash<OperatorInfo> op_cgt(string arg);
hash<OperatorInfo> op_cge(string arg);
hash<OperatorInfo> op_cne(string arg);
hash<OperatorInfo> op_ceq(string arg);
hash<OperatorInfo> op_substr(int start, *int count, string text);
hash<OperatorInfo> op_substr(int start, string text);
hash<string, hash<OperatorInfo>> wop_or(hash h1, hash h2);
const IOP_SEQ = "seq";
const IOP_SEQ_CURRVAL = "seq_currval";
const DefaultIopMap = {};
hash<InsertOperatorInfo> make_iop(string iop, auto arg);
hash<InsertOperatorInfo> iop_seq(string arg);
hash<InsertOperatorInfo> iop_seq_currval(string arg);
const SqlUtilDrivers = ...;
// private variable to store the closure used to deserialize datasources (if any)
extern code ds_get;
// private variable to store the closure used to serialize datasources (if any)
extern code ds_do;
sqlutil_register_ds_deserializer(*code new_ds_get);
sqlutil_register_ds_serializer(*code new_ds_do);
// private function used to deserialize datasources
AbstractDatasource sqlutil_get_ds(string type, string config);
// private function used to serialize datasources
hash<auto> sqlutil_ds(AbstractDatasource ds);
class AbstractHashContainer : public Qore::Serializable {
public:
protected:
*hash h;
public:
constructor(*hash nh);
constructor(AbstractHashContainer old);
copy(AbstractHashContainer old);
auto memberGate(string k);
clear();
abstract auto take(string k);
renameKey(string old_name, string new_name);
*hash<auto> getHash();
bool matchKeys(hash h1);
bool matchKeys(list<auto> l);
bool matchKeys(AbstractHashContainer c);
bool partialMatchKeys(hash h1);
bool partialMatchKeys(list<auto> l);
bool partialMatchKeys(AbstractHashContainer c);
bool val();
list<string> keys();
list<auto> values();
Qore::AbstractIterator iterator();
Qore::AbstractIterator keyIterator();
Qore::AbstractIterator pairIterator();
bool empty();
int size();
bool hasKey(string k);
bool hasKeyValue(string k);
*string firstKey();
*string lastKey();
abstract string getElementName();
};
class AbstractListContainer : public Qore::Serializable {
public:
protected:
softlist l;
public:
constructor(softlist nl);
abstract auto get(softint i);
add(auto val);
auto take(int i);
list<auto> getList();
bool val();
Qore::ListIterator iterator();
bool empty();
int size();
abstract string getElementName();
protected:
checkIndex(int i);
public:
};
class Tables : public AbstractHashContainer {
public:
constructor();
constructor(AbstractDatasource ds, hash tables, *hash<auto> opt);
constructor(AbstractDatasource ds);
add(string k, Table val);
add(string k, AbstractTable val);
add(Table val);
add(AbstractTable val);
AbstractTable take(string k);
populate(AbstractDatasource ds, hash<auto> tables, *hash<auto> opt);
populate(AbstractDatasource ds);
*list<auto> getDropAllForeignConstraintsOnTableSql(string name, *hash<auto> opt);
AbstractTable memberGate(string k);
string getElementName();
*AbstractTable getIfExists(AbstractDatasource ds, string name);
AbstractTable get(AbstractDatasource ds, string name);
*string getRenameTableIfExistsSql(string old_name, string new_name, *hash<auto> opts);
bool tableRenamed(string old_name, string new_name, string old_sql_name);
protected:
tableRenamedIntern(string old_name, string new_name, string oldsn);
public:
*string getDropConstraintIfExistsSql(string tname, string cname, *hash<auto> opts);
list<auto> getCreateList();
Qore::AbstractIterator createIterator();
list<auto> getDropList();
Qore::AbstractIterator dropIterator();
protected:
getDependencies(reference<hash> tdh, reference<hash> sdh, *reference<hash> th);
public:
};
class Columns : public AbstractHashContainer {
public:
constructor(*hash c) ;
constructor(Columns old) ;
add(string k, AbstractColumn val);
AbstractColumn take(string k);
AbstractColumn memberGate(string k);
Columns subset(softlist l);
string getElementName();
bool equal(Columns cols);
AbstractIterator getSqlColumnNameIterator();
};
class AbstractDdlObject : public Qore::Serializable {
public:
string name;
string ddl_name;
protected:
constructor();
public:
constructor(string name);
abstract string getDdlName(string name);
};
class AbstractColumn : public AbstractDdlObject {
public:
string native_type;
*string qore_type;
int size;
bool nullable;
*string def_val;
*string comment;
*int scale;
const DefaultVarcharSize = 80;
protected:
constructor();
public:
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string c, *int scale) ;
hash<GenericColumnInfo> getDescriptionHash();
string getNativeTypeString();
string getCreateSql(AbstractTable t);
abstract list<auto> getAddColumnSql(AbstractTable t);
string getDropSql(string table_name);
list<auto> getModifySql(AbstractTable t, AbstractColumn c, *hash<auto> opt);
abstract string getRenameSql(AbstractTable t, string new_name);
bool equal(AbstractColumn c);
protected:
abstract bool equalImpl(AbstractColumn c);
public:
protected:
abstract list<auto> getModifySqlImpl(AbstractTable t, AbstractColumn c, *hash<auto> opt);
public:
};
class Indexes : public AbstractHashContainer {
public:
constructor(*hash c) ;
add(string k, AbstractIndex val);
*AbstractIndex findEqual(AbstractIndex ix);
AbstractIndex take(string k);
*AbstractIndex tryTake(string k);
AbstractIndex memberGate(string k);
string getElementName();
};
class AbstractIndex : public Qore::Serializable {
public:
string name;
bool unique;
Columns columns;
protected:
*AbstractColumnSupportingConstraint constraint;
*AbstractForeignConstraint foreign_constraint;
public:
constructor(string n, bool u, hash c);
string getName();
bool hasColumn(string cname);
abstract string getCreateSql(string table_name, *hash<auto> opt);
string getDropSql(string table_name);
bool equal(AbstractIndex ix);
bool equalExceptName(AbstractIndex ix);
abstract bool equalImpl(AbstractIndex ix);
abstract string getRenameSql(string table_name, string new_name);
setSupportingConstraint(AbstractColumnSupportingConstraint c);
setSupportingConstraint();
*AbstractColumnSupportingConstraint getSupportingConstraint();
setSupportingConstraint(AbstractForeignConstraint c);
setForeignConstraint();
*AbstractForeignConstraint getForeignConstraint();
*list<AbstractColumnConstraint> getAllSupportingConstraints();
list<auto> getRecreateSql(AbstractDatasource ds, string table_name, *hash<auto> opt);
};
class Constraints : public AbstractHashContainer {
public:
constructor(*hash c) ;
add(string k, AbstractConstraint val);
AbstractConstraint take(string k);
*AbstractUniqueConstraint findEqualUniqueConstraint(AbstractUniqueConstraint uk);
AbstractConstraint memberGate(string k);
string getElementName();
};
class AbstractConstraint : public Qore::Serializable {
public:
protected:
string name;
public:
constructor(string n);
string getName();
rename(string n);
abstract string getCreateSql(string table_name, *hash<auto> opt);
string getDropSql(string table_name);
abstract list<auto> getRenameSql(string table_name, string new_name);
string getDisableSql(string table_name);
string getEnableSql(string table_name, *hash<auto> opt);
bool equal(AbstractConstraint c);
protected:
abstract bool equalImpl(AbstractConstraint c);
public:
abstract bool setIndexBase(string ix);
abstract clearIndex();
bool hasColumn(string cname);
};
class AbstractCheckConstraint : public AbstractConstraint {
public:
string src;
constructor(string n, string n_src) ;
protected:
bool equalImpl(AbstractConstraint c);
public:
bool setIndexBase(string ix);
clearIndex();
};
class AbstractColumnConstraint : public AbstractConstraint, public Columns {
public:
protected:
*string index;
public:
constructor(string name, *hash<auto> cols, *string index) ;
constructor(string name, Columns cols, *string index) ;
bool setIndexBase(string ix);
bool hasColumn(string cname);
clearIndex();
};
class AbstractColumnSupportingConstraint : public AbstractColumnConstraint {
public:
protected:
*hash<string, hash<string, AbstractForeignConstraint>> sourceConstraints;
public:
constructor(string name, *hash<auto> cols, *string index) ;
constructor(string name, Columns cols, *string index) ;
Qore::AbstractIterator getSourceConstraintIterator();
hash<auto> getDisableReenableSql(AbstractDatasource ds, string table_name, *hash<auto> opts);
findMatchingIndex(*Indexes indexes);
addSourceConstraint(string tname, AbstractForeignConstraint fk);
removeSourceConstraint(string tname, list<auto> cols);
renameSourceConstraintTable(string old_name, string new_name);
bool hasColumn(string cname);
*string getIndex();
protected:
bool equalImpl(AbstractConstraint c);
public:
abstract string getCreateSql(string table_name, *hash<auto> opts);
};
class AbstractUniqueConstraint : public AbstractColumnSupportingConstraint {
public:
constructor(string n, *hash<auto> c, *string n_index) ;
};
class AbstractPrimaryKey : public AbstractUniqueConstraint {
public:
constructor() ;
constructor(string n, *hash<auto> c) ;
};
class ForeignConstraints : public AbstractHashContainer {
public:
constructor(*hash<auto> c) ;
add(string k, AbstractForeignConstraint val);
AbstractForeignConstraint take(string k);
*AbstractForeignConstraint findEqual(AbstractForeignConstraint fk);
AbstractForeignConstraint memberGate(string k);
*hash<auto> findConstraintOn(string table, softlist<auto> cols);
string getElementName();
};
class ForeignConstraintTarget : public Qore::Serializable {
public:
string table;
Columns columns;
constructor(string t, Columns c);
bool hasColumn(string cname);
bool equal(ForeignConstraintTarget targ);
};
class AbstractForeignConstraint : public AbstractColumnConstraint {
public:
ForeignConstraintTarget target;
constructor(string name, Columns cols, ForeignConstraintTarget t) ;
bool hasTargetColumn(string col);
protected:
bool equalImpl(AbstractConstraint con);
public:
};
class AbstractSequence : public Qore::Serializable {
public:
string name;
number start;
number increment;
*number max;
constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_max);
abstract string getCreateSql(*hash<auto> opt);
string getDropSql(*hash<auto> opt);
abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
};
class AbstractView : public Qore::Serializable {
public:
// ! potential object schema
*string schema;
string name;
string src;
bool updatable;
constructor(string n_name, string n_src);
abstract string getCreateSql(*hash<auto> opt);
string getDropSql(*hash<auto> opt);
abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
};
class AbstractFunctionBase : public Qore::Serializable {
public:
string name;
string type;
string src;
constructor(string n, string n_type, string n_src);
string getType();
string getDropSql(*hash<auto> opt);
bool equal(AbstractFunctionBase t);
string getNormalizedSource(string src);
protected:
abstract bool equalImpl(AbstractFunctionBase t);
public:
};
class AbstractFunction : public AbstractFunctionBase {
public:
constructor(string n, string n_type, string n_src) ;
abstract list<auto> getCreateSql(*hash<auto> opt);
abstract softlist<auto> getRenameSql(string new_name, *hash<auto> opt);
setName(string new_name);
};
class Functions : public AbstractHashContainer {
public:
constructor(*hash c) ;
add(string k, AbstractFunction val);
AbstractFunction take(string k);
AbstractFunction memberGate(string k);
string getElementName();
};
class AbstractTrigger : public AbstractFunctionBase {
public:
constructor(string n, string n_src) ;
abstract list<auto> getCreateSql(string table_name, *hash<auto> opt);
abstract softlist<auto> getRenameSql(string table_name, string new_name);
abstract list<auto> getDropSql(string table_name);
};
class Triggers : public AbstractHashContainer {
public:
constructor(*hash c) ;
add(string k, AbstractTrigger val);
AbstractTrigger take(string k);
AbstractTrigger memberGate(string k);
string getElementName();
};
};
SqlUtil::AbstractCheckConstraint
abstract class for check constraints
Definition SqlUtil.qm.dox.h:5872
SqlUtil::AbstractCheckConstraint::src
string src
the source of the check clause
Definition SqlUtil.qm.dox.h:5876
SqlUtil::AbstractCheckConstraint::equalImpl
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractCheckConstraint::constructor
constructor(string n, string n_src)
creates the object and sets its name and the check clause source
SqlUtil::AbstractCheckConstraint::setIndexBase
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
SqlUtil::AbstractCheckConstraint::clearIndex
clearIndex()
clears any index base for the constraint
SqlUtil::AbstractColumnConstraint
the API for a constraint with columns
Definition SqlUtil.qm.dox.h:5898
SqlUtil::AbstractColumnConstraint::index
*string index
the index supporting the constraint
Definition SqlUtil.qm.dox.h:5903
SqlUtil::AbstractColumnConstraint::clearIndex
clearIndex()
clears any index base for the constraint
SqlUtil::AbstractColumnConstraint::constructor
constructor(string name, *hash< auto > cols, *string index)
creates the object from the name and a hash of column information
SqlUtil::AbstractColumnConstraint::setIndexBase
bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
SqlUtil::AbstractColumnConstraint::hasColumn
bool hasColumn(string cname)
returns True if the constraint references the named column
SqlUtil::AbstractColumn
the base class for column information
Definition SqlUtil.qm.dox.h:5502
SqlUtil::AbstractColumn::equalImpl
abstract bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractColumn::getRenameSql
abstract string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
SqlUtil::AbstractColumn::getDescriptionHash
hash< GenericColumnInfo > getDescriptionHash()
Returns a description hash of the column.
SqlUtil::AbstractColumn::native_type
string native_type
the native type name of the column
Definition SqlUtil.qm.dox.h:5506
SqlUtil::AbstractColumn::getModifySqlImpl
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
SqlUtil::AbstractColumn::comment
*string comment
comment on the column
Definition SqlUtil.qm.dox.h:5521
SqlUtil::AbstractColumn::def_val
*string def_val
default value for column
Definition SqlUtil.qm.dox.h:5518
SqlUtil::AbstractColumn::getModifySql
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...
SqlUtil::AbstractColumn::constructor
constructor()
empty constructor for subclasses
SqlUtil::AbstractColumn::qore_type
*string qore_type
the equivalent qore type name of the column if known
Definition SqlUtil.qm.dox.h:5509
SqlUtil::AbstractColumn::getCreateSql
string getCreateSql(AbstractTable t)
returns an sql string that can be used to add the column to a table
SqlUtil::AbstractColumn::nullable
bool nullable
True if the column can hold a NULL value, False if not
Definition SqlUtil.qm.dox.h:5515
SqlUtil::AbstractColumn::equal
bool equal(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractColumn::DefaultVarcharSize
const DefaultVarcharSize
Default VARCHAR column size.
Definition SqlUtil.qm.dox.h:5527
SqlUtil::AbstractColumn::getNativeTypeString
string getNativeTypeString()
returns the string describing the native type that can be used in SQL
SqlUtil::AbstractColumn::size
int size
the size of the column
Definition SqlUtil.qm.dox.h:5512
SqlUtil::AbstractColumn::scale
*int scale
the scale for numeric columns
Definition SqlUtil.qm.dox.h:5524
SqlUtil::AbstractColumn::getAddColumnSql
abstract list< auto > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
SqlUtil::AbstractColumn::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the column from the table
SqlUtil::AbstractColumnSupportingConstraint
the API for a constraint with columns
Definition SqlUtil.qm.dox.h:5929
SqlUtil::AbstractColumnSupportingConstraint::getSourceConstraintIterator
Qore::AbstractIterator getSourceConstraintIterator()
returns an iterator through all known source foreign constraints on the current table
SqlUtil::AbstractColumnSupportingConstraint::addSourceConstraint
addSourceConstraint(string tname, AbstractForeignConstraint fk)
adds a foreign constraint source to the unique constraint
SqlUtil::AbstractColumnSupportingConstraint::sourceConstraints
*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:5934
SqlUtil::AbstractColumnSupportingConstraint::renameSourceConstraintTable
renameSourceConstraintTable(string old_name, string new_name)
renames a table in a source constraint
SqlUtil::AbstractColumnSupportingConstraint::getCreateSql
abstract string getCreateSql(string table_name, *hash< auto > opts)
returns a string that can be used to create the constraint in the database
SqlUtil::AbstractColumnSupportingConstraint::findMatchingIndex
findMatchingIndex(*Indexes indexes)
find an index that matches the constraint and marks both objects as related
SqlUtil::AbstractColumnSupportingConstraint::getIndex
*string getIndex()
returns the name of the associated index, if any
SqlUtil::AbstractColumnSupportingConstraint::getDisableReenableSql
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...
SqlUtil::AbstractColumnSupportingConstraint::removeSourceConstraint
removeSourceConstraint(string tname, list< auto > cols)
removes a source constraint
SqlUtil::AbstractColumnSupportingConstraint::equalImpl
bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractColumnSupportingConstraint::constructor
constructor(string name, *hash< auto > cols, *string index)
creates the object from the name and a hash of column information
SqlUtil::AbstractColumnSupportingConstraint::hasColumn
bool hasColumn(string cname)
returns True if the constraint references the named column
SqlUtil::AbstractConstraint
abstract base class for constraints
Definition SqlUtil.qm.dox.h:5810
SqlUtil::AbstractConstraint::setIndexBase
abstract bool setIndexBase(string ix)
returns True if the object supports an index property and is set, False if not
SqlUtil::AbstractConstraint::getDisableSql
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database; if disabli...
SqlUtil::AbstractConstraint::getName
string getName()
returns the constraint name
SqlUtil::AbstractConstraint::constructor
constructor(string n)
creates the object and sets its name
SqlUtil::AbstractConstraint::hasColumn
bool hasColumn(string cname)
returns True if the constraint references the named column
SqlUtil::AbstractConstraint::rename
rename(string n)
renames the constraint
SqlUtil::AbstractConstraint::getRenameSql
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
SqlUtil::AbstractConstraint::clearIndex
abstract clearIndex()
clears any index base for the constraint
SqlUtil::AbstractConstraint::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
SqlUtil::AbstractConstraint::name
string name
the name of the constraint
Definition SqlUtil.qm.dox.h:5817
SqlUtil::AbstractConstraint::equalImpl
abstract bool equalImpl(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractConstraint::equal
bool equal(AbstractConstraint c)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractConstraint::getEnableSql
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 ...
SqlUtil::AbstractConstraint::getCreateSql
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the constraint in the database
SqlUtil::AbstractDdlObject
the base class for named objects
Definition SqlUtil.qm.dox.h:5476
SqlUtil::AbstractDdlObject::constructor
constructor()
empty constructor for subclasses
SqlUtil::AbstractDdlObject::getDdlName
abstract string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
SqlUtil::AbstractDdlObject::ddl_name
string ddl_name
the name of the object for DDL (in case it's a reserved word)
Definition SqlUtil.qm.dox.h:5483
SqlUtil::AbstractDdlObject::name
string name
the name of the object
Definition SqlUtil.qm.dox.h:5480
SqlUtil::AbstractForeignConstraint
the base class for foreign key constraint information
Definition SqlUtil.qm.dox.h:6093
SqlUtil::AbstractForeignConstraint::equalImpl
bool equalImpl(AbstractConstraint con)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractForeignConstraint::target
ForeignConstraintTarget target
a ForeignConstraintTarget object to describe the target table and columns
Definition SqlUtil.qm.dox.h:6097
SqlUtil::AbstractForeignConstraint::hasTargetColumn
bool hasTargetColumn(string col)
Returns True if the constraint refers to the given target column.
SqlUtil::AbstractFunctionBase
base class for function or objects with code
Definition SqlUtil.qm.dox.h:6186
SqlUtil::AbstractFunctionBase::getNormalizedSource
string getNormalizedSource(string src)
returns normalized source for comparisons
SqlUtil::AbstractFunctionBase::name
string name
the name of the object
Definition SqlUtil.qm.dox.h:6190
SqlUtil::AbstractFunctionBase::equalImpl
abstract bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractFunctionBase::constructor
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
SqlUtil::AbstractFunctionBase::getDropSql
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the function from the database
SqlUtil::AbstractFunctionBase::equal
bool equal(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractFunctionBase::src
string src
the source of the object
Definition SqlUtil.qm.dox.h:6196
SqlUtil::AbstractFunctionBase::type
string type
the type of object
Definition SqlUtil.qm.dox.h:6193
SqlUtil::AbstractFunctionBase::getType
string getType()
returns the type of object
SqlUtil::AbstractFunction
base class for functions
Definition SqlUtil.qm.dox.h:6231
SqlUtil::AbstractFunction::getRenameSql
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
SqlUtil::AbstractFunction::setName
setName(string new_name)
sets the new name of the object
SqlUtil::AbstractFunction::getCreateSql
abstract list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that can be used to create the function in the database
SqlUtil::AbstractFunction::constructor
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
SqlUtil::AbstractHashContainer
abstract container class that throws an exception if an unknown key is accessed
Definition SqlUtil.qm.dox.h:4862
SqlUtil::AbstractHashContainer::partialMatchKeys
bool partialMatchKeys(hash h1)
returns True if the hash argument has at least the same keys (in any order, can have more keys),...
SqlUtil::AbstractHashContainer::pairIterator
Qore::AbstractIterator pairIterator()
Returns a HashPairIterator object for the contained hash.
SqlUtil::AbstractHashContainer::hasKeyValue
bool hasKeyValue(string k)
Returns True if the key exists in the contained hash and is assigned a value, False if not.
SqlUtil::AbstractHashContainer::take
abstract auto take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::AbstractHashContainer::firstKey
*string firstKey()
Returns the first key name in the contained hash or nothing if the contained hash has no keys.
SqlUtil::AbstractHashContainer::iterator
Qore::AbstractIterator iterator()
Returns a HashIterator object for the contained hash.
SqlUtil::AbstractHashContainer::memberGate
auto memberGate(string k)
returns the value of the given key in the contained hash if it exists, otherwise throws a KEY-ERROR e...
SqlUtil::AbstractHashContainer::hasKey
bool hasKey(string k)
Returns True if the key exists in the contained hash (may or may not be assigned a value),...
SqlUtil::AbstractHashContainer::renameKey
renameKey(string old_name, string new_name)
renames the given key; maintains the key order
SqlUtil::AbstractHashContainer::values
list< auto > values()
Returns a list of values of the contained hash.
SqlUtil::AbstractHashContainer::lastKey
*string lastKey()
Returns the last key name in the contained hash or nothing if the contained hash has no keys.
SqlUtil::AbstractHashContainer::getHash
*hash< auto > getHash()
returns the hash contained by this object
SqlUtil::AbstractHashContainer::clear
clear()
purges the contained data
SqlUtil::AbstractHashContainer::matchKeys
bool matchKeys(hash h1)
returns True if the hash argument has the same keys (in any order), False if not
SqlUtil::AbstractHashContainer::h
*hash h
the data to be contained
Definition SqlUtil.qm.dox.h:4869
SqlUtil::AbstractHashContainer::getElementName
abstract string getElementName()
must return the name of the contained element
SqlUtil::AbstractHashContainer::keys
list< string > keys()
Returns a list of key names of the contained hash.
SqlUtil::AbstractHashContainer::keyIterator
Qore::AbstractIterator keyIterator()
Returns a HashKeyIterator object for the contained hash.
SqlUtil::AbstractHashContainer::size
int size()
Returns the number of keys in the contained hash.
SqlUtil::AbstractHashContainer::constructor
constructor(*hash nh)
creates the object with the hash argument passed
SqlUtil::AbstractHashContainer::empty
bool empty()
returns True if the container is empty, False if not
SqlUtil::AbstractHashContainer::val
bool val()
Returns False if the contained hash has no keys, True if it does.
SqlUtil::AbstractHashContainer::copy
copy(AbstractHashContainer old)
creates a "deep copy" of the object
SqlUtil::AbstractIndex
the abstract base class for index information
Definition SqlUtil.qm.dox.h:5680
SqlUtil::AbstractIndex::equalExceptName
bool equalExceptName(AbstractIndex ix)
returns True if the argument is equal to the current index with the exception of the name,...
SqlUtil::AbstractIndex::hasColumn
bool hasColumn(string cname)
returns True if the constraint references the named column
SqlUtil::AbstractIndex::foreign_constraint
*AbstractForeignConstraint foreign_constraint
Any foreign constraint that this index supports.
Definition SqlUtil.qm.dox.h:5697
SqlUtil::AbstractIndex::equalImpl
abstract bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
SqlUtil::AbstractIndex::setForeignConstraint
setForeignConstraint()
clears the supporting constraint
SqlUtil::AbstractIndex::getSupportingConstraint
*AbstractColumnSupportingConstraint getSupportingConstraint()
returns the supporting constraint, if any
SqlUtil::AbstractIndex::getCreateSql
abstract string getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the index in the database
SqlUtil::AbstractIndex::name
string name
the name of the index
Definition SqlUtil.qm.dox.h:5684
SqlUtil::AbstractIndex::getForeignConstraint
*AbstractForeignConstraint getForeignConstraint()
returns the supporting constraint, if any
SqlUtil::AbstractIndex::constructor
constructor(string n, bool u, hash c)
creates the object from the name, a unique flag, and a hash of column information
SqlUtil::AbstractIndex::unique
bool unique
True if the index is a unique index, False if not
Definition SqlUtil.qm.dox.h:5687
SqlUtil::AbstractIndex::constraint
*AbstractColumnSupportingConstraint constraint
the AbstractColumnSupportingConstraint that this index supports, if any
Definition SqlUtil.qm.dox.h:5694
SqlUtil::AbstractIndex::getName
string getName()
returns the index name
SqlUtil::AbstractIndex::setSupportingConstraint
setSupportingConstraint()
clears the supporting constraint
SqlUtil::AbstractIndex::equal
bool equal(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
SqlUtil::AbstractIndex::getAllSupportingConstraints
*list< AbstractColumnConstraint > getAllSupportingConstraints()
returns all supporting constraints, if any
SqlUtil::AbstractIndex::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the index from the database
SqlUtil::AbstractIndex::getRenameSql
abstract string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
SqlUtil::AbstractIndex::columns
Columns columns
an object of class Columns representing the columns in the index
Definition SqlUtil.qm.dox.h:5690
SqlUtil::AbstractIndex::getRecreateSql
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,...
SqlUtil::AbstractListContainer
abstract container class that throws an exception if an unknown key is accessed
Definition SqlUtil.qm.dox.h:5143
SqlUtil::AbstractListContainer::getList
list< auto > getList()
returns the list contained by this object
SqlUtil::AbstractListContainer::empty
bool empty()
returns True if the container is empty, False if not
SqlUtil::AbstractListContainer::get
abstract auto get(softint i)
returns the value of the given element in the contained list if it exists, otherwise throws an ELEMEN...
SqlUtil::AbstractListContainer::take
auto take(int i)
removes the given element from the contained list and returns the value
SqlUtil::AbstractListContainer::add
add(auto val)
adds the given value to the list
SqlUtil::AbstractListContainer::val
bool val()
Returns False if the contained list is empty, True if not.
SqlUtil::AbstractListContainer::getElementName
abstract string getElementName()
must return the name of the contained element
SqlUtil::AbstractListContainer::constructor
constructor(softlist nl)
creates the object with the list<auto> argument passed
SqlUtil::AbstractListContainer::iterator
Qore::ListIterator iterator()
Returns a ListIterator object for the contained list.
SqlUtil::AbstractListContainer::size
int size()
Returns the number of elements in the contained list.
SqlUtil::AbstractPrimaryKey
represents a primary key
Definition SqlUtil.qm.dox.h:6012
SqlUtil::AbstractSequence
base class for sequences
Definition SqlUtil.qm.dox.h:6114
SqlUtil::AbstractSequence::max
*number max
the ending number
Definition SqlUtil.qm.dox.h:6127
SqlUtil::AbstractSequence::name
string name
the name of the sequence
Definition SqlUtil.qm.dox.h:6118
SqlUtil::AbstractSequence::getDropSql
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the sequence from the database
SqlUtil::AbstractSequence::getRenameSql
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
SqlUtil::AbstractSequence::getCreateSql
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the sequence in the database
SqlUtil::AbstractSequence::start
number start
the starting number
Definition SqlUtil.qm.dox.h:6121
SqlUtil::AbstractSequence::increment
number increment
the increment
Definition SqlUtil.qm.dox.h:6124
SqlUtil::AbstractSequence::constructor
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_max)
creates the object from the arguments
SqlUtil::AbstractTable
the base abstract class for the table implementation
Definition AbstractTable.qc.dox.h:30
SqlUtil::AbstractTrigger
the base class for triggers
Definition SqlUtil.qm.dox.h:6295
SqlUtil::AbstractTrigger::getRenameSql
abstract softlist< auto > getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
SqlUtil::AbstractTrigger::getDropSql
abstract list< auto > getDropSql(string table_name)
returns a string that can be used to drop the trigger in the database
SqlUtil::AbstractTrigger::constructor
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
SqlUtil::AbstractTrigger::getCreateSql
abstract list< auto > getCreateSql(string table_name, *hash< auto > opt)
returns a string that can be used to create the trigger in the database
SqlUtil::AbstractUniqueConstraint
represents a unique column constraint
Definition SqlUtil.qm.dox.h:6003
SqlUtil::AbstractUniqueConstraint::constructor
constructor(string n, *hash< auto > c, *string n_index)
creates the object from the name an a hash of column information
SqlUtil::AbstractView
base class for views
Definition SqlUtil.qm.dox.h:6150
SqlUtil::AbstractView::updatable
bool updatable
Flag showing if is the view updatable with DML commands.
Definition SqlUtil.qm.dox.h:6163
SqlUtil::AbstractView::name
string name
the name of the sequence
Definition SqlUtil.qm.dox.h:6157
SqlUtil::AbstractView::getRenameSql
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
SqlUtil::AbstractView::constructor
constructor(string n_name, string n_src)
creates the object from the arguments
SqlUtil::AbstractView::src
string src
the source code
Definition SqlUtil.qm.dox.h:6160
SqlUtil::AbstractView::getDropSql
string getDropSql(*hash< auto > opt)
returns a string that can be used to drop the view from the database
SqlUtil::AbstractView::getCreateSql
abstract string getCreateSql(*hash< auto > opt)
returns a string that can be used to create the view in the database
SqlUtil::Columns
column container class that throws an exception if an unknown column is accessed
Definition SqlUtil.qm.dox.h:5420
SqlUtil::Columns::equal
bool equal(Columns cols)
returns True if the argument has the same columns in the same order as the current object,...
SqlUtil::Columns::add
add(string k, AbstractColumn val)
adds the given value to the hash with the given key name
SqlUtil::Columns::subset
Columns subset(softlist l)
returns a subset of the current columns according to the list<auto> argument
SqlUtil::Columns::getElementName
string getElementName()
returns "column" since this object stores column objects
SqlUtil::Columns::getSqlColumnNameIterator
AbstractIterator getSqlColumnNameIterator()
returns an iterator for column SQL names
SqlUtil::Columns::memberGate
AbstractColumn memberGate(string k)
returns the AbstractColumn object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::Columns::take
AbstractColumn take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::Columns::constructor
constructor(*hash c)
creates the object from the argument
SqlUtil::Constraints
constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:5768
SqlUtil::Constraints::memberGate
AbstractConstraint memberGate(string k)
returns the AbstractConstraint object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::Constraints::take
AbstractConstraint take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::Constraints::findEqualUniqueConstraint
*AbstractUniqueConstraint findEqualUniqueConstraint(AbstractUniqueConstraint uk)
finds a unique constraint with the same columns as the unique constraint passed
SqlUtil::Constraints::add
add(string k, AbstractConstraint val)
adds the given value to the hash with the given key name
SqlUtil::ForeignConstraintTarget
a class describing a foreign constraint target
Definition SqlUtil.qm.dox.h:6070
SqlUtil::ForeignConstraintTarget::constructor
constructor(string t, Columns c)
creates the object and sets the target table name and the target columns
SqlUtil::ForeignConstraintTarget::equal
bool equal(ForeignConstraintTarget targ)
returns True if the argument is equal to the current object, False if not
SqlUtil::ForeignConstraintTarget::columns
Columns columns
columns in the target table
Definition SqlUtil.qm.dox.h:6077
SqlUtil::ForeignConstraintTarget::hasColumn
bool hasColumn(string cname)
returns True if the constraint references the named column
SqlUtil::ForeignConstraintTarget::table
string table
the name of the target table
Definition SqlUtil.qm.dox.h:6074
SqlUtil::ForeignConstraints
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:6023
SqlUtil::ForeignConstraints::take
AbstractForeignConstraint take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::ForeignConstraints::findEqual
*AbstractForeignConstraint findEqual(AbstractForeignConstraint fk)
find an index with columns equal to the index passed
SqlUtil::ForeignConstraints::add
add(string k, AbstractForeignConstraint val)
adds the given value to the hash with the given key name
SqlUtil::ForeignConstraints::getElementName
string getElementName()
returns "foreign constraint" for the type of object encapsulated
SqlUtil::ForeignConstraints::findConstraintOn
*hash< auto > findConstraintOn(string table, softlist< auto > cols)
returns either a hash of AbstractColumn information or nothing if no foreign constraint can be found ...
SqlUtil::ForeignConstraints::memberGate
AbstractForeignConstraint memberGate(string k)
returns the AbstractForeignConstraint object corresponding to the key given or throws a KEY-ERROR exc...
SqlUtil::Functions
function container class that throws an exception if an unknown function is accessed
Definition SqlUtil.qm.dox.h:6257
SqlUtil::Functions::add
add(string k, AbstractFunction val)
adds the given value to the hash with the given key name
SqlUtil::Functions::take
AbstractFunction take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::Functions::memberGate
AbstractFunction memberGate(string k)
returns the AbstractFunction object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::Indexes
index container class that throws an exception if an unknown index is accessed
Definition SqlUtil.qm.dox.h:5634
SqlUtil::Indexes::take
AbstractIndex take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::Indexes::tryTake
*AbstractIndex tryTake(string k)
tries to remove the given key from the contained hash and returns the value if it exists
SqlUtil::Indexes::findEqual
*AbstractIndex findEqual(AbstractIndex ix)
find an index with columns equal to the index passed
SqlUtil::Indexes::add
add(string k, AbstractIndex val)
adds the given value to the hash with the given key name
SqlUtil::Indexes::memberGate
AbstractIndex memberGate(string k)
returns the AbstractIndex object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::Table
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition Table.qc.dox.h:44
SqlUtil::Tables
the table container class stores a collection of tables in a schema
Definition SqlUtil.qm.dox.h:5232
SqlUtil::Tables::memberGate
AbstractTable memberGate(string k)
returns the AbstractTable object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::Tables::dropIterator
Qore::AbstractIterator dropIterator()
returns an iterator for a list of cached table names in the order that can be used to drop the tables...
SqlUtil::Tables::populate
populate(AbstractDatasource ds, hash< auto > tables, *hash< auto > opt)
populates the object from a hash<auto> description
SqlUtil::Tables::getDropAllForeignConstraintsOnTableSql
*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...
SqlUtil::Tables::getDropList
list< auto > getDropList()
returns a list of cached table names in the order that can be used to drop the tables,...
SqlUtil::Tables::tableRenamed
bool tableRenamed(string old_name, string new_name, string old_sql_name)
updates table names and internal references for renamed tables
SqlUtil::Tables::add
add(string k, Table val)
adds the given value to the hash with the given key name
SqlUtil::Tables::take
AbstractTable take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::Tables::getIfExists
*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,...
SqlUtil::Tables::getDropConstraintIfExistsSql
*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...
SqlUtil::Tables::getRenameTableIfExistsSql
*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...
SqlUtil::Tables::getElementName
string getElementName()
returns "table" since this object stores AbstractTable objects
SqlUtil::Tables::constructor
constructor()
creates an empty object
SqlUtil::Tables::get
AbstractTable get(AbstractDatasource ds, string name)
gets a table from the database or from the cache if already cached
SqlUtil::Triggers
trigger container class that throws an exception if an unknown trigger is accessed
Definition SqlUtil.qm.dox.h:6313
SqlUtil::Triggers::memberGate
AbstractTrigger memberGate(string k)
returns the AbstractTrigger object corresponding to the key given or throws a KEY-ERROR exception
SqlUtil::Triggers::take
AbstractTrigger take(string k)
removes the given key from the contained hash and returns the value
SqlUtil::Triggers::add
add(string k, AbstractTrigger val)
adds the given value to the hash with the given key name
SqlUtil::SZ_NONE
const SZ_NONE
Definition SqlUtil.qm.dox.h:2472
SqlUtil::SZ_NUM
const SZ_NUM
the data type is numeric so takes an optional precision and scale
Definition SqlUtil.qm.dox.h:2481
SqlUtil::SZ_MAND
const SZ_MAND
the data type takes a mandatory size parameter
Definition SqlUtil.qm.dox.h:2475
SqlUtil::SZ_OPT
const SZ_OPT
the data type takes an optional size parameter
Definition SqlUtil.qm.dox.h:2478
SqlUtil::CLOB
const CLOB
specifies a large variable-length character column (ie CLOB or TEXT, etc)
Definition SqlUtil.qm.dox.h:2464
SqlUtil::DB_SYNONYMS
const DB_SYNONYMS
Feature: synonyms.
Definition SqlUtil.qm.dox.h:2444
SqlUtil::DB_PACKAGES
const DB_PACKAGES
Feature: packages.
Definition SqlUtil.qm.dox.h:2432
SqlUtil::VARCHAR
const VARCHAR
Definition SqlUtil.qm.dox.h:2452
SqlUtil::DB_MVIEWS
const DB_MVIEWS
Feature: materialized views / snapshots.
Definition SqlUtil.qm.dox.h:2430
SqlUtil::BLOB
const BLOB
specifies a large variable-length binary column (ie BLOB or BYTEA, etc)
Definition SqlUtil.qm.dox.h:2461
SqlUtil::DB_PROCEDURES
const DB_PROCEDURES
Feature: procedures.
Definition SqlUtil.qm.dox.h:2434
SqlUtil::DB_TABLES
const DB_TABLES
Feature: tables.
Definition SqlUtil.qm.dox.h:2438
SqlUtil::DB_VIEWS
const DB_VIEWS
Feature: views.
Definition SqlUtil.qm.dox.h:2442
SqlUtil::CHAR
const CHAR
specifies a CHAR column
Definition SqlUtil.qm.dox.h:2458
SqlUtil::NUMERIC
const NUMERIC
specifies a numeric column (equivalent to Qore::Type::Number)
Definition SqlUtil.qm.dox.h:2455
SqlUtil::DB_FUNCTIONS
const DB_FUNCTIONS
Feature: functions.
Definition SqlUtil.qm.dox.h:2428
SqlUtil::DB_SEQUENCES
const DB_SEQUENCES
Feature: sequences.
Definition SqlUtil.qm.dox.h:2436
SqlUtil::DB_TYPES
const DB_TYPES
Feature: named types.
Definition SqlUtil.qm.dox.h:2440
SqlUtil::cop_plus
hash< ColumnOperatorInfo > cop_plus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "+" operator with the given arguments
SqlUtil::cop_year
hash< ColumnOperatorInfo > cop_year(auto column)
returns a ColumnOperatorInfo hash for the "year" operator with the given argument
SqlUtil::cop_as
hash< ColumnOperatorInfo > cop_as(auto column, string arg)
returns a ColumnOperatorInfo hash for the "as" operator with the given argument
SqlUtil::cop_seq_currval
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...
SqlUtil::cop_year_day
hash< ColumnOperatorInfo > cop_year_day(auto column)
returns a ColumnOperatorInfo hash for the "year_day" operator with the given argument
SqlUtil::cop_year_month
hash< ColumnOperatorInfo > cop_year_month(auto column)
returns a ColumnOperatorInfo hash for the "year_month" operator with the given argument
SqlUtil::cop_count
hash< ColumnOperatorInfo > cop_count(auto column='')
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts
SqlUtil::cop_append
hash< ColumnOperatorInfo > cop_append(auto column, string arg)
returns a ColumnOperatorInfo hash for the "append" operator with the given argument
SqlUtil::cop_coalesce
hash< ColumnOperatorInfo > cop_coalesce(auto col1, auto col2)
returns a ColumnOperatorInfo hash for the "coalesce" operator with the given column arguments; the fi...
SqlUtil::cop_dense_rank
hash< ColumnOperatorInfo > cop_dense_rank()
Analytic/window function: rank of the current row without gaps.
SqlUtil::cop_length
hash< ColumnOperatorInfo > cop_length(auto column)
returns a ColumnOperatorInfo hash for the "len" operator with the given argument; returns the length ...
SqlUtil::cop_lower
hash< ColumnOperatorInfo > cop_lower(auto column)
returns a ColumnOperatorInfo hash for the "lower" operator with the given argument; returns a column ...
SqlUtil::cop_multiply
hash< ColumnOperatorInfo > cop_multiply(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "*" operator with the given arguments
SqlUtil::cop_seq
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence ...
SqlUtil::cop_value
hash< ColumnOperatorInfo > cop_value(auto arg)
returns a ColumnOperatorInfo hash for the "value" (literal) operator with the given argument
SqlUtil::cop_last_value
hash< ColumnOperatorInfo > cop_last_value(any column)
Analytic/window function: value evaluated at the row that is the last row of the window frame.
SqlUtil::cop_prepend
hash< ColumnOperatorInfo > cop_prepend(auto column, string arg)
returns a ColumnOperatorInfo hash for the "prepend" operator with the given argument
SqlUtil::cop_rank
hash< ColumnOperatorInfo > cop_rank()
Analytic/window function: rank of the current row with gaps.
SqlUtil::cop_min
hash< ColumnOperatorInfo > cop_min(auto column)
returns a ColumnOperatorInfo hash for the "min" operator; returns minimum column values
SqlUtil::cop_row_number
hash< ColumnOperatorInfo > cop_row_number()
Analytic/window function: number of the current row within its partition, counting from 1.
SqlUtil::cop_cume_dist
hash< ColumnOperatorInfo > cop_cume_dist()
Analytic/window function: relative rank of the current row.
SqlUtil::cop_cast
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)
SqlUtil::cop_upper
hash< ColumnOperatorInfo > cop_upper(auto column)
returns a ColumnOperatorInfo hash for the "upper" operator with the given argument; returns a column ...
SqlUtil::cop_avg
hash< ColumnOperatorInfo > cop_avg(auto column)
returns a ColumnOperatorInfo hash for the "avg" operator; returns average column values
SqlUtil::cop_percent_rank
hash< ColumnOperatorInfo > cop_percent_rank()
Analytic/window function: relative rank of the current row.
SqlUtil::cop_substr
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...
SqlUtil::cop_sum
hash< ColumnOperatorInfo > cop_sum(auto column)
returns a ColumnOperatorInfo hash for the "sum" operator; returns the total sum of a numeric column.
SqlUtil::cop_distinct
hash< ColumnOperatorInfo > cop_distinct(auto column)
returns a ColumnOperatorInfo hash for the "distinct" operator with the given argument; returns distin...
SqlUtil::cop_minus
hash< ColumnOperatorInfo > cop_minus(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "-" operator with the given arguments
SqlUtil::cop_over
hash< ColumnOperatorInfo > cop_over(auto column, *string partitionby, *string orderby)
returns a ColumnOperatorInfo hash for the "over" clause
SqlUtil::make_cop
hash< ColumnOperatorInfo > make_cop(string cop, auto column, auto arg)
SqlUtil::cop_divide
hash< ColumnOperatorInfo > cop_divide(auto column1, auto column2)
returns a ColumnOperatorInfo hash for the "/" operator with the given arguments
SqlUtil::cop_ntile
hash< ColumnOperatorInfo > cop_ntile(int value)
Analytic/window function: integer ranging from 1 to the argument value, dividing the partition as equ...
SqlUtil::cop_first_value
hash< ColumnOperatorInfo > cop_first_value(any column)
Analytic/window function: value evaluated at the row that is the first row of the window frame.
SqlUtil::cop_max
hash< ColumnOperatorInfo > cop_max(auto column)
returns a ColumnOperatorInfo hash for the "max" operator; returns maximum column values
SqlUtil::cop_year_hour
hash< ColumnOperatorInfo > cop_year_hour(auto column)
returns a ColumnOperatorInfo hash for the "year_hour" operator with the given argument
SqlUtil::cop_trunc_date
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...
SqlUtil::DT_YEAR
const DT_YEAR
Definition SqlUtil.qm.dox.h:3600
SqlUtil::DT_MINUTE
const DT_MINUTE
Format unit: minute.
Definition SqlUtil.qm.dox.h:3612
SqlUtil::DT_SECOND
const DT_SECOND
Format unit: hour.
Definition SqlUtil.qm.dox.h:3615
SqlUtil::DT_MONTH
const DT_MONTH
Format unit: month.
Definition SqlUtil.qm.dox.h:3603
SqlUtil::DT_HOUR
const DT_HOUR
Format unit: hour.
Definition SqlUtil.qm.dox.h:3609
SqlUtil::DT_DAY
const DT_DAY
Format unit: day.
Definition SqlUtil.qm.dox.h:3606
SqlUtil::COP_MAX
const COP_MAX
to return the maximum value
Definition SqlUtil.qm.dox.h:2536
SqlUtil::COP_OVER
const COP_OVER
the SQL "over" clause
Definition SqlUtil.qm.dox.h:2556
SqlUtil::COP_SEQ_CURRVAL
const COP_SEQ_CURRVAL
to return the last value of a sequence issued in the same session
Definition SqlUtil.qm.dox.h:2606
SqlUtil::COP_LENGTH
const COP_LENGTH
to get the length of a text field
Definition SqlUtil.qm.dox.h:2623
SqlUtil::COP_RANK
const COP_RANK
Analytic (window) function: RANK.
Definition SqlUtil.qm.dox.h:2681
SqlUtil::COP_VALUE
const COP_VALUE
to append a constant value (SQL Literal) to use as an output column value
Definition SqlUtil.qm.dox.h:2511
SqlUtil::COP_COALESCE
const COP_COALESCE
to return the first non-null argument in the list
Definition SqlUtil.qm.dox.h:2611
SqlUtil::COP_MIN
const COP_MIN
to return the minimum value
Definition SqlUtil.qm.dox.h:2531
SqlUtil::COP_YEAR_HOUR
const COP_YEAR_HOUR
to return a date value with year to hextern information
Definition SqlUtil.qm.dox.h:2596
SqlUtil::COP_DIVIDE
const COP_DIVIDE
the SQL "divide" operator
Definition SqlUtil.qm.dox.h:2571
SqlUtil::COP_YEAR
const COP_YEAR
to return a date value with year information only
Definition SqlUtil.qm.dox.h:2581
SqlUtil::COP_COUNT
const COP_COUNT
to return the row count
Definition SqlUtil.qm.dox.h:2551
SqlUtil::COP_MULTIPLY
const COP_MULTIPLY
the SQL "multiply" operator
Definition SqlUtil.qm.dox.h:2576
SqlUtil::COP_AVG
const COP_AVG
to return the average value
Definition SqlUtil.qm.dox.h:2541
SqlUtil::COP_PLUS
const COP_PLUS
the SQL "plus" operator
Definition SqlUtil.qm.dox.h:2566
SqlUtil::COP_CUME_DIST
const COP_CUME_DIST
Analytic (window) function: CUME_DIST.
Definition SqlUtil.qm.dox.h:2639
SqlUtil::COP_SUBSTR
const COP_SUBSTR
to extract a substring from a column
Definition SqlUtil.qm.dox.h:2616
SqlUtil::COP_SEQ
const COP_SEQ
to return the next value of a sequence
Definition SqlUtil.qm.dox.h:2601
SqlUtil::COP_APPEND
const COP_APPEND
to append a string to a column on output
Definition SqlUtil.qm.dox.h:2506
SqlUtil::COP_PERCENT_RANK
const COP_PERCENT_RANK
Analytic (window) function: PERCENT_RANK.
Definition SqlUtil.qm.dox.h:2674
SqlUtil::COP_NTILE
const COP_NTILE
Analytic (window) function: NTILE.
Definition SqlUtil.qm.dox.h:2667
SqlUtil::COP_YEAR_MONTH
const COP_YEAR_MONTH
to return a date value with year to month information
Definition SqlUtil.qm.dox.h:2586
SqlUtil::COP_PREPEND
const COP_PREPEND
to prepend a string to a column on output
Definition SqlUtil.qm.dox.h:2501
SqlUtil::COP_LOWER
const COP_LOWER
to return column value in lower case
Definition SqlUtil.qm.dox.h:2521
SqlUtil::COP_AS
const COP_AS
Definition SqlUtil.qm.dox.h:2491
SqlUtil::COP_CAST
const COP_CAST
to convert column value into another datatype
Definition SqlUtil.qm.dox.h:2496
SqlUtil::COP_ROW_NUMBER
const COP_ROW_NUMBER
Analytic (window) function: ROW_NUMBER.
Definition SqlUtil.qm.dox.h:2688
SqlUtil::COP_YEAR_DAY
const COP_YEAR_DAY
to return a date value with year to day information
Definition SqlUtil.qm.dox.h:2591
SqlUtil::COP_UPPER
const COP_UPPER
to return column value in upper case
Definition SqlUtil.qm.dox.h:2516
SqlUtil::COP_DENSE_RANK
const COP_DENSE_RANK
Analytic (window) function: DENSE_RANK.
Definition SqlUtil.qm.dox.h:2646
SqlUtil::COP_TRUNC_DATE
const COP_TRUNC_DATE
to return the date with truncated value
Definition SqlUtil.qm.dox.h:2632
SqlUtil::COP_MINUS
const COP_MINUS
the SQL "minus" operator
Definition SqlUtil.qm.dox.h:2561
SqlUtil::COP_LAST_VALUE
const COP_LAST_VALUE
Analytic (window) function: LAST_VALUE.
Definition SqlUtil.qm.dox.h:2660
SqlUtil::COP_FIRST_VALUE
const COP_FIRST_VALUE
Analytic (window) function: FIRST_VALUE.
Definition SqlUtil.qm.dox.h:2653
SqlUtil::DefaultCopMap
const DefaultCopMap
a hash of default column operator descriptions
Definition SqlUtil.qm.dox.h:2724
SqlUtil::COP_DISTINCT
const COP_DISTINCT
to return distinct values
Definition SqlUtil.qm.dox.h:2526
SqlUtil::COP_SUM
const COP_SUM
to return the sum value
Definition SqlUtil.qm.dox.h:2546
SqlUtil::make_iop
hash< InsertOperatorInfo > make_iop(string iop, auto arg)
SqlUtil::iop_seq_currval
hash< InsertOperatorInfo > iop_seq_currval(string arg)
returns an InsertOperatorInfo hash for retrieving the current value of the given sequence in insert q...
SqlUtil::iop_seq
hash< InsertOperatorInfo > iop_seq(string arg)
returns an InsertOperatorInfo hash for retrieving the value of the given sequence in insert queries
SqlUtil::IOP_SEQ
const IOP_SEQ
Definition SqlUtil.qm.dox.h:4781
SqlUtil::DefaultIopMap
const DefaultIopMap
a hash of default insert operator descriptions (currently empty, all operators are driver-dependent)
Definition SqlUtil.qm.dox.h:4789
SqlUtil::IOP_SEQ_CURRVAL
const IOP_SEQ_CURRVAL
for using the last value of a sequence issued in the current session
Definition SqlUtil.qm.dox.h:4786
SqlUtil::join_inner_alias
hash< string, hash< JoinOperatorInfo > > join_inner_alias(string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
returns a hash for standard inner joins with the given arguments for use when joining with a table ot...
SqlUtil::join_right
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
SqlUtil::join_right_alias
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...
SqlUtil::join_left
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
SqlUtil::join_left_alias
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 ...
SqlUtil::make_jop
hash< string, hash< JoinOperatorInfo > > make_jop(string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash< auto > opt)
SqlUtil::join_inner
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
SqlUtil::JopMap
const JopMap
a hash of valid join operators
Definition SqlUtil.qm.dox.h:3837
SqlUtil::JOP_INNER
const JOP_INNER
Definition SqlUtil.qm.dox.h:3824
SqlUtil::JOP_RIGHT
const JOP_RIGHT
for right outer joins
Definition SqlUtil.qm.dox.h:3834
SqlUtil::JOP_LEFT
const JOP_LEFT
for left outer joins
Definition SqlUtil.qm.dox.h:3829
SqlUtil::op_ceq
hash< OperatorInfo > op_ceq(string arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
SqlUtil::op_clt
hash< OperatorInfo > op_clt(string arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
SqlUtil::op_between
hash< OperatorInfo > op_between(auto l, auto r)
returns an OperatorInfo hash for the "between" operator with the given arguments, neither of which ca...
SqlUtil::op_cle
hash< OperatorInfo > op_cle(string arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
SqlUtil::op_cne
hash< OperatorInfo > op_cne(string arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
SqlUtil::op_cgt
hash< OperatorInfo > op_cgt(string arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
SqlUtil::op_ne
hash< OperatorInfo > op_ne(auto arg)
returns an OperatorInfo hash for the "!=" or "<>" operator with the given argument for use in where c...
SqlUtil::wop_or
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...
SqlUtil::make_op
hash< OperatorInfo > make_op(string op, auto arg)
SqlUtil::op_lt
hash< OperatorInfo > op_lt(auto arg)
returns an OperatorInfo hash for the "<" operator with the given argument for use in where clauses wh...
SqlUtil::op_substr
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...
SqlUtil::op_like
hash< OperatorInfo > op_like(string str)
returns an OperatorInfo hash for the "like" operator with the given argument for use in where clauses
SqlUtil::op_gt
hash< OperatorInfo > op_gt(auto arg)
returns an OperatorInfo hash for the ">" operator with the given argument for use in where clauses wh...
SqlUtil::op_in_select
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 ...
SqlUtil::op_ge
hash< OperatorInfo > op_ge(auto arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
SqlUtil::op_not
hash< OperatorInfo > op_not(hash arg)
returns an OperatorInfo hash for the "not" operator; for use in where clauses
SqlUtil::op_eq
hash< OperatorInfo > op_eq(auto arg)
returns an OperatorInfo hash for the "=" operator with the given argument for use in where clauses wh...
SqlUtil::op_cge
hash< OperatorInfo > op_cge(string arg)
returns an OperatorInfo hash for the ">=" operator with the given argument for use in where clauses w...
SqlUtil::op_in
hash< OperatorInfo > op_in()
returns an OperatorInfo hash for the "in" operator with all arguments passed to the function; for use...
SqlUtil::op_le
hash< OperatorInfo > op_le(auto arg)
returns an OperatorInfo hash for the "<=" operator with the given argument for use in where clauses w...
SqlUtil::OP_GE
const OP_GE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4328
SqlUtil::OP_NE
const OP_NE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4333
SqlUtil::OP_LE
const OP_LE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4318
SqlUtil::OP_EQ
const OP_EQ
the SQL equals operator (=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4338
SqlUtil::OP_IN
const OP_IN
the SQL "in" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4378
SqlUtil::OP_NOT
const OP_NOT
the SQL "not" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4383
SqlUtil::DefaultExpressionMap
const DefaultExpressionMap
Default expressions to be supported by all SqlUtil modules.
Definition SqlUtil.qm.dox.h:4401
SqlUtil::DefaultOpMap
const DefaultOpMap
a hash of valid operators for use in Where Clauses
Definition SqlUtil.qm.dox.h:4405
SqlUtil::OP_SUBSTR
const OP_SUBSTR
the SQL "substr" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4388
SqlUtil::OP_CGE
const OP_CGE
the SQL greater than or equals operator (>=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4358
SqlUtil::OP_LT
const OP_LT
the SQL less than (<) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4313
SqlUtil::OP_CLE
const OP_CLE
the SQL less than or equals (<=) operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4348
SqlUtil::OP_BETWEEN
const OP_BETWEEN
the SQL "between" operator for use in Where Clauses
Definition SqlUtil.qm.dox.h:4373
SqlUtil::OP_GT
const OP_GT
the SQL greater than operator (>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4323
SqlUtil::OP_CNE
const OP_CNE
the SQL not equals operator (!= or <>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4363
SqlUtil::OP_CLT
const OP_CLT
the SQL less than (<) operator for use in Where Clauses when comparing two columns
Definition SqlUtil.qm.dox.h:4343
SqlUtil::OP_OR
const OP_OR
to combine SQL expressions with "or" for use in Where Clauses
Definition SqlUtil.qm.dox.h:4393
SqlUtil::OP_IN_SELECT
const OP_IN_SELECT
the SQL "in" operator with a select query for use in Where Clauses
Definition SqlUtil.qm.dox.h:4398
SqlUtil::OP_CGT
const OP_CGT
the SQL greater than operator (>) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4353
SqlUtil::OP_CEQ
const OP_CEQ
the SQL equals operator (=) for use in Where Clauses
Definition SqlUtil.qm.dox.h:4368
SqlUtil::OP_LIKE
const OP_LIKE
Definition SqlUtil.qm.dox.h:4308
SqlUtil::uop_plus
hash< UpdateOperatorInfo > uop_plus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "+" operator with the given arguments
SqlUtil::uop_seq_currval
hash< UpdateOperatorInfo > uop_seq_currval(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
SqlUtil::uop_prepend
hash< UpdateOperatorInfo > uop_prepend(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "prepend" operator with the given argument
SqlUtil::uop_seq
hash< UpdateOperatorInfo > uop_seq(string seq)
returns an UpdateOperatorInfo hash for the "seq" operator with the given argument giving the sequence...
SqlUtil::uop_upper
hash< UpdateOperatorInfo > uop_upper(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "upper" operator with the given argument; returns a column...
SqlUtil::uop_divide
hash< UpdateOperatorInfo > uop_divide(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "/" operator with the given arguments
SqlUtil::uop_append
hash< UpdateOperatorInfo > uop_append(string arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "append" or concatenate operator with the given argument
SqlUtil::make_uop
hash< UpdateOperatorInfo > make_uop(string uop, auto arg, *hash< UpdateOperatorInfo > nest)
SqlUtil::uop_substr
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...
SqlUtil::uop_multiply
hash< UpdateOperatorInfo > uop_multiply(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "*" operator with the given arguments
SqlUtil::uop_lower
hash< UpdateOperatorInfo > uop_lower(*hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "lower" operator with the given argument; returns a column...
SqlUtil::uop_minus
hash< UpdateOperatorInfo > uop_minus(auto arg, *hash< UpdateOperatorInfo > nest)
returns an UpdateOperatorInfo hash for the "-" operator with the given arguments
SqlUtil::DefaultUopMap
const DefaultUopMap
Definition SqlUtil.qm.dox.h:3626
SqlUtil
Qore AbstractDatabase class definition.
Definition AbstractDatabase.qc.dox.h:26
SqlUtil::sqlutil_register_ds_deserializer
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::sqlutil_register_ds_serializer
sqlutil_register_ds_serializer(*code new_ds_do)
registers a closure or call reference taking a string type and string datasource configuration that w...
SqlUtil::SqlUtilDrivers
const SqlUtilDrivers
known drivers
Definition SqlUtil.qm.dox.h:4836
SqlUtil::ColumnOperatorInfo
column operator info hash as returned by all column operator functions
Definition SqlUtil.qm.dox.h:2357
SqlUtil::ColumnOperatorInfo::cop
string cop
the column operator string code
Definition SqlUtil.qm.dox.h:2358
SqlUtil::ColumnOperatorInfo::arg
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2360
SqlUtil::ColumnOperatorInfo::column
auto column
column sopecifier, may be a string or a complex hash
Definition SqlUtil.qm.dox.h:2359
SqlUtil::GenericColumnInfo::notnull
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:2343
SqlUtil::GenericColumnInfo::driver
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:2345
SqlUtil::GenericColumnInfo::default_value
auto default_value
the default value for the column
Definition SqlUtil.qm.dox.h:2337
SqlUtil::GenericColumnInfo::scale
softint scale
for numeric data types, this value gives the scale
Definition SqlUtil.qm.dox.h:2335
SqlUtil::GenericColumnInfo::size
softint size
for data types requiring a size component, the size; for numeric columns this represents the precisio...
Definition SqlUtil.qm.dox.h:2333
SqlUtil::GenericColumnInfo::default_value_native
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:2339
SqlUtil::GenericColumnInfo::comment
*string comment
an optional comment for the column
Definition SqlUtil.qm.dox.h:2341
SqlUtil::GenericColumnInfo::qore_type
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:2329
SqlUtil::GenericColumnInfo::native_type
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:2331
SqlUtil::GenericColumnInfo::auto_increment
*bool auto_increment
True for DBs that support an auto-increment column
Definition SqlUtil.qm.dox.h:2347
SqlUtil::InsertOperatorInfo
insert operator info hash as returned by all insert operator functions
Definition SqlUtil.qm.dox.h:2364
SqlUtil::InsertOperatorInfo::_iop
string _iop
the insert operator string code
Definition SqlUtil.qm.dox.h:2365
SqlUtil::InsertOperatorInfo::arg
any arg
optional argument
Definition SqlUtil.qm.dox.h:2366
SqlUtil::JoinOperatorInfo
join operator info hash as returned by all join operator functions
Definition SqlUtil.qm.dox.h:2377
SqlUtil::JoinOperatorInfo::cond
*hash cond
additional conditions for the join clause for the table argument; see Where Clauses for more informat...
Definition SqlUtil.qm.dox.h:2382
SqlUtil::JoinOperatorInfo::alias
*string alias
optional alias for table in the query
Definition SqlUtil.qm.dox.h:2380
SqlUtil::JoinOperatorInfo::ta
*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:2383
SqlUtil::JoinOperatorInfo::table
auto table
the table to join with (either an AbstractTable object or a string table name)
Definition SqlUtil.qm.dox.h:2379
SqlUtil::JoinOperatorInfo::jcols
*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:2381
SqlUtil::JoinOperatorInfo::opt
*hash< auto > opt
optional join options (for example, to specify a partition for the join if supported)
Definition SqlUtil.qm.dox.h:2384
SqlUtil::JoinOperatorInfo::jop
string jop
the join operator string code
Definition SqlUtil.qm.dox.h:2378
SqlUtil::OperatorInfo
SQL operator info hash as returned by all operator functions.
Definition SqlUtil.qm.dox.h:2351
SqlUtil::OperatorInfo::arg
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2353
SqlUtil::OperatorInfo::op
string op
the operator string code
Definition SqlUtil.qm.dox.h:2352
SqlUtil::QueryInfo
Query information.
Definition SqlUtil.qm.dox.h:2691
SqlUtil::QueryInfo::expression_map
*hash< auto > expression_map
The expression map.
Definition SqlUtil.qm.dox.h:2711
SqlUtil::QueryInfo::join_map
*hash< string, AbstractTable > join_map
Tables in this join; table alias -> table.
Definition SqlUtil.qm.dox.h:2702
SqlUtil::QueryInfo::pseudo_column_map
*hash< auto > pseudo_column_map
Any valid pseudocolumns or aliases generated in th query.
Definition SqlUtil.qm.dox.h:2708
SqlUtil::QueryInfo::where_operator_map
*hash< auto > where_operator_map
The old-style backwards-compatible "where operator" map.
Definition SqlUtil.qm.dox.h:2714
SqlUtil::QueryInfo::table
object table
The primary table object.
Definition SqlUtil.qm.dox.h:2693
SqlUtil::QueryInfo::query_hash
*hash< auto > query_hash
The original query hash.
Definition SqlUtil.qm.dox.h:2696
SqlUtil::QueryInfo::column_operator_map
*hash< auto > column_operator_map
Any custom column operator map.
Definition SqlUtil.qm.dox.h:2717
SqlUtil::QueryInfo::args
list< auto > args
arguments to bind in the query generated
Definition SqlUtil.qm.dox.h:2720
SqlUtil::QueryInfo::query_options
*hash< auto > query_options
Any query options.
Definition SqlUtil.qm.dox.h:2699
SqlUtil::QueryInfo::subquery_column_map
*hash< string, bool > subquery_column_map
When executing a superquery, we can only reference colums in the subquery.
Definition SqlUtil.qm.dox.h:2705
SqlUtil::SqlCommandInfo
A hash describing SQL and arguments for an SQL DML command.
Definition SqlUtil.qm.dox.h:2413
SqlUtil::SqlCommandInfo::sql
string sql
the SQL string for the update
Definition SqlUtil.qm.dox.h:2415
SqlUtil::SqlCommandInfo::args
list< auto > args
the arguments for the string
Definition SqlUtil.qm.dox.h:2418
SqlUtil::SqlUtilDataTypeOptionInfo
column data type options
Definition SqlUtil.qm.dox.h:2388
SqlUtil::SqlUtilDataTypeOptionInfo::number_format
*string number_format
optional format string for converting strings to numeric / decimal / number columns
Definition SqlUtil.qm.dox.h:2399
SqlUtil::SqlUtilDataTypeOptionInfo::data_timezone
*TimeZone data_timezone
the timezone when converting dates from external data to the DB's date
Definition SqlUtil.qm.dox.h:2393
SqlUtil::SqlUtilDataTypeOptionInfo::maxlen
*softint maxlen
optional additional limit to the maximum length of the data
Definition SqlUtil.qm.dox.h:2407
SqlUtil::SqlUtilDataTypeOptionInfo::db_timezone
*TimeZone db_timezone
the timezone to use when sending date/time values to the DB
Definition SqlUtil.qm.dox.h:2396
SqlUtil::SqlUtilDataTypeOptionInfo::mandatory
*softbool mandatory
optional flag to overrude any nullable attribute and require data for the column
Definition SqlUtil.qm.dox.h:2402
SqlUtil::SqlUtilDataTypeOptionInfo::date_format
*string date_format
optional format string for converting strings to dates for date / timestamp columns
Definition SqlUtil.qm.dox.h:2390
SqlUtil::UpdateOperatorInfo
update operator info hash as returned by all update operator functions
Definition SqlUtil.qm.dox.h:2370
SqlUtil::UpdateOperatorInfo::nest
*hash nest
option nested operation hash
Definition SqlUtil.qm.dox.h:2373
SqlUtil::UpdateOperatorInfo::arg
auto arg
optional argument
Definition SqlUtil.qm.dox.h:2372
SqlUtil::UpdateOperatorInfo::uop
string uop
the update operator string code
Definition SqlUtil.qm.dox.h:2371