All Classes Namespaces Functions Variables Groups Pages
MysqlSqlUtil.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
// @file MysqlSqlUtil.qm Qore user module for working with MySQL SQL data
/* MysqlSqlUtil.qm Copyright 2013 - 2016 Qore Technologies, sro
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 SqlUtil module
// don't use "$" signs for variables and class members, assume local variable scope
// require type definitions everywhere
// enable all warnings
namespace MysqlSqlUtil {
MysqlTable get_table(AbstractDatasource nds, string nname, *hash opts);
MysqlDatabase get_database(AbstractDatasource nds, *hash opts);
parse_schema_name(string nname, reference schema, reference name);
class MysqlIndex : public SqlUtil::AbstractIndex {
public:
public :
string type;
public:
constructor(string n_name, bool n_unique, hash n_cols, string n_type = "BTREE") ;
string getCreateSql(string table_name, *hash opt);
private bool equalImpl(AbstractIndex ix);
string getRenameSql(string table_name, string new_name);
string getDropSql(string table_name);
};
class MysqlForeignConstraint : public SqlUtil::AbstractForeignConstraint {
public:
constructor(string n, Columns c, ForeignConstraintTarget t) ;
string getCreateSql(string table_name, *hash opt);
softlist getRenameSql(string table_name, string new_name);
string getCreateSql(string name, string table_name, *hash opt);
string getAddSql(string name, string table_name, *hash opt);
string getDropSql(string table_name);
};
class MysqlColumn : public SqlUtil::AbstractColumn {
public:
public :
int byte_size;
public:
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs) ;
softlist getAddColumnSql(AbstractTable t);
string getCreateSql(AbstractTable t);
softlist getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
string getRenameSql(AbstractTable t, string new_name);
private bool equalImpl(AbstractColumn c);
};
class MysqlNumericColumn : public MysqlColumn,public SqlUtil::NumericColumnInfo {
public:
public :
bool unsigned;
bool auto_increment;
// auto-incrememnt columns must be either "unique" or "primary key" in mysql
bool pk = False;
public:
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint n_scale, bool n_unsigned = False, bool n_auto_increment = False, bool n_pk = False) ;
string getNativeTypeString();
private bool equalImpl(AbstractColumn c);
};
class MysqlUniqueConstraintCommon : public SqlUtil::AbstractUniqueConstraint {
public:
constructor();
bool setIndexBase(string ix);
clearIndex();
abstract AbstractIterator keyIterator();
getIndexSql(reference sql, string name, *hash opts);
};
class MysqlUniqueConstraint : public SqlUtil::AbstractUniqueConstraint,public MysqlUniqueConstraintCommon {
public:
constructor(string n, hash n_cols) ;
MysqlColumn memberGate(string k);
string getCreateSql(string table_name, *hash opts);
list getRenameSql(string table_name, string new_name);
string getCreateSql(string name, string table_name, *hash opts);
string getDropSql(string table_name);
};
class MysqlPrimaryKey : public SqlUtil::AbstractPrimaryKey,public MysqlUniqueConstraintCommon {
public:
constructor();
constructor(*hash c) ;
MysqlColumn memberGate(string k);
string getCreateSql(string table_name, *hash opts);
softlist getRenameSql(string table_name, string new_name);
string getDropSql(string table_name);
bool supportsName();
};
class MysqlTrigger : public SqlUtil::AbstractTrigger {
public:
constructor(string n, string n_src) ;
softlist getCreateSql(string table_name, *hash opt);
softlist getDropSql(string table_name);
private bool equalImpl(AbstractFunctionBase t);
softlist getRenameSql(string table_name, string new_name);
};
class MysqlFunction : public SqlUtil::AbstractFunction {
public:
constructor(string n, string n_src) ;
softlist getCreateSql(*hash opt);
string getDropSql();
private bool equalImpl(AbstractFunctionBase t);
softlist getRenameSql(string new_name);
};
class MysqlSequence : public SqlUtil::AbstractSequence {
public:
private :
string table_name;
public:
constructor(string n_table_name, string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
string getCreateSql(*hash opt);
string getRenameSql(string new_name);
string getDropSql();
};
class MysqlView : public SqlUtil::AbstractView {
public:
public :
*string tablecatalog;
*string checkoption;
*string definer;
*string securitytype;
public:
constructor(string n_name, string n_src, *string n_tablecatalog,
*string n_schema,
*string n_checkoption, *string n_definer,
*string n_securitytype, bool n_updatable)
;
string getCreateSql(*hash opt);
softlist getRenameSql(string new_name);
};
class MysqlDatabase : public SqlUtil::AbstractDatabase {
public:
public :
const MysqlOptions = (
"sequence_table": Type::String,
"sequence_function": Type::String,
);
const MysqlSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + MysqlOptions;
const MysqlDatabaseOptions = AbstractDatabase::DatabaseOptions + MysqlOptions;
const MysqlSequenceTable = (
"columns": (
"name": (
"qore_type": SqlUtil::VARCHAR,
"size": 40,
"notnull": True,
),
"id": (
"qore_type": Type::Number,
"size": 14,
"notnull": True,
),
),
);
const MyusqlCreationOptions = AbstractDatabase::CreationOptions;
const MysqlSequenceFunction = "%s(seq_name varchar(40)) returns decimal(14)
begin
update %s set id = last_insert_id(id + 1) where name = seq_name;
return last_insert_id();
end";
const MysqlComputeStatisticsOptions = ComputeStatisticsOptions + (
"no-binlog" : Type::Boolean,
);
const MysqlReclaimSpaceOptions = ReclaimSpaceOptions + (
"no-binlog" : Type::Boolean,
);
public:
private :
string schema;
Datasource seqds;
string sequence_table = "sqlutil_sequences";
string sequence_function = "sqlutil_nextval";
public:
constructor(AbstractDatasource nds, *hash opts) ;
private list featuresImpl();
string getSchemaName();
private AbstractSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
private *AbstractSequence getSequenceImpl(string name);
private *AbstractView getViewImpl(string name);
private MysqlFunction makeFunctionImpl(string name, string src, *hash opts);
private MysqlFunction makeProcedureImpl(string name, string src, *hash opts);
private *AbstractFunction getFunctionImpl(string name);
private:
static string makeParameter(hash row);
public:
private AbstractFunction getProcedureImpl(string name);
private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
private list getAlignSqlImpl(hash schema_hash, *hash opt);
private list listTablesImpl();
private list listFunctionsImpl();
private list listProceduresImpl();
private list listSequencesImpl();
private list listViewsImpl();
private string getCreateSqlImpl(list l);
static string getCreateSql(list l);
private hash getDatabaseOptions();
private hash getSchemaDescriptionOptions();
private hash getComputeStatisticsOptions();
private hash getReclaimSpaceOptions();
private softint getNextSequenceValueImpl(string name);
private softint getCurrentSequenceValueImpl(string name);
private bool supportsSequencesImpl();
private bool supportsTypesImpl();
private bool supportsPackagesImpl();
private bool rebuildIndexImpl(string name, *hash options);
private computeStatisticsImpl(*hash options);
private reclaimSpaceImpl(*hash options);
};
class MysqlTable : public SqlUtil::AbstractTable {
public:
public :
const MysqlTypeMap = (
"decimal": ("qore": Type::Number, "size": SZ_NUM,),
"tinyint": ("qore": Type::Int, "ai": True,),
"smallint": ("qore": Type::Int, "ai": True,),
"mediumint": ("qore": Type::Int, "ai": True,),
"int": ("qore": Type::Int, "ai": True,),
"bigint": ("qore": Type::Int, "ai": True,),
"float": ("qore": Type::Float, "ai": True,),
"double": ("qore": Type::Float, "ai": True,),
"date": ("qore": Type::Date,),
"datetime": ("qore": Type::Date,),
"timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
"time": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
"year": ("qore": Type::Int,),
"char": ("qore": Type::String, "size": SZ_OPT, "size_range": (0, 255)),
"varchar": ("qore": Type::String, "size": SZ_MAND, "size_range": (0, 65535)),
"binary": ("qore": Type::Binary, "size": SZ_OPT, "size_range": (0, 255)),
"varbinary": ("qore": Type::Binary, "size": SZ_MAND, "size_range": (0, 65535)),
"tinytext": ("qore": Type::String,),
"text": ("qore": Type::String,),
"mediumtext": ("qore": Type::String,),
"longtext": ("qore": Type::String,),
"tinyblob": ("qore": Type::Binary,),
"blob": ("qore": Type::Binary,),
"mediumblob": ("qore": Type::Binary,),
"longblob": ("qore": Type::Binary,),
"bit": ("qore": Type::Int,),
);
const QoreTypeMap = (
"integer": "bigint",
"float": "double",
"number": "decimal",
"string": "varchar",
"date": "datetime",
"binary": "varbinary",
"bool": "tinyint",
SqlUtil::CHAR: "char",
SqlUtil::CLOB: "mediumtext",
SqlUtil::BLOB: "mediumblob",
);
const MysqlTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions + (
"engine": Type::String,
);
const MysqlColumnDescOptions = AbstractTable::ColumnDescOptions + (
"unsigned": Type::Boolean,
"auto_increment": Type::Boolean,
"pk": Type::Boolean,
);
const MysqlIndexOptions = AbstractTable::IndexOptions;
const MysqlConstraintOptions = AbstractTable::ConstraintOptions + MysqlIndexOptions + (
"index": Type::String,
);
const MysqlTableCreationOptions = AbstractTable::TableCreationOptions + MysqlConstraintOptions;
const MysqlAlignTableOptions = AbstractTable::AlignTableOptions + MysqlTableCreationOptions;
const MysqlCopMap = DefaultCopMap + (
COP_CAST: (
"code": string (string cve, list args) {
string name = QoreTypeMap{args[0]} ?? args[0];
if (name == "varchar") name = "char"; // NOTE: due to current MariaSQL issue ("ERROR 1064 (42000)")
hash desc = MysqlTypeMap{name};
string sql = sprintf ("cast(%s as %s", cve, name);
switch (name);
sql += ")";
return sql;
},
),
COP_PREPEND: (
"arg": Type::String,
"sqlvalue": True,
"code": string (string cve, string arg) {
return sprintf("concat(%s,%s)", arg, cve);
},
),
COP_APPEND: (
"arg": Type::String,
"sqlvalue": True,
"code": string (string cve, string arg) {
return sprintf("concat(%s,%s)", cve, arg);
},
),
COP_YEAR: (
"code": string (string arg1, any arg) {
return sprintf("date_format(%s, '%%Y')", arg1);
}
),
COP_YEAR_MONTH: (
"code": string (string arg1, any arg) {
return sprintf("date_format(%s, '%%Y-%%m')", arg1);
}
),
COP_YEAR_DAY: (
"code": string (string arg1, any arg) {
return sprintf("date_format(%s, '%%Y-%%m-%%e')", arg1);
}
),
COP_YEAR_HOUR: (
"code": string (string arg1, any arg) {
return sprintf("date_format(%s, '%%Y-%%m-%%e %%k')", arg1);
}
),
);
public:
private :
string schema;
string engine = "innodb";
public:
constructor(AbstractDatasource nds, string nname, *hash opts) ;
string getSqlName();
private hash getTableCreationOptions();
private hash getTableDescriptionHashOptions();
private hash getColumnDescOptions();
private hash getIndexOptions();
private hash getConstraintOptions();
private hash getAlignTableOptions();
private hash getColumnOperatorMap();
private bool checkExistenceImpl();
private Columns describeImpl();
private *string getCreatePrimaryKeySqlUnlocked(*hash opt, bool cache = True);
private MysqlPrimaryKey getPrimaryKeyImpl();
private Indexes getIndexesImpl();
private ForeignConstraints getForeignConstraintsImpl(*hash opts);
private Constraints getConstraintsImpl();
private Triggers getTriggersImpl();
string getCreateTableSqlImpl(*hash opt);
bool hasArrayBind();
private *list getCreateMiscSqlImpl(*hash opt, bool cache);
private *list getAlignSqlImpl(AbstractTable table, *hash opt);
private string getCreateSqlImpl(list l);
private string getRenameSqlImpl(string new_name);
private AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
private setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
private addColumnToTableUnlocked(AbstractColumn c);
private AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
private AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
private AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
private AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
private AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
private AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
private bool tryInsertImpl(string sql, hash row);
private hash getQoreTypeMapImpl();
private hash getTypeMapImpl();
private *string getSqlValueImpl(any v);
private:
static *string getSqlValueIntern(any v);
public:
static *string getSqlValue(any v);
private bool emptyImpl();
private preSetupTableImpl(reference desc, *hash opt);
private setupTableImpl(hash desc, *hash opt);
private bool constraintsLinkedToIndexesImpl();
private bool uniqueIndexCreatesConstraintImpl();
private bool supportsTablespacesImpl();
private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch, *hash psch, list coll);
private bool asteriskRequiresPrefix();
private *hash doReturningImpl(hash opt, reference sql, list args);
private list getGroupOrderByListUnlocked(string key, hash qh, *hash jch, *hash ch, *hash psch, list coll);
bool hasReturningImpl();
private copyImpl(AbstractTable old);
};
};
SqlUtil::AbstractConstraint::name
string name
MysqlSqlUtil::MysqlFunction::getCreateSql
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
MysqlSqlUtil::MysqlColumn::getAddColumnSql
softlist getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table ...
MysqlSqlUtil::MysqlTable::MysqlColumnDescOptions
const MysqlColumnDescOptions
extends SqlUtil::AbstractTable::ColumnDescOptions with MySQL-specific values
Definition: MysqlSqlUtil.qm.dox.h:753
Date
const Date
MysqlSqlUtil::MysqlColumn::byte_size
int byte_size
byte size of the column
Definition: MysqlSqlUtil.qm.dox.h:206
MysqlSqlUtil::MysqlColumn::getRenameSql
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
MysqlSqlUtil::MysqlTable::MysqlTypeMap
const MysqlTypeMap
maps mysql type names to type configurations
Definition: MysqlSqlUtil.qm.dox.h:693
MysqlSqlUtil::MysqlView::getCreateSql
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
String
const String
MysqlSqlUtil::MysqlFunction::getDropSql
string getDropSql()
returns a string that can be used to drop the function from the database
MysqlSqlUtil::MysqlForeignConstraint
represents a MySQL-specific foreign constraint
Definition: MysqlSqlUtil.qm.dox.h:176
MysqlSqlUtil::MysqlSequence::getDropSql
string getDropSql()
returns a string that can be used to drop the sequence from the database
sprintf
string sprintf(string fmt,...)
SqlUtil::AbstractTable
DefaultCopMap
const DefaultCopMap
SqlUtil::VARCHAR
const VARCHAR
MysqlSqlUtil::MysqlDatabase::supportsSequencesImpl
private bool supportsSequencesImpl()
returns True since we have a workaround implementation for sequences in MySQL
MysqlSqlUtil::MysqlDatabase
provides the MySQL-specific implementation of the AbstractDatabase interface
Definition: MysqlSqlUtil.qm.dox.h:500
SqlUtil::AbstractTable::cache
cache(*hash opts)
MysqlSqlUtil::MysqlTable::hasArrayBind
bool hasArrayBind()
returns False because the mysql driver does not support array binds / bulk DML operations ...
MysqlSqlUtil::MysqlTable::constraintsLinkedToIndexesImpl
private bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
SqlUtil::AbstractIndex
MysqlSqlUtil::get_table
MysqlTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns a MysqlTable object corresponding to the arguments
MysqlSqlUtil::MysqlTable::MysqlCopMap
const MysqlCopMap
column operator specializations for MySQL
Definition: MysqlSqlUtil.qm.dox.h:770
MysqlSqlUtil::MysqlView
represents a MySQL view
Definition: MysqlSqlUtil.qm.dox.h:466
MysqlSqlUtil::MysqlDatabase::MysqlSequenceTable
const MysqlSequenceTable
MySQL sequence emulation table.
Definition: MysqlSqlUtil.qm.dox.h:517
MysqlSqlUtil::MysqlTable::uniqueIndexCreatesConstraintImpl
private bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
MysqlSqlUtil::MysqlTable::hasReturningImpl
bool hasReturningImpl()
returns True if the current database driver supports the &quot;returning&quot; clause in insert statements...
MysqlSqlUtil::get_database
MysqlDatabase get_database(AbstractDatasource nds, *hash opts)
returns a MysqlDatabase object corresponding to the arguments
MysqlSqlUtil::MysqlView::securitytype
*string securitytype
security type value
Definition: MysqlSqlUtil.qm.dox.h:478
MysqlSqlUtil::MysqlDatabase::supportsPackagesImpl
private bool supportsPackagesImpl()
returns True if the database supports packages
SqlUtil::NumericColumnInfo
True
const True
MysqlSqlUtil::MysqlDatabase::rebuildIndexImpl
private bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
MysqlSqlUtil::MysqlIndex::equalImpl
private bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
SZ_MAND
const SZ_MAND
SqlUtil::CHAR
const CHAR
SqlUtil::AbstractSequence
MysqlSqlUtil::MysqlColumn::getModifySqlImpl
softlist getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt)
returns a list of sql strings that can be used to modify the column to the new definition; if the col...
MysqlSqlUtil::MysqlFunction::getRenameSql
softlist getRenameSql(string new_name)
returns a string that can be used to rename the function in the database
number
number number(softnumber n)
COP_YEAR_HOUR
const COP_YEAR_HOUR
MysqlSqlUtil::MysqlColumn::equalImpl
private bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
MysqlSqlUtil::MysqlForeignConstraint::getRenameSql
softlist getRenameSql(string table_name, string new_name)
returns a string that drops the constraint and re-adds it, since MySQL does not support renaming cons...
MysqlSqlUtil::MysqlDatabase::getReclaimSpaceOptions
private hash getReclaimSpaceOptions()
returns driver-specific options to the base abstract class
MysqlSqlUtil::MysqlColumn::getCreateSql
string getCreateSql(AbstractTable t)
returns an sql string that can be used to add the column to a table
MysqlSqlUtil::MysqlDatabase::getComputeStatisticsOptions
private hash getComputeStatisticsOptions()
returns driver-specific options to the base abstract class
MysqlSqlUtil::MysqlDatabase::MysqlReclaimSpaceOptions
const MysqlReclaimSpaceOptions
Options for reclaimSpace()
Definition: MysqlSqlUtil.qm.dox.h:548
SqlUtil::AbstractForeignConstraint
False
const False
SqlUtil::AbstractSqlUtilBase::l
Mutex l()
MysqlSqlUtil::MysqlView::getRenameSql
softlist getRenameSql(string new_name)
returns a string that can be used to rename the view in the database
MysqlSqlUtil::MysqlView::checkoption
*string checkoption
checkoption clause
Definition: MysqlSqlUtil.qm.dox.h:474
MysqlSqlUtil::MysqlTrigger::getCreateSql
softlist getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
MysqlSqlUtil::MysqlDatabase::MysqlComputeStatisticsOptions
const MysqlComputeStatisticsOptions
Options for computeStatistics()
Definition: MysqlSqlUtil.qm.dox.h:543
list
list list(...)
MysqlSqlUtil::MysqlTable::asteriskRequiresPrefix
private bool asteriskRequiresPrefix()
returns True if the database requires a wildcard &quot;*&quot; to be prefixed with the table name when it appea...
Float
const Float
SqlUtil::AbstractTable::name
string name
MysqlSqlUtil::MysqlTrigger::getDropSql
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
MysqlSqlUtil::MysqlForeignConstraint::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the foreign constraint from the database ...
MysqlSqlUtil::MysqlSequence::getRenameSql
string getRenameSql(string new_name)
returns a string that can be used to rename the sequence in the database
MysqlSqlUtil::MysqlTable::getSqlValueImpl
private *string getSqlValueImpl(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
Boolean
const Boolean
SZ_NUM
const SZ_NUM
MysqlSqlUtil::MysqlTable::supportsTablespacesImpl
private bool supportsTablespacesImpl()
returns True if the database support tablespaces
MysqlSqlUtil::MysqlDatabase::MysqlSequenceFunction
const MysqlSequenceFunction
MySQL sequence function.
Definition: MysqlSqlUtil.qm.dox.h:536
MysqlSqlUtil::MysqlIndex::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the index from the table
Binary
const Binary
MysqlSqlUtil::MysqlPrimaryKey::memberGate
MysqlColumn memberGate(string k)
returns the MysqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception ...
MysqlSqlUtil::MysqlTable::MysqlTableDescriptionHashOptions
const MysqlTableDescriptionHashOptions
extends SqlUtil::AbstractTable::TableDescriptionHashOptions with &quot;engine&quot; for the DB engine behind th...
Definition: MysqlSqlUtil.qm.dox.h:743
MysqlSqlUtil::MysqlSequence::getCreateSql
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
MysqlSqlUtil::MysqlFunction
represents a MySQL-specific function
Definition: MysqlSqlUtil.qm.dox.h:416
MysqlSqlUtil::MysqlTable::copyImpl
private copyImpl(AbstractTable old)
db-specific copy actions
MysqlSqlUtil::MysqlTable
provides the MySQL-specific implementation of the AbstractTable interface
Definition: MysqlSqlUtil.qm.dox.h:688
MysqlSqlUtil::MysqlPrimaryKey
represents a MySQL-specific primary key constraint
Definition: MysqlSqlUtil.qm.dox.h:346
COP_YEAR_MONTH
const COP_YEAR_MONTH
MysqlSqlUtil::MysqlDatabase::MyusqlCreationOptions
const MyusqlCreationOptions
MySQL creation options.
Definition: MysqlSqlUtil.qm.dox.h:533
MysqlSqlUtil::MysqlTable::doSelectLimitOnlyUnlockedImpl
private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh)
processes a string for use in SQL select statements when there is a &quot;limit&quot; argument, but no &quot;orderby&quot; or &quot;offset&quot; arguments
MysqlSqlUtil::MysqlTrigger
represents a MySQL-specific trigger
Definition: MysqlSqlUtil.qm.dox.h:391
SqlUtil::BLOB
const BLOB
MysqlSqlUtil::MysqlDatabase::getCurrentSequenceValueImpl
private softint getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
SqlUtil::CLOB
const CLOB
MysqlSqlUtil::MysqlTable::getSqlName
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema, etc)
MysqlSqlUtil::MysqlDatabase::getDatabaseOptions
private hash getDatabaseOptions()
returns driver-specific options to the base abstract class
MysqlSqlUtil::MysqlPrimaryKey::getRenameSql
softlist getRenameSql(string table_name, string new_name)
primary keys have no name in MySQL so this method returns an empty list
MysqlSqlUtil::MysqlDatabase::listFunctionsImpl
private list listFunctionsImpl()
returns a list of string function names in the database
MysqlSqlUtil::MysqlView::definer
*string definer
dafiner clause
Definition: MysqlSqlUtil.qm.dox.h:476
MysqlSqlUtil::MysqlDatabase::reclaimSpaceImpl
private reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
SqlUtil::AbstractFunction
MysqlSqlUtil::MysqlDatabase::listTablesImpl
private list listTablesImpl()
returns a list of string table names in the database
MysqlSqlUtil::MysqlTable::doSelectOrderByWithOffsetSqlUnlockedImpl
private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch, *hash psch, list coll)
processes a string for use in SQL select statements when there is an &quot;order by&quot; and &quot;offset&quot; argument...
COP_PREPEND
const COP_PREPEND
SqlUtil::AbstractView
SqlUtil::AbstractSqlUtilBase::opts
*hash opts
MysqlSqlUtil::MysqlTable::getSqlValueIntern
static *string getSqlValueIntern(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
MysqlSqlUtil::MysqlDatabase::seqds
Datasource seqds
separate datasource dedicated for extern sequence implementation with autonomous transactions ...
Definition: MysqlSqlUtil.qm.dox.h:558
Int
const Int
MysqlSqlUtil::MysqlSequence::constructor
constructor(string n_table_name, string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
COP_YEAR
const COP_YEAR
string
string string(softstring str, *string enc)
MysqlSqlUtil::MysqlView::constructor
constructor(string n_name, string n_src, *string n_tablecatalog, *string n_schema, *string n_checkoption, *string n_definer, *string n_securitytype, bool n_updatable)
creates the object from the arguments
MysqlSqlUtil::MysqlDatabase::getSchemaDescriptionOptions
private hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
SqlUtil::AbstractTrigger
SqlUtil::AbstractColumn
MysqlSqlUtil::MysqlTrigger::constructor
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
MysqlSqlUtil::MysqlSequence
class for MySQL sequences based on a sequence table and autonomous transactions
Definition: MysqlSqlUtil.qm.dox.h:440
COP_CAST
const COP_CAST
MysqlSqlUtil::MysqlFunction::equalImpl
private bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
MysqlSqlUtil::MysqlDatabase::computeStatisticsImpl
private computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics() ...
MysqlSqlUtil::MysqlNumericColumn
represents a MySQL-specific numeric column
Definition: MysqlSqlUtil.qm.dox.h:264
MysqlSqlUtil::MysqlDatabase::supportsTypesImpl
private bool supportsTypesImpl()
returns True if the database supports named types
MysqlSqlUtil::MysqlColumn
represents a MySQL-specific column
Definition: MysqlSqlUtil.qm.dox.h:201
COP_YEAR_DAY
const COP_YEAR_DAY
MysqlSqlUtil::MysqlDatabase::MysqlSchemaDescriptionOptions
const MysqlSchemaDescriptionOptions
MySQL-specific schema description keys.
Definition: MysqlSqlUtil.qm.dox.h:511
MysqlSqlUtil::MysqlView::tablecatalog
*string tablecatalog
table catalog value
Definition: MysqlSqlUtil.qm.dox.h:472
MysqlSqlUtil::MysqlNumericColumn::equalImpl
private bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
MysqlSqlUtil::MysqlPrimaryKey::getDropSql
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
MysqlSqlUtil::MysqlDatabase::listProceduresImpl
private list listProceduresImpl()
returns a list of string procedure names in the database
MysqlSqlUtil::MysqlIndex
represents a MySQL-specific index
Definition: MysqlSqlUtil.qm.dox.h:146
MysqlSqlUtil::MysqlTrigger::getRenameSql
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
MysqlSqlUtil::MysqlPrimaryKey::supportsName
bool supportsName()
returns False since primary key constraints in MySQL have no name
MysqlSqlUtil::MysqlTable::getColumnOperatorMap
private hash getColumnOperatorMap()
returns the column operator map for this object
hash
hash hash(object obj)
MysqlSqlUtil::MysqlDatabase::MysqlOptions
const MysqlOptions
MySQL-specific options.
Definition: MysqlSqlUtil.qm.dox.h:505
SqlUtil::AbstractDatabase::ComputeStatisticsOptions
const ComputeStatisticsOptions
SZ_OPT
const SZ_OPT
MysqlSqlUtil::MysqlTable::getSqlValue
static *string getSqlValue(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument ...
MysqlSqlUtil::MysqlIndex::getCreateSql
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
MysqlSqlUtil::MysqlIndex::getRenameSql
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database; hwoever mysql does not support...
SqlUtil::AbstractDatabase
MysqlSqlUtil::MysqlDatabase::MysqlDatabaseOptions
const MysqlDatabaseOptions
MySQL-specific database options.
Definition: MysqlSqlUtil.qm.dox.h:514
SqlUtil::AbstractPrimaryKey
Number
const Number
MysqlSqlUtil::MysqlDatabase::getNextSequenceValueImpl
private softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
MysqlSqlUtil::MysqlIndex::constructor
constructor(string n_name, bool n_unique, hash n_cols, string n_type="BTREE")
creates the object from the arguments
SqlUtil::AbstractUniqueConstraint
MysqlSqlUtil::MysqlTrigger::equalImpl
private bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractDatabase::ReclaimSpaceOptions
const ReclaimSpaceOptions
MysqlSqlUtil::MysqlTable::QoreTypeMap
const QoreTypeMap
maps qore type names to postgresql type names
Definition: MysqlSqlUtil.qm.dox.h:729
COP_APPEND
const COP_APPEND