193 parse_schema_name(
string nname, reference<*string> schema, reference<string> name);
239 constructor(
string n_name,
bool n_unique, hash n_cols,
string n_type =
'BTREE') ;
265 constructor(
string n, Columns c, ForeignConstraintTarget t) ;
268 string getCreateSql(
string table_name, *hash opt);
275 string getCreateSql(
string name,
string table_name, *hash opt);
278 string getAddSql(
string name,
string table_name, *hash opt);
299 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, *softint bs, *
int scale) ;
375 const AUTO_INCREMENT_VALID_TYPES = ...;
380 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, softint
scale,
bool n_unsigned = False,
bool n_auto_increment = False,
bool n_pk = False)
391 validateConstructor();
395 string getNativeTypeString();
411 bool setIndexBase(
string ix);
419 getIndexSql(reference<string> sql,
string name, *hash opts);
426 constructor(
string n, hash n_cols) ;
445 MysqlColumn memberGate(
string k);
448 string getCreateSql(
string table_name, *hash opts);
451 list getRenameSql(
string table_name,
string new_name);
454 string getCreateSql(
string name,
string table_name, *hash opts);
458 string getDropSql(
string table_name);
469 constructor(*hash c) ;
491 string getCreateSql(
string table_name, *hash opts);
575 constructor(
string n_table_name,
string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
610 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)
645 const MysqlSequenceFunction =
"%s(seq_name varchar(40)) returns decimal(14) begin update %s set id = last_insert_id(id + 1) where name = seq_name;
646 return last_insert_id();
670 string sequence_table =
"sqlutil_sequences";
671 string sequence_function =
"sqlutil_nextval";
695 list<string> featuresImpl();
699 string getSchemaName();
703 AbstractSequence makeSequenceImpl(
string name, number start = 1, number increment = 1, *softnumber end, *hash
opts);
708 *AbstractSequence getSequenceImpl(
string name);
713 *AbstractView getViewImpl(
string name);
728 *AbstractFunction getFunctionImpl(
string name);
733 static string makeParameter(hash<auto> row);
738 AbstractFunction getProcedureImpl(
string name);
743 list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
748 list getAlignSqlImpl(hash schema_hash, *hash opt);
779 list<string> listSequencesImpl();
784 list<string> listViewsImpl();
789 string getCreateSqlImpl(list
l);
793 static string getCreateSql(list
l);
906 const MysqlIndexOptions = AbstractTable::IndexOptions;
908 const MysqlConstraintOptions = ...;
911 const MysqlTableCreationOptions = AbstractTable::TableCreationOptions + MysqlConstraintOptions;
913 const MysqlAlignTableOptions = AbstractTable::AlignTableOptions + MysqlTableCreationOptions;
933 string engine =
"innodb";
935 string table_encoding;
955 hash getTableCreationOptions();
960 hash getTableDescriptionHashOptions();
965 hash getColumnDescOptions();
970 hash getIndexOptions();
975 hash getConstraintOptions();
980 hash getAlignTableOptions();
991 bool checkExistenceImpl();
996 Columns describeImpl();
1001 *
string getCreatePrimaryKeySqlUnlocked(*hash opt,
bool cache = True);
1011 Indexes getIndexesImpl();
1016 ForeignConstraints getForeignConstraintsImpl(*hash
opts);
1021 Constraints getConstraintsImpl();
1026 Triggers getTriggersImpl();
1030 string getCreateTableSqlImpl(*hash opt);
1038 *list getCreateMiscSqlImpl(*hash opt,
bool cache);
1043 *list getAlignSqlImpl(AbstractTable table, *hash opt);
1048 string getCreateSqlImpl(list
l);
1053 string getRenameSqlImpl(
string new_name);
1058 AbstractColumn addColumnImpl(
string cname, hash<auto> opt,
bool nullable = True);
1063 setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
1068 addColumnToTableUnlocked(AbstractColumn c);
1073 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1078 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
1083 AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash ch,
string table, hash tch, *hash opt);
1088 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
1093 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
1098 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
1103 bool tryInsertImpl(
string sql, hash<auto> row);
1116 hash getQoreTypeMapImpl();
1121 hash getTypeMapImpl();
1167 preSetupTableImpl(reference<hash> desc, *hash opt);
1172 setupTableImpl(hash desc, *hash opt);
1213 *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
1218 list<auto> getGroupOrderByListUnlocked(hash<QueryInfo> info,
string key, list<auto> coll);
represents a MySQL-specific column
Definition MysqlSqlUtil.qm.dox.h:287
softlist< string > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
softlist< string > 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
string getCreateSql(AbstractTable t)
returns an sql string that can be used to add the column to a table
constructor()
empty constructor for subclasses
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
int byte_size
byte size of the column
Definition MysqlSqlUtil.qm.dox.h:291
string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
provides the MySQL-specific implementation of the AbstractDatabase interface
Definition MysqlSqlUtil.qm.dox.h:627
bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
const MysqlSequenceTable
MySQL sequence emulation table.
Definition MysqlSqlUtil.qm.dox.h:641
const MysqlComputeStatisticsOptions
Options for computeStatistics()
Definition MysqlSqlUtil.qm.dox.h:650
const MysqlSchemaDescriptionOptions
MySQL-specific schema description keys.
Definition MysqlSqlUtil.qm.dox.h:635
bool requiresScale()
Returns True if the driver requires a scale to support decimal values in numeric or decimal columns.
Datasource seqds
separate datasource dedicated for extern sequence implementation with autonomous transactions
Definition MysqlSqlUtil.qm.dox.h:668
list< string > listProceduresImpl()
returns a list of string procedure names in the database
int getMaximumPrecision()
Returns the maximum precision for numeric or decimal columns.
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
const MysqlMaxPrecision
Maximum precision.
Definition MysqlSqlUtil.qm.dox.h:662
bool supportsPackagesImpl()
returns True if the database supports packages
hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
int getPhysicalSizeImpl()
SqlUtil::AbstractDatabase::getPhysicalSize()
const MysqlReclaimSpaceOptions
Options for reclaimSpace()
Definition MysqlSqlUtil.qm.dox.h:654
const MysqlReservedWords
hash of reserved words
Definition MysqlSqlUtil.qm.dox.h:658
computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics()
hash getDatabaseOptions()
returns driver-specific options to the base abstract class
const MysqlSequenceFunction
MySQL sequence function.
Definition MysqlSqlUtil.qm.dox.h:645
reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
softint getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
list< string > listFunctionsImpl()
returns a list of string function names in the database
hash getReclaimSpaceOptions()
returns driver-specific options to the base abstract class
bool supportsTypesImpl()
returns True if the database supports named types
list< string > listTablesImpl()
returns a list of string table names in the database
hash getComputeStatisticsOptions()
returns driver-specific options to the base abstract class
bool supportsSequencesImpl()
returns True since we have a workaround implementation for sequences in MySQL
const MysqlOptions
MySQL-specific options.
Definition MysqlSqlUtil.qm.dox.h:631
const MysqlDatabaseOptions
MySQL-specific database options.
Definition MysqlSqlUtil.qm.dox.h:638
represents a MySQL-specific foreign constraint
Definition MysqlSqlUtil.qm.dox.h:262
string getDropSql(string table_name)
returns a string that can be used to drop the foreign constraint from the database
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...
represents a MySQL-specific function
Definition MysqlSqlUtil.qm.dox.h:535
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the function in the database
represents a MySQL-specific index
Definition MysqlSqlUtil.qm.dox.h:233
constructor(string n_name, bool n_unique, hash n_cols, string n_type='BTREE')
creates the object from the arguments
string getDropSql(string table_name)
returns a string that can be used to drop the index from the table
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
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...
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
the data type for DECIMAL columns
Definition MysqlSqlUtil.qm.dox.h:224
constructor(string native_type, bool nullable, *hash< auto > options)
creates the object
represents a MySQL-specific numeric column
Definition MysqlSqlUtil.qm.dox.h:365
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
deserializeMembers(hash< auto > members)
deserializes the hash to a replica of the original object
represents a MySQL-specific primary key constraint
Definition MysqlSqlUtil.qm.dox.h:463
MysqlColumn memberGate(string k)
returns the MysqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
bool supportsName()
returns False since primary key constraints in MySQL have no name
softlist getRenameSql(string table_name, string new_name)
primary keys have no name in MySQL so this method returns an empty list
MySQL savepoint helper.
Definition MysqlSqlUtil.qm.dox.h:197
deleteSavepointImpl()
Deletes the savepoint.
createSavepointImpl()
Creates the savepoint.
constructor(AbstractDatasource ds, *string savepoint)
Creates the object.
rollbackImpl()
Rolls back to the savepoint.
class for MySQL sequences based on a sequence table and autonomous transactions
Definition MysqlSqlUtil.qm.dox.h:566
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the sequence in the database
string getDropSql(*hash opt)
returns a string that can be used to drop the sequence from the database
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
provides the MySQL-specific implementation of the AbstractTable interface
Definition MysqlSqlUtil.qm.dox.h:875
hash< auto > getExpressionMap()
Returns the expression map for MySQL.
bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
hash< auto > getWhereOperatorMap()
returns the "where" operator map for MySQL
bool hasReturningImpl()
returns True if the current driver supports the "returning" clause in insert statements
list getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
const QoreTypeMap
maps qore type names to MySQL type names
Definition MysqlSqlUtil.qm.dox.h:883
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
const MysqlTypeMap
maps mysql type names to type configurations
Definition MysqlSqlUtil.qm.dox.h:879
bool supportsTablespacesImpl()
returns True if the database support tablespaces
AbstractDataProviderType getNumericTypeImpl(string native_type, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
doSelectOrderByWithOffsetSqlInternImpl(reference< hash< QueryInfo > > info, reference< string > sql, list< auto > coll)
processes a string for use in SQL select statements when there is an "order by" and "offset" argument
hash getColumnOperatorMapImpl()
returns the column operator map for this object
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema,...
static *string getSqlValue(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
bool hasArrayBind()
returns False because the mysql driver does not support array binds / bulk DML operations
const MysqlOpMap
where operator specializations for MySQL
Definition MysqlSqlUtil.qm.dox.h:924
const MysqlTableDescriptionHashOptions
extends SqlUtil::AbstractTable::TableDescriptionHashOptions
Definition MysqlSqlUtil.qm.dox.h:894
const MysqlExpressionMap
MySQL Expression map.
Definition MysqlSqlUtil.qm.dox.h:920
const MysqlTruncDate
Map SqlUtil::cop_trunc_date() constants for internal masks.
Definition MysqlSqlUtil.qm.dox.h:928
const MysqlCopMap
column operator specializations for MySQL
Definition MysqlSqlUtil.qm.dox.h:916
const MysqlColumnDescOptions
extends SqlUtil::AbstractTable::ColumnDescOptions with MySQL-specific values
Definition MysqlSqlUtil.qm.dox.h:903
doSelectLimitOnlyInternImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
static *string getSqlValueIntern(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
copyImpl(AbstractTable old)
db-specific copy actions
AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
*string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
represents a MySQL-specific trigger
Definition MysqlSqlUtil.qm.dox.h:508
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
softlist getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
represents a MySQL view
Definition MysqlSqlUtil.qm.dox.h:597
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
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the view in the database
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
*string tablecatalog
table catalog value
Definition MysqlSqlUtil.qm.dox.h:601
*string definer
dafiner clause
Definition MysqlSqlUtil.qm.dox.h:605
*string checkoption
checkoption clause
Definition MysqlSqlUtil.qm.dox.h:603
*string securitytype
security type value
Definition MysqlSqlUtil.qm.dox.h:607
cache(*hash< auto > opts)
the MysqlSqlUtil namespace contains all the objects in the MysqlSqlUtil module
Definition MysqlSqlUtil.qm.dox.h:184
MysqlDatabase get_database(AbstractDatasource nds, *hash opts)
returns a MysqlDatabase object corresponding to the arguments
MysqlTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns a MysqlTable object corresponding to the arguments