Package tilda.db.stores
Class MSSQL
- java.lang.Object
-
- tilda.db.stores.MSSQL
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String[]_LOCK_CONN_ERROR_SUBSTRprotected static java.lang.String[]_NODATA_SQL_STATESprotected static CodeGenSql_SQL
-
Constructor Summary
Constructors Constructor Description MSSQL()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidage(Connection C, java.lang.StringBuilder Str, Type_DatetimePrimitive ColStart, Type_DatetimePrimitive ColEnd, DurationUtil.IntervalEnum Type, int Count, java.lang.String Operator)booleanalterTableAddColumn(Connection Con, Column Col, java.lang.String DefaultValue, java.lang.String temporaryDefaultValue)booleanalterTableAddFK(Connection Con, ForeignKey FK)booleanalterTableAddIndex(Connection Con, Index IX)java.lang.StringalterTableAddIndexDDL(Index IX)booleanalterTableAlterColumnComment(Connection C, Column Col)booleanalterTableAlterColumnDefault(Connection Con, Column Col)booleanalterTableAlterColumnMulti(Connection Con, java.util.List<ColMetaColPair> BatchTypeCols, java.util.List<ColMetaColPair> BatchSizeCols, ZoneInfo_Data defaultZI)booleanalterTableAlterColumnNull(Connection Con, Column Col, java.lang.String DefaultValue)booleanalterTableAlterColumnNumericSize(Connection connection, ColumnMeta colMeta, Column col)booleanalterTableAlterColumnStringSize(Connection Con, ColumnMeta ColMeta, Column Col)booleanalterTableAlterColumnType(Connection Con, ColumnMeta ColMeta, Column Col, ZoneInfo_Data defaultZI)booleanalterTableComment(Connection C, Object Obj)booleanalterTableDropColumn(Connection Con, Object Obj, java.lang.String ColumnName)booleanalterTableDropFK(Connection Con, Object Obj, FKMeta FK)booleanalterTableDropIndex(Connection Con, Object Obj, IndexMeta IX)booleanalterTableIndexAddCluster(Connection Con, Index IX)booleanalterTableIndexDropCluster(Connection Con, IndexMeta IX)booleanalterTableRenameIndex(Connection Con, Object Obj, java.lang.String OldName, java.lang.String NewName)booleanalterTableReplaceTablePK(Connection Con, Object Obj, PKMeta oldPK)voidcancel(Connection C)booleancreateKeysEntry(Connection Con, Object Obj)booleancreateSchema(Connection Con, Schema S)booleancreateTable(Connection Con, Object Obj)booleancreateView(Connection Con, View V)booleandropView(Connection con, ViewMeta v, boolean cascade)booleandropView(Connection Con, View V)booleanfullIdentifierOnUpdate()java.lang.StringgetAclRolesScript(Connection Con, java.util.List<Schema> TildaList)java.lang.StringgetAggregateStr(AggregateType AT)java.lang.StringgetBackendConnectionId(Connection connection)chargetColumnQuotingEndChar()chargetColumnQuotingStartChar()voidgetColumnType(java.lang.StringBuilder Str, ColumnType T, java.lang.Integer S, ColumnMode M, boolean Collection, java.lang.Integer Precision, java.lang.Integer Scale)java.lang.StringgetColumnType(ColumnType T, java.lang.Integer S, ColumnMode M, boolean Collection)java.lang.StringgetColumnType(Column C)java.lang.StringgetColumnType(Column C, ColumnType AggregateType)java.lang.StringgetColumnTypeRaw(ColumnType Type, int Size, boolean isArray)java.lang.StringgetColumnTypeRaw(Column C, boolean MultiOverride)java.lang.String[]getConnectionCancelStates()java.lang.String[]getConnectionLockMsgs()java.lang.String[]getConnectionNoDataStates()java.time.LocalDategetCurrentDate(Connection con)java.lang.StringgetCurrentDateStr()java.time.ZonedDateTimegetCurrentDateTime(Connection con)java.lang.StringgetCurrentDateTimeStr()java.time.ZonedDateTimegetCurrentTimestamp(Connection con)java.lang.StringgetCurrentTimestampStr()DBStringTypegetDBStringType(int Size)voidgetFullColumnVar(java.lang.StringBuilder Str, java.lang.String SchemaName, java.lang.String TableName, java.lang.String ColumnName)java.lang.StringgetFullColumnVar(Column C)java.lang.StringgetFullColumnVar(Column C, int i)voidgetFullTableVar(java.lang.StringBuilder Str, java.lang.String SchemaName, java.lang.String TableName)java.lang.StringgetFullTableVar(Object O)java.lang.StringgetFullTableVar(Object O, int i)java.lang.StringgetHelperFunctionsScript(Connection Con, boolean Start)java.lang.StringgetJsonParametrizedQueryPlaceHolder()intgetMaxColumnNameSize()intgetMaxTableNameSize()java.lang.StringgetName()java.lang.StringgetSelectLimitClause(int Start, int Size)java.lang.StringgetShortColumnVar(java.lang.String name)java.lang.StringgetShortColumnVar(Column C)CodeGenSqlgetSQlCodeGen()StringStringPairgetTypeMapping(int Type, java.lang.String Name, int Size, java.lang.String TypeName)booleanisCaseSentitiveSchemaTableViewNames()booleanisSuperUser(Connection C)booleanmoveTableView(Connection con, Base base, java.lang.String oldSchemaName)booleanneedsSavepoint()booleanrenameTableColumn(Connection con, Column col, java.lang.String oldName)booleanrenameTableView(Connection con, Base base, java.lang.String oldName)booleanreorgTable(Connection con, java.lang.String schemaName, java.lang.String tableName, java.lang.String clusterIndexName, boolean verbose, boolean full)java.lang.StringrewriteExpressionColumnQuoting(java.lang.String expr)voidsetArray(Connection C, java.sql.PreparedStatement PS, int i, ColumnType Type, java.util.List<java.sql.Array> allocatedArrays, java.util.Collection<?> val)voidsetOrderByWithNullsOrdering(Connection C, java.lang.StringBuilder Str, ColumnDefinition Col, boolean Asc, boolean NullsLast)booleansupportsArrays()booleansupportsFilterClause()booleansupportsFirstLastAggregates()booleansupportsForeignKeys()booleansupportsIndices()booleansupportsPrimaryKeys()booleansupportsReorg()booleansupportsSelectLimit()booleansupportsSelectOffset()booleansupportsSuperMetaDataQueries()voidtruncateTable(Connection C, java.lang.String schemaName, java.lang.String tableName, boolean cascade)voidwithin(Connection C, java.lang.StringBuilder Str, Type_DatetimePrimitive Col, Type_DatetimePrimitive ColStart, long DurationCount, DurationUtil.IntervalEnum DurationType)
-
-
-
Field Detail
-
_NODATA_SQL_STATES
protected static final java.lang.String[] _NODATA_SQL_STATES
-
_LOCK_CONN_ERROR_SUBSTR
protected static final java.lang.String[] _LOCK_CONN_ERROR_SUBSTR
-
_SQL
protected static CodeGenSql _SQL
-
-
Method Detail
-
getConnectionNoDataStates
public java.lang.String[] getConnectionNoDataStates()
- Specified by:
getConnectionNoDataStatesin interfaceDBType
-
getCurrentTimestampStr
public java.lang.String getCurrentTimestampStr()
- Specified by:
getCurrentTimestampStrin interfaceDBType- Returns:
- The string denoting the current timestamp with timezone statement, e.g., "statement_timestamp()" for Postgres, or "CURRENT_TIMESTAMP" for bigquery.
-
getCurrentDateTimeStr
public java.lang.String getCurrentDateTimeStr()
- Specified by:
getCurrentDateTimeStrin interfaceDBType- Returns:
- The string denoting the current timestamp without timezone statement, "statement_timestamp()::timestamp" for Postgres, or "CURRENT_DATETIME" for bigquery.
-
getCurrentDateTime
public java.time.ZonedDateTime getCurrentDateTime(Connection con) throws java.lang.Exception
- Specified by:
getCurrentDateTimein interfaceDBType- Throws:
java.lang.Exception
-
getCurrentTimestamp
public java.time.ZonedDateTime getCurrentTimestamp(Connection con) throws java.lang.Exception
- Specified by:
getCurrentTimestampin interfaceDBType- Throws:
java.lang.Exception
-
getCurrentDate
public java.time.LocalDate getCurrentDate(Connection con) throws java.lang.Exception
- Specified by:
getCurrentDatein interfaceDBType- Throws:
java.lang.Exception
-
getConnectionLockMsgs
public java.lang.String[] getConnectionLockMsgs()
- Specified by:
getConnectionLockMsgsin interfaceDBType
-
needsSavepoint
public boolean needsSavepoint()
- Specified by:
needsSavepointin interfaceDBType
-
supportsSelectLimit
public boolean supportsSelectLimit()
- Specified by:
supportsSelectLimitin interfaceDBType
-
supportsSelectOffset
public boolean supportsSelectOffset()
- Specified by:
supportsSelectOffsetin interfaceDBType
-
supportsArrays
public boolean supportsArrays()
- Specified by:
supportsArraysin interfaceDBType
-
supportsSuperMetaDataQueries
public boolean supportsSuperMetaDataQueries()
- Specified by:
supportsSuperMetaDataQueriesin interfaceDBType
-
getSelectLimitClause
public java.lang.String getSelectLimitClause(int Start, int Size)- Specified by:
getSelectLimitClausein interfaceDBType
-
getAggregateStr
public java.lang.String getAggregateStr(AggregateType AT)
- Specified by:
getAggregateStrin interfaceDBType
-
fullIdentifierOnUpdate
public boolean fullIdentifierOnUpdate()
- Specified by:
fullIdentifierOnUpdatein interfaceDBType
-
getSQlCodeGen
public CodeGenSql getSQlCodeGen()
- Specified by:
getSQlCodeGenin interfaceDBType
-
createSchema
public boolean createSchema(Connection Con, Schema S) throws java.lang.Exception
- Specified by:
createSchemain interfaceDBType- Throws:
java.lang.Exception
-
createTable
public boolean createTable(Connection Con, Object Obj) throws java.lang.Exception
- Specified by:
createTablein interfaceDBType- Throws:
java.lang.Exception
-
createKeysEntry
public boolean createKeysEntry(Connection Con, Object Obj) throws java.lang.Exception
- Specified by:
createKeysEntryin interfaceDBType- Throws:
java.lang.Exception
-
dropView
public boolean dropView(Connection Con, View V) throws java.lang.Exception
-
createView
public boolean createView(Connection Con, View V) throws java.lang.Exception
- Specified by:
createViewin interfaceDBType- Throws:
java.lang.Exception
-
getColumnType
public java.lang.String getColumnType(ColumnType T, java.lang.Integer S, ColumnMode M, boolean Collection)
-
alterTableAddColumn
public boolean alterTableAddColumn(Connection Con, Column Col, java.lang.String DefaultValue, java.lang.String temporaryDefaultValue) throws java.lang.Exception
- Specified by:
alterTableAddColumnin interfaceDBType- Throws:
java.lang.Exception
-
alterTableDropColumn
public boolean alterTableDropColumn(Connection Con, Object Obj, java.lang.String ColumnName) throws java.lang.Exception
- Specified by:
alterTableDropColumnin interfaceDBType- Throws:
java.lang.Exception
-
alterTableAlterColumnNull
public boolean alterTableAlterColumnNull(Connection Con, Column Col, java.lang.String DefaultValue) throws java.lang.Exception
- Specified by:
alterTableAlterColumnNullin interfaceDBType- Throws:
java.lang.Exception
-
getDBStringType
public DBStringType getDBStringType(int Size)
- Specified by:
getDBStringTypein interfaceDBType
-
alterTableAlterColumnNumericSize
public boolean alterTableAlterColumnNumericSize(Connection connection, ColumnMeta colMeta, Column col) throws java.lang.Exception
- Specified by:
alterTableAlterColumnNumericSizein interfaceDBType- Throws:
java.lang.Exception
-
alterTableAlterColumnStringSize
public boolean alterTableAlterColumnStringSize(Connection Con, ColumnMeta ColMeta, Column Col) throws java.lang.Exception
- Specified by:
alterTableAlterColumnStringSizein interfaceDBType- Throws:
java.lang.Exception
-
alterTableAlterColumnType
public boolean alterTableAlterColumnType(Connection Con, ColumnMeta ColMeta, Column Col, ZoneInfo_Data defaultZI)
- Specified by:
alterTableAlterColumnTypein interfaceDBType
-
alterTableAlterColumnMulti
public boolean alterTableAlterColumnMulti(Connection Con, java.util.List<ColMetaColPair> BatchTypeCols, java.util.List<ColMetaColPair> BatchSizeCols, ZoneInfo_Data defaultZI)
- Specified by:
alterTableAlterColumnMultiin interfaceDBType
-
getHelperFunctionsScript
public java.lang.String getHelperFunctionsScript(Connection Con, boolean Start) throws java.lang.Exception
- Specified by:
getHelperFunctionsScriptin interfaceDBType- Throws:
java.lang.Exception
-
getTypeMapping
public StringStringPair getTypeMapping(int Type, java.lang.String Name, int Size, java.lang.String TypeName) throws java.lang.Exception
- Specified by:
getTypeMappingin interfaceDBType- Throws:
java.lang.Exception
-
getFullColumnVar
public void getFullColumnVar(java.lang.StringBuilder Str, java.lang.String SchemaName, java.lang.String TableName, java.lang.String ColumnName)- Specified by:
getFullColumnVarin interfaceDBType
-
getFullTableVar
public void getFullTableVar(java.lang.StringBuilder Str, java.lang.String SchemaName, java.lang.String TableName)- Specified by:
getFullTableVarin interfaceDBType
-
getColumnType
public void getColumnType(java.lang.StringBuilder Str, ColumnType T, java.lang.Integer S, ColumnMode M, boolean Collection, java.lang.Integer Precision, java.lang.Integer Scale)- Specified by:
getColumnTypein interfaceDBType
-
setArray
public void setArray(Connection C, java.sql.PreparedStatement PS, int i, ColumnType Type, java.util.List<java.sql.Array> allocatedArrays, java.util.Collection<?> val) throws java.lang.Exception
-
getJsonParametrizedQueryPlaceHolder
public java.lang.String getJsonParametrizedQueryPlaceHolder()
- Specified by:
getJsonParametrizedQueryPlaceHolderin interfaceDBType
-
setOrderByWithNullsOrdering
public void setOrderByWithNullsOrdering(Connection C, java.lang.StringBuilder Str, ColumnDefinition Col, boolean Asc, boolean NullsLast)
- Specified by:
setOrderByWithNullsOrderingin interfaceDBType
-
truncateTable
public void truncateTable(Connection C, java.lang.String schemaName, java.lang.String tableName, boolean cascade) throws java.lang.Exception
- Specified by:
truncateTablein interfaceDBType- Throws:
java.lang.Exception
-
age
public void age(Connection C, java.lang.StringBuilder Str, Type_DatetimePrimitive ColStart, Type_DatetimePrimitive ColEnd, DurationUtil.IntervalEnum Type, int Count, java.lang.String Operator)
-
alterTableComment
public boolean alterTableComment(Connection C, Object Obj)
- Specified by:
alterTableCommentin interfaceDBType
-
alterTableAlterColumnComment
public boolean alterTableAlterColumnComment(Connection C, Column Col)
- Specified by:
alterTableAlterColumnCommentin interfaceDBType
-
within
public void within(Connection C, java.lang.StringBuilder Str, Type_DatetimePrimitive Col, Type_DatetimePrimitive ColStart, long DurationCount, DurationUtil.IntervalEnum DurationType)
-
getAclRolesScript
public java.lang.String getAclRolesScript(Connection Con, java.util.List<Schema> TildaList) throws java.lang.Exception
- Specified by:
getAclRolesScriptin interfaceDBType- Throws:
java.lang.Exception
-
alterTableReplaceTablePK
public boolean alterTableReplaceTablePK(Connection Con, Object Obj, PKMeta oldPK) throws java.lang.Exception
- Specified by:
alterTableReplaceTablePKin interfaceDBType- Throws:
java.lang.Exception
-
alterTableDropFK
public boolean alterTableDropFK(Connection Con, Object Obj, FKMeta FK) throws java.lang.Exception
- Specified by:
alterTableDropFKin interfaceDBType- Throws:
java.lang.Exception
-
alterTableAddFK
public boolean alterTableAddFK(Connection Con, ForeignKey FK) throws java.lang.Exception
- Specified by:
alterTableAddFKin interfaceDBType- Throws:
java.lang.Exception
-
alterTableDropIndex
public boolean alterTableDropIndex(Connection Con, Object Obj, IndexMeta IX) throws java.lang.Exception
- Specified by:
alterTableDropIndexin interfaceDBType- Throws:
java.lang.Exception
-
alterTableAddIndex
public boolean alterTableAddIndex(Connection Con, Index IX) throws java.lang.Exception
- Specified by:
alterTableAddIndexin interfaceDBType- Throws:
java.lang.Exception
-
alterTableIndexDropCluster
public boolean alterTableIndexDropCluster(Connection Con, IndexMeta IX) throws java.lang.Exception
- Specified by:
alterTableIndexDropClusterin interfaceDBType- Throws:
java.lang.Exception
-
alterTableIndexAddCluster
public boolean alterTableIndexAddCluster(Connection Con, Index IX) throws java.lang.Exception
- Specified by:
alterTableIndexAddClusterin interfaceDBType- Throws:
java.lang.Exception
-
alterTableRenameIndex
public boolean alterTableRenameIndex(Connection Con, Object Obj, java.lang.String OldName, java.lang.String NewName) throws java.lang.Exception
- Specified by:
alterTableRenameIndexin interfaceDBType- Throws:
java.lang.Exception
-
isSuperUser
public boolean isSuperUser(Connection C) throws java.lang.Exception
- Specified by:
isSuperUserin interfaceDBType- Throws:
java.lang.Exception
-
getMaxColumnNameSize
public int getMaxColumnNameSize()
- Specified by:
getMaxColumnNameSizein interfaceDBType
-
getMaxTableNameSize
public int getMaxTableNameSize()
- Specified by:
getMaxTableNameSizein interfaceDBType
-
alterTableAddIndexDDL
public java.lang.String alterTableAddIndexDDL(Index IX) throws java.lang.Exception
- Specified by:
alterTableAddIndexDDLin interfaceDBType- Throws:
java.lang.Exception
-
alterTableAlterColumnDefault
public boolean alterTableAlterColumnDefault(Connection Con, Column Col) throws java.lang.Exception
- Specified by:
alterTableAlterColumnDefaultin interfaceDBType- Throws:
java.lang.Exception
-
getBackendConnectionId
public java.lang.String getBackendConnectionId(Connection connection) throws java.lang.Exception
- Specified by:
getBackendConnectionIdin interfaceDBType- Throws:
java.lang.Exception
-
cancel
public void cancel(Connection C) throws java.sql.SQLException
-
getCurrentDateStr
public java.lang.String getCurrentDateStr()
- Specified by:
getCurrentDateStrin interfaceDBType
-
dropView
public boolean dropView(Connection con, ViewMeta v, boolean cascade) throws java.lang.Exception
-
renameTableView
public boolean renameTableView(Connection con, Base base, java.lang.String oldName) throws java.lang.Exception
- Specified by:
renameTableViewin interfaceDBType- Throws:
java.lang.Exception
-
renameTableColumn
public boolean renameTableColumn(Connection con, Column col, java.lang.String oldName) throws java.lang.Exception
- Specified by:
renameTableColumnin interfaceDBType- Throws:
java.lang.Exception
-
moveTableView
public boolean moveTableView(Connection con, Base base, java.lang.String oldSchemaName) throws java.lang.Exception
- Specified by:
moveTableViewin interfaceDBType- Throws:
java.lang.Exception
-
supportsFilterClause
public boolean supportsFilterClause()
- Specified by:
supportsFilterClausein interfaceDBType
-
supportsPrimaryKeys
public boolean supportsPrimaryKeys()
- Specified by:
supportsPrimaryKeysin interfaceDBType
-
supportsForeignKeys
public boolean supportsForeignKeys()
- Specified by:
supportsForeignKeysin interfaceDBType
-
supportsIndices
public boolean supportsIndices()
- Specified by:
supportsIndicesin interfaceDBType
-
getColumnQuotingStartChar
public char getColumnQuotingStartChar()
- Specified by:
getColumnQuotingStartCharin interfaceDBType
-
getColumnQuotingEndChar
public char getColumnQuotingEndChar()
- Specified by:
getColumnQuotingEndCharin interfaceDBType
-
getConnectionCancelStates
public java.lang.String[] getConnectionCancelStates()
- Specified by:
getConnectionCancelStatesin interfaceDBType
-
getFullTableVar
public java.lang.String getFullTableVar(Object O)
- Specified by:
getFullTableVarin interfaceDBType
-
getFullTableVar
public java.lang.String getFullTableVar(Object O, int i)
- Specified by:
getFullTableVarin interfaceDBType
-
getShortColumnVar
public java.lang.String getShortColumnVar(Column C)
- Specified by:
getShortColumnVarin interfaceDBType
-
getFullColumnVar
public java.lang.String getFullColumnVar(Column C)
- Specified by:
getFullColumnVarin interfaceDBType
-
getFullColumnVar
public java.lang.String getFullColumnVar(Column C, int i)
- Specified by:
getFullColumnVarin interfaceDBType
-
getColumnType
public java.lang.String getColumnType(Column C)
- Specified by:
getColumnTypein interfaceDBType
-
getColumnType
public java.lang.String getColumnType(Column C, ColumnType AggregateType)
- Specified by:
getColumnTypein interfaceDBType
-
getColumnTypeRaw
public java.lang.String getColumnTypeRaw(Column C, boolean MultiOverride)
- Specified by:
getColumnTypeRawin interfaceDBType
-
getColumnTypeRaw
public java.lang.String getColumnTypeRaw(ColumnType Type, int Size, boolean isArray)
- Specified by:
getColumnTypeRawin interfaceDBType
-
supportsFirstLastAggregates
public boolean supportsFirstLastAggregates()
- Specified by:
supportsFirstLastAggregatesin interfaceDBType
-
getShortColumnVar
public java.lang.String getShortColumnVar(java.lang.String name)
- Specified by:
getShortColumnVarin interfaceDBType
-
rewriteExpressionColumnQuoting
public java.lang.String rewriteExpressionColumnQuoting(java.lang.String expr)
- Specified by:
rewriteExpressionColumnQuotingin interfaceDBType
-
supportsReorg
public boolean supportsReorg()
- Specified by:
supportsReorgin interfaceDBType
-
reorgTable
public boolean reorgTable(Connection con, java.lang.String schemaName, java.lang.String tableName, java.lang.String clusterIndexName, boolean verbose, boolean full) throws java.lang.Exception
- Specified by:
reorgTablein interfaceDBType- Throws:
java.lang.Exception
-
isCaseSentitiveSchemaTableViewNames
public boolean isCaseSentitiveSchemaTableViewNames()
- Specified by:
isCaseSentitiveSchemaTableViewNamesin interfaceDBType
-
-