Package org.h2.engine
Class Mode
java.lang.Object
org.h2.engine.Mode
The compatibility modes. There is a fixed set of modes (for example
PostgreSQL, MySQL). Each mode has different settings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhen CHAR values are right-padded with spaces.static enumGeneration of column names for expressions.static enumstatic enumGeneration of column names for expressions to be used in a view. -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanAccepts comma ',' as key/value separator in JSON_OBJECT and JSON_OBJECTAGG functions.booleanWhen enabled, aliased columns (as in SELECT ID AS I FROM TEST) return the alias (I in this case) in ResultSetMetaData.getColumnName() and 'null' in getTableName().booleanIftrueall numeric data types may have precision and 'UNSIGNED' clause.booleanWhether DB2 TIMESTAMP formats are allowed.booleanWhether IN predicate may have an empty value list.booleanIftrueconstructs like 'CREATE TABLE CATALOG..TABLE_NAME' are allowed, the default schema is used.booleanText can be concatenated using '+'.booleanIftrueunrelated ORDER BY expression are allowed in DISTINCT queries, iffalsethey are disallowed.booleanIftrue, allow using from clause in update statement.booleanIftruesome additional non-standard ALTER TABLE commands are allowed.booleanIftruenon-standard ALTER TABLE MODIFY COLUMN is allowed.booleanIftruenon-standard ALTER TABLE MODIFY COLUMN preserves nullability when changing data type.booleanWhether MySQL-style AUTO_INCREMENT clause is supported.booleanIftrue'CHAR' and 'BYTE' length units are allowed.How to pad or trim CHAR values.booleanWhen converting the scale of decimal data, the number is only converted if the new scale is smaller than the current scale.booleanIftrue, referential constraints will create a unique constraint on referenced columns if it doesn't exist instead of throwing an exception.How column names are generated for CTEs.booleanWhether DATE data type is parsed as TIMESTAMP(0).booleanWhether MySQL-style DATETIME and YEAR data type is parsed.booleanWhether DATETIME, SMALLDATETIME, DATETIME2, and DATETIMEOFFSET data types are parsed.booleanIftrue, datetime value function return the same value within a transaction, iffalsedatetime value functions return the same value within a command.booleanIftrueNEXT VALUE FOR SEQUENCE, CURRENT VALUE FOR SEQUENCE, SEQUENCE.NEXTVAL, and SEQUENCE.CURRVAL return values with DECIMAL/NUMERIC data type instead of BIGINT.booleanIftrueDELETE identifier FROM is allowedAn optional Set of hidden/disallowed column types.booleanDiscard SQLServer table hints (e.g.How column names are generated for expressions.booleanIftrue'FOR BIT DATA' clauses are allowed for character string data types.booleanIftrueGREATEST and LEAST ignore nullsbooleanAllow to use GROUP BY n, where n is column index in the SELECT list, similar to ORDER BYbooleanWhether SQL Server-style IDENTITY clause is supported.booleanIftrue, identity columns have DEFAULT ON NULL clause.booleanWhether IDENTITY pseudo data type is supported.booleanCreating indexes in the CREATE TABLE statement is allowed usingINDEX(..)orKEY(..).booleanPostgreSQL style INSERT ...booleancan set the isolation level using WITH {RR|RS|CS|UR}booleanWhether LIMIT / OFFSET clauses are supported.booleanThe single-argument function LOG() uses base 10 instead of E.booleanIftrue, merge when matched clause may have WHERE clause.booleanWhether MINUS can be used as EXCEPT.booleanIftrueMySQL table and column options are allowedbooleanIftrue, sequence.NEXTVAL and sequence.CURRVAL pseudo columns are supported.booleanIftrue, the next value expression returns different values when invoked multiple times within a row.Determines how rows withNULLvalues in indexed columns are handled in unique indexes and constraints by default.booleanWhether NUMERIC and DECIMAL/DEC without parameters are parsed as DECFLOAT.booleanAllow to compare numeric with BOOLEAN.booleanMySQL style INSERT ...booleanThe function REGEXP_REPLACE() uses \ for back-references.booleanMySQL style REPLACE INTO.booleanWhether SERIAL and BIGSERIAL pseudo data types are supported.booleanIdentifiers may be quoted using square brackets as in [Test].Pattern describing the keys the java.sql.Connection.setClientInfo() method accepts.booleanSupport the # for column namesbooleanSwap the parameters of the CONVERT function.booleanSwap the parameters of LOG() function.booleanSupport the pseudo-table SYSIBM.SYSDUMMY1.booleanThe system columns 'ctid' and 'oid' are supported.booleanIftrue, last identity of the session is updated on generation of a new sequence value.booleanIftrue, last identity of the session is updated on insertion of a new value into identity column.booleanWhether TOP clause in DML commands is supported.booleanWhether TOP clause in SELECT queries is supported.booleanEmpty strings are treated like NULL values.booleanIftrueTRUNCATE TABLE uses RESTART IDENTITY by default.Custom mappings from type names to data types.booleanIftrue, sequences of generated by default identity columns are updated when value is provided by user.How column names are generated for views.booleanIftrue0x-prefixed numbers are parsed as binary string literals, iffalsethey are parsed as hexadecimal numeric values. -
Method Summary
-
Field Details
-
aliasColumnName
public boolean aliasColumnNameWhen enabled, aliased columns (as in SELECT ID AS I FROM TEST) return the alias (I in this case) in ResultSetMetaData.getColumnName() and 'null' in getTableName(). If disabled, the real column name (ID in this case) and table name is returned. -
convertOnlyToSmallerScale
public boolean convertOnlyToSmallerScaleWhen converting the scale of decimal data, the number is only converted if the new scale is smaller than the current scale. Usually, the scale is converted and 0s are added if required. -
indexDefinitionInCreateTable
public boolean indexDefinitionInCreateTableCreating indexes in the CREATE TABLE statement is allowed usingINDEX(..)orKEY(..). Example:create table test(id int primary key, name varchar(255), key idx_name(name)); -
squareBracketQuotedNames
public boolean squareBracketQuotedNamesIdentifiers may be quoted using square brackets as in [Test]. -
systemColumns
public boolean systemColumnsThe system columns 'ctid' and 'oid' are supported. -
nullsDistinct
Determines how rows withNULLvalues in indexed columns are handled in unique indexes and constraints by default. -
treatEmptyStringsAsNull
public boolean treatEmptyStringsAsNullEmpty strings are treated like NULL values. Useful for Oracle emulation. -
greatestLeastIgnoreNulls
public boolean greatestLeastIgnoreNullsIftrueGREATEST and LEAST ignore nulls -
sysDummy1
public boolean sysDummy1Support the pseudo-table SYSIBM.SYSDUMMY1. -
allowPlusForStringConcat
public boolean allowPlusForStringConcatText can be concatenated using '+'. -
logIsLogBase10
public boolean logIsLogBase10The single-argument function LOG() uses base 10 instead of E. -
swapLogFunctionParameters
public boolean swapLogFunctionParametersSwap the parameters of LOG() function. -
regexpReplaceBackslashReferences
public boolean regexpReplaceBackslashReferencesThe function REGEXP_REPLACE() uses \ for back-references. -
swapConvertFunctionParameters
public boolean swapConvertFunctionParametersSwap the parameters of the CONVERT function. -
isolationLevelInSelectOrInsertStatement
public boolean isolationLevelInSelectOrInsertStatementcan set the isolation level using WITH {RR|RS|CS|UR} -
onDuplicateKeyUpdate
public boolean onDuplicateKeyUpdateMySQL style INSERT ... ON DUPLICATE KEY UPDATE ... and INSERT IGNORE. -
replaceInto
public boolean replaceIntoMySQL style REPLACE INTO. -
insertOnConflict
public boolean insertOnConflictPostgreSQL style INSERT ... ON CONFLICT DO NOTHING. -
supportedClientInfoPropertiesRegEx
Pattern describing the keys the java.sql.Connection.setClientInfo() method accepts. -
supportPoundSymbolForColumnNames
public boolean supportPoundSymbolForColumnNamesSupport the # for column names -
allowEmptyInPredicate
public boolean allowEmptyInPredicateWhether IN predicate may have an empty value list. -
charPadding
How to pad or trim CHAR values. -
allowDB2TimestampFormat
public boolean allowDB2TimestampFormatWhether DB2 TIMESTAMP formats are allowed. -
discardWithTableHints
public boolean discardWithTableHintsDiscard SQLServer table hints (e.g. "SELECT * FROM table WITH (NOLOCK)") -
dateTimeValueWithinTransaction
public boolean dateTimeValueWithinTransactionIftrue, datetime value function return the same value within a transaction, iffalsedatetime value functions return the same value within a command. -
zeroExLiteralsAreBinaryStrings
public boolean zeroExLiteralsAreBinaryStringsIftrue0x-prefixed numbers are parsed as binary string literals, iffalsethey are parsed as hexadecimal numeric values. -
alterTableExtensionsMySQL
public boolean alterTableExtensionsMySQLIftruesome additional non-standard ALTER TABLE commands are allowed. -
alterTableModifyColumn
public boolean alterTableModifyColumnIftruenon-standard ALTER TABLE MODIFY COLUMN is allowed. -
alterTableModifyColumnPreserveNullability
public boolean alterTableModifyColumnPreserveNullabilityIftruenon-standard ALTER TABLE MODIFY COLUMN preserves nullability when changing data type. -
mySqlTableOptions
public boolean mySqlTableOptionsIftrueMySQL table and column options are allowed -
deleteIdentifierFrom
public boolean deleteIdentifierFromIftrueDELETE identifier FROM is allowed -
truncateTableRestartIdentity
public boolean truncateTableRestartIdentityIftrueTRUNCATE TABLE uses RESTART IDENTITY by default. -
decimalSequences
public boolean decimalSequencesIftrueNEXT VALUE FOR SEQUENCE, CURRENT VALUE FOR SEQUENCE, SEQUENCE.NEXTVAL, and SEQUENCE.CURRVAL return values with DECIMAL/NUMERIC data type instead of BIGINT. -
allowEmptySchemaValuesAsDefaultSchema
public boolean allowEmptySchemaValuesAsDefaultSchemaIftrueconstructs like 'CREATE TABLE CATALOG..TABLE_NAME' are allowed, the default schema is used. -
allNumericTypesHavePrecision
public boolean allNumericTypesHavePrecisionIftrueall numeric data types may have precision and 'UNSIGNED' clause. -
forBitData
public boolean forBitDataIftrue'FOR BIT DATA' clauses are allowed for character string data types. -
charAndByteLengthUnits
public boolean charAndByteLengthUnitsIftrue'CHAR' and 'BYTE' length units are allowed. -
nextvalAndCurrvalPseudoColumns
public boolean nextvalAndCurrvalPseudoColumnsIftrue, sequence.NEXTVAL and sequence.CURRVAL pseudo columns are supported. -
nextValueReturnsDifferentValues
public boolean nextValueReturnsDifferentValuesIftrue, the next value expression returns different values when invoked multiple times within a row. This setting does not affect NEXTVAL() function. -
updateSequenceOnManualIdentityInsertion
public boolean updateSequenceOnManualIdentityInsertionIftrue, sequences of generated by default identity columns are updated when value is provided by user. -
takeInsertedIdentity
public boolean takeInsertedIdentityIftrue, last identity of the session is updated on insertion of a new value into identity column. -
takeGeneratedSequenceValue
public boolean takeGeneratedSequenceValueIftrue, last identity of the session is updated on generation of a new sequence value. -
identityColumnsHaveDefaultOnNull
public boolean identityColumnsHaveDefaultOnNullIftrue, identity columns have DEFAULT ON NULL clause. -
mergeWhere
public boolean mergeWhereIftrue, merge when matched clause may have WHERE clause. -
allowUsingFromClauseInUpdateStatement
public boolean allowUsingFromClauseInUpdateStatementIftrue, allow using from clause in update statement. -
createUniqueConstraintForReferencedColumns
public boolean createUniqueConstraintForReferencedColumnsIftrue, referential constraints will create a unique constraint on referenced columns if it doesn't exist instead of throwing an exception. -
expressionNames
How column names are generated for expressions. -
viewExpressionNames
How column names are generated for views. -
cteExpressionNames
How column names are generated for CTEs. -
topInSelect
public boolean topInSelectWhether TOP clause in SELECT queries is supported. -
topInDML
public boolean topInDMLWhether TOP clause in DML commands is supported. -
limit
public boolean limitWhether LIMIT / OFFSET clauses are supported. -
minusIsExcept
public boolean minusIsExceptWhether MINUS can be used as EXCEPT. -
identityDataType
public boolean identityDataTypeWhether IDENTITY pseudo data type is supported. -
serialDataTypes
public boolean serialDataTypesWhether SERIAL and BIGSERIAL pseudo data types are supported. -
identityClause
public boolean identityClauseWhether SQL Server-style IDENTITY clause is supported. -
autoIncrementClause
public boolean autoIncrementClauseWhether MySQL-style AUTO_INCREMENT clause is supported. -
dateIsTimestamp0
public boolean dateIsTimestamp0Whether DATE data type is parsed as TIMESTAMP(0). -
datetimeAndYearType
public boolean datetimeAndYearTypeWhether MySQL-style DATETIME and YEAR data type is parsed. -
datetimeTypes
public boolean datetimeTypesWhether DATETIME, SMALLDATETIME, DATETIME2, and DATETIMEOFFSET data types are parsed. -
numericIsDecfloat
public boolean numericIsDecfloatWhether NUMERIC and DECIMAL/DEC without parameters are parsed as DECFLOAT. -
disallowedTypes
An optional Set of hidden/disallowed column types. Certain DBMSs don't support all column types provided by H2, such as "NUMBER" when using PostgreSQL mode. -
typeByNameMap
Custom mappings from type names to data types. -
groupByColumnIndex
public boolean groupByColumnIndexAllow to use GROUP BY n, where n is column index in the SELECT list, similar to ORDER BY -
numericWithBooleanComparison
public boolean numericWithBooleanComparisonAllow to compare numeric with BOOLEAN. -
acceptsCommaAsJsonKeyValueSeparator
public boolean acceptsCommaAsJsonKeyValueSeparatorAccepts comma ',' as key/value separator in JSON_OBJECT and JSON_OBJECTAGG functions.
-
-
Method Details