161parse_schema_name(
string nname, reference<string> schema, reference<string> name,
string default_schema =
'dbo');
173 constructor(AbstractDatasource ds, *
string savepoint =
'x' + get_random_string(31)) ;
212 constructor(
string n_name,
bool n_unique, hash n_cols, *
string n_filegroup) ;
242 softlist getRenameSql(
string table_name,
string new_name);
262 list getRenameSql(
string table_name,
string new_name);
284 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, *
int scale) ;
347 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, softint
scale) ;
434 list getRenameSql(
string table_name,
string new_name);
495 constructor(
string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
609 const mssql_TempSavepoint =
"qore_mssql_tmp_savepoint";
641 list<string> featuresImpl();
646 MssqlSequence makeSequenceImpl(
string name, number start = 1, number increment = 1, *softnumber end, *hash
opts);
651 *AbstractSequence getSequenceImpl(
string name);
656 *AbstractView getViewImpl(
string name);
671 *AbstractFunction getFunctionImpl(
string name);
676 AbstractFunction getProcedureImpl(
string name);
681 list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
686 list getAlignSqlImpl(hash schema_hash, *hash opt);
715 list<string> listSequencesImpl();
720 list<string> listViewsImpl();
815 static auto tryExecArgs(AbstractDatasource
ds,
string sql, *softlist<auto> args);
853 const MssqlColumnDescOptions = AbstractTable::ColumnDescOptions;
855 const MssqlIndexOptions = AbstractTable::IndexOptions;
857 const MssqlConstraintOptions = AbstractTable::ConstraintOptions + MssqlIndexOptions;
859 const MssqlTableCreationOptions = AbstractTable::TableCreationOptions + MssqlConstraintOptions;
861 const MssqlAlignTableOptions = AbstractTable::AlignTableOptions + MssqlTableCreationOptions;
950 string getFromIntern(
string from, *hash qh);
955 hash getTableCreationOptions();
960 hash getTableDescriptionHashOptions();
965 hash getColumnDescOptions();
970 hash getIndexOptions();
975 hash getConstraintOptions();
980 hash getAlignTableOptions();
1009 bool checkExistenceImpl();
1014 Columns describeImpl();
1019 Columns describeSybaseImpl();
1024 Columns describeMssqlImpl();
1044 Indexes getIndexesImpl();
1049 Indexes getIndexesSybaseImpl();
1054 Indexes getIndexesMssqlImpl();
1059 ForeignConstraints getForeignConstraintsImpl(*hash
opts);
1064 ForeignConstraints getForeignConstraintsSybaseImpl();
1069 ForeignConstraints getForeignConstraintsMssqlImpl();
1074 Constraints getConstraintsImpl();
1079 Constraints getConstraintsSybaseImpl();
1084 Constraints getConstraintsMssqlImpl();
1089 Triggers getTriggersImpl();
1100 *list getCreateMiscSqlImpl(*hash opt,
bool cache);
1105 *list getAlignSqlImpl(AbstractTable table, *hash opt);
1116 string getRenameSqlImpl(
string new_name);
1121 AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable = True);
1126 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1131 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
1136 AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash ch,
string table, hash tch, *hash opt);
1141 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
1146 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
1151 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
1156 bool tryInsertImpl(
string sql, hash<auto> row);
1169 hash getQoreTypeMapImpl();
1174 hash getTypeMapImpl();
1206 setupTableImpl(hash desc, *hash opt);
1259 *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
1264 softbool tryUpdate(
string sql, hash<auto> row, Columns cols, list updc);
represents a Mssql-specific check constraint
Definition MssqlSqlUtilBase.qm.dox.h:251
constructor(string n, string n_src)
creates the constraint from the supplied arguments
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
string getCreateSql(string name, string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
represents a Mssql-specific column
Definition MssqlSqlUtilBase.qm.dox.h:271
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
list 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...
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
softlist getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
int byte_size
byte size of the column
Definition MssqlSqlUtilBase.qm.dox.h:275
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, *int scale)
creates the column from the supplied arguments
constructor()
empty constructor for subclasses
provides the Mssql-specific implementation of the AbstractDatabase interface
Definition MssqlSqlUtilBase.qm.dox.h:597
bool supportsTypesImpl()
returns True if the database supports named types
softint getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
int getPhysicalSizeImpl()
SqlUtil::AbstractDatabase::getPhysicalSize()
list< string > listFunctionsImpl()
returns a list of string function names in the database
bool requiresScale()
Returns True if the driver requires a scale to support decimal values in numeric or decimal columns.
static string getCreateSql(list l)
returns a string that can be used to create the schema in the database
const MssqlSchemaDescriptionOptions
Mssql-specific schema description keys.
Definition MssqlSqlUtilBase.qm.dox.h:607
string default_schema
default schema for user
Definition MssqlSqlUtilBase.qm.dox.h:604
const MssqlReservedWords
hash of reserved words
Definition MssqlSqlUtilBase.qm.dox.h:615
computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics()
int getMaximumPrecision()
Returns the maximum precision for numeric or decimal columns.
softlist< string > listTablesImpl()
returns a list of string table names in the database
static auto tryExecRaw(AbstractDatasource ds, string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
bool supportsSequencesImpl()
returns True if the database supports sequences
bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
const MssqlReclaimSpaceOptions
Options for reclaimSpace()
Definition MssqlSqlUtilBase.qm.dox.h:612
hash getReclaimSpaceOptions()
returns driver-specific options to the base abstract class
string getCreateSqlImpl(list l)
returns a string that can be used to create the schema in the database
bool is_sybase
sybase flag
Definition MssqlSqlUtilBase.qm.dox.h:601
auto tryExecRawImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
list< string > listProceduresImpl()
since Mssql only supports functions, this method is identical to listFunctionsImpl()
const MaxPrecision
Maximum precision.
Definition MssqlSqlUtilBase.qm.dox.h:619
hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
static bool isSybase(AbstractDatasource ds)
returns True if the DB is a Sybase database
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
bool supportsPackagesImpl()
returns True if the database supports packages
static auto tryExecArgs(AbstractDatasource ds, string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
represents a Mssql-specific foreign constraint
Definition MssqlSqlUtilBase.qm.dox.h:231
constructor(string n, Columns c, ForeignConstraintTarget t)
creates the constraint from the supplied arguments
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
string getCreateSql(string name, string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
represents a Mssql-specific function
Definition MssqlSqlUtilBase.qm.dox.h:560
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the function in the database
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
setName(string new_name)
sets the new name of the function
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
represents a Mssql-specific index
Definition MssqlSqlUtilBase.qm.dox.h:205
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
*string filegroup
the tablespace (filegroup) name of the index
Definition MssqlSqlUtilBase.qm.dox.h:209
constructor(string n_name, bool n_unique, hash n_cols, *string n_filegroup)
creates the object from the arguments
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
the data type for Mssql DECIMAL columns
Definition MssqlSqlUtilBase.qm.dox.h:196
constructor(string native_type, bool nullable, *hash< auto > options)
creates the object
represents a Mssql-specific numeric column
Definition MssqlSqlUtilBase.qm.dox.h:343
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint scale)
creates the column from the supplied arguments
represents a Mssql-specific primary key constraint
Definition MssqlSqlUtilBase.qm.dox.h:447
string getCreateSql(string table_name, *hash opts)
returns a string that can be used to create the constraint
constructor(string n, *hash c, *string ts)
creates the object with the given attributes
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the constraint
MssqlColumn memberGate(string k)
returns the MssqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
constructor()
creates an empty primary key object
Mssql savepoint helper.
Definition MssqlSqlUtilBase.qm.dox.h:165
deleteSavepointImpl()
Deletes the savepoint.
createSavepointImpl()
Creates the savepoint.
constructor(AbstractDatasource ds, *string savepoint='x'+get_random_string(31))
Creates the object.
rollbackImpl()
Rolls back to the savepoint.
class for Mssql sequences
Definition MssqlSqlUtilBase.qm.dox.h:491
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
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
provides the Mssql-specific implementation of the SqlUtil::AbstractTable interface
Definition MssqlSqlUtilBase.qm.dox.h:822
hash getSelectOptions()
returns the select options for this driver
const QoreTypeMap
maps qore type names to DB type names
Definition MssqlSqlUtilBase.qm.dox.h:839
hash< auto > getWhereOperatorMap()
returns the "where" operator map for Mssql
bool supportsTablespacesImpl()
returns True if the database support tablespaces
copyImpl(AbstractTable old)
db-specific copy actions
const MssqlTruncDate
Map SqlUtil::cop_trunc_date() constants to Mssql internal masks.
Definition MssqlSqlUtilBase.qm.dox.h:888
hash getColumnOperatorMapImpl()
returns the column operator map for this object
const MssqlTableDescriptionHashOptions
equal to SqlUtil::AbstractTable::TableDescriptionHashOptions
Definition MssqlSqlUtilBase.qm.dox.h:851
list getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
*string getTablespaceName()
returns the data filegroup name for the table or NOTHING if none is known
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition MssqlSqlUtilBase.qm.dox.h:907
bool hasArrayBind()
returns False because the Mssql driver does not support array binds / bulk DML operations
bool is_sybase
sybase flag
Definition MssqlSqlUtilBase.qm.dox.h:826
const MssqlExpressionMap
Mssql Expression map.
Definition MssqlSqlUtilBase.qm.dox.h:872
const MssqlCopMap
column operator specializations for Mssql
Definition MssqlSqlUtilBase.qm.dox.h:880
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash opt)
returns a closure for performing upserts
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
*string filegroup
filegroup name for the table, if known
Definition MssqlSqlUtilBase.qm.dox.h:901
*string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
const SybaseQoreTypeMap
maps qore type names to Sybase/SAP type names
Definition MssqlSqlUtilBase.qm.dox.h:847
bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
string getCreateTableSqlImpl(*hash opt)
returns a string that can be used to create the table in the database
bool ss_has_merge
"has merge" flag for SQL server
Definition MssqlSqlUtilBase.qm.dox.h:829
doSelectLimitOnlyInternImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements with "limit" but no "orderby" or "offset"
const MssqlUopMap
a hash of default update operator definitions for Mssql
Definition MssqlSqlUtilBase.qm.dox.h:896
const MssqlOpMap
where operator specializations for Mssql
Definition MssqlSqlUtilBase.qm.dox.h:876
auto tryExecRawImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
string schema
schema name for the table
Definition MssqlSqlUtilBase.qm.dox.h:904
hash getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
const MsSqlServerTableHints
query hints
Definition MssqlSqlUtilBase.qm.dox.h:868
clearImpl()
clears Mssql-specific table information
hash< auto > getExpressionMap()
Returns the expression map for Mssql.
const MssqlIopMap
a hash of default value operator descriptions for Mssql
Definition MssqlSqlUtilBase.qm.dox.h:892
const MsQoreTypeMap
maps qore type names to MS SQL Server type names
Definition MssqlSqlUtilBase.qm.dox.h:843
AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
const MssqlSelectOptions
select options supported by MssqlSqlUtilBase
Definition MssqlSqlUtilBase.qm.dox.h:864
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
string getCreateSqlImpl(list l)
returns a string that can be used to create the table in the database
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...
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
string getSchemaName()
returns the schema name
string default_schema
the default schema for the user
Definition MssqlSqlUtilBase.qm.dox.h:910
hash getInsertOperatorMap()
returns the insert operator map for this object
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema,...
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint with a unique index
bool ss_has_sequences
"has sequences" flag for SQL server
Definition MssqlSqlUtilBase.qm.dox.h:832
const MssqlTypeMap
maps postgresql type names to type configurations
Definition MssqlSqlUtilBase.qm.dox.h:835
represents a Mssql-specific trigger
Definition MssqlSqlUtilBase.qm.dox.h:533
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
softlist getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
common base class for unique constraints
Definition MssqlSqlUtilBase.qm.dox.h:352
getIndexSql(reference< string > sql, string name, *hash opts)
adds index options onto the sql creation string
clearIndex()
clears any index base for the constraint
*string filegroup
any filegroup for the unique key index
Definition MssqlSqlUtilBase.qm.dox.h:357
constructor(*string ts)
creates the constraint with an optional filegroup name
constructor()
empty constructor for subclasses
setTablespace(*string ts)
sets or clears the filegroup name
bool setIndexBase(string ix)
sets the supporting index name
*string getTablespace()
returns the filegroup name used for this constraint, if known
class modeling a unique constraint
Definition MssqlSqlUtilBase.qm.dox.h:393
bool isEnabled()
returns True if the constraint is enabled, False if not
string getCreateSql(string table_name, *hash opts)
returns a string that can be used to create the constraint
bool enabled
True if the constraint is enabled, False if not
Definition MssqlSqlUtilBase.qm.dox.h:398
string getCreateSql(string name, string table_name, *hash opts)
returns a string that can be used to rename the constraint
constructor(string n, hash n_cols, bool e=True, *string ts)
creates the object with the given attributes
MssqlColumn memberGate(string k)
returns the MssqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
represents a Mssql view
Definition MssqlSqlUtilBase.qm.dox.h:512
constructor(string n_name, string n_src, *string n_schemaname)
creates the object from the arguments
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the view in the database
const ReclaimSpaceOptions
transient AbstractDatasource ds
cache(*hash< auto > opts)
the MssqlSqlUtilBase namespace contains all the objects in the MssqlSqlUtilBase module
Definition MssqlSqlUtilBase.qm.dox.h:152
MssqlDatabase get_database(AbstractDatasource nds, *hash< auto > opts)
returns a MssqlDatabase object corresponding to the arguments
MssqlTable get_table(AbstractDatasource nds, string nname, *hash< auto > opts)
returns a MssqlTable object corresponding to the arguments