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
Modifier and TypeClassDescriptionstatic enum
When CHAR values are right-padded with spaces.static enum
Generation of column names for expressions.static enum
static enum
Generation of column names for expressions to be used in a view. -
Field Summary
Modifier and TypeFieldDescriptionboolean
Accepts comma ',' as key/value separator in JSON_OBJECT and JSON_OBJECTAGG functions.boolean
When 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().boolean
Iftrue
all numeric data types may have precision and 'UNSIGNED' clause.boolean
Whether DB2 TIMESTAMP formats are allowed.boolean
Whether IN predicate may have an empty value list.boolean
Iftrue
constructs like 'CREATE TABLE CATALOG..TABLE_NAME' are allowed, the default schema is used.boolean
Text can be concatenated using '+'.boolean
Iftrue
unrelated ORDER BY expression are allowed in DISTINCT queries, iffalse
they are disallowed.boolean
Iftrue
, allow using from clause in update statement.boolean
Iftrue
some additional non-standard ALTER TABLE commands are allowed.boolean
Iftrue
non-standard ALTER TABLE MODIFY COLUMN is allowed.boolean
Iftrue
non-standard ALTER TABLE MODIFY COLUMN preserves nullability when changing data type.boolean
Whether MySQL-style AUTO_INCREMENT clause is supported.boolean
Iftrue
'CHAR' and 'BYTE' length units are allowed.How to pad or trim CHAR values.boolean
When converting the scale of decimal data, the number is only converted if the new scale is smaller than the current scale.boolean
Iftrue
, referential constraints will create a unique constraint on referenced columns if it doesn't exist instead of throwing an exception.boolean
Whether DATE data type is parsed as TIMESTAMP(0).boolean
Iftrue
, datetime value function return the same value within a transaction, iffalse
datetime value functions return the same value within a command.boolean
Iftrue
NEXT VALUE FOR SEQUENCE, CURRENT VALUE FOR SEQUENCE, SEQUENCE.NEXTVAL, and SEQUENCE.CURRVAL return values with DECIMAL/NUMERIC data type instead of BIGINT.boolean
Iftrue
DELETE identifier FROM is allowedAn optional Set of hidden/disallowed column types.boolean
Discard SQLServer table hints (e.g.How column names are generated for expressions.boolean
Iftrue
'FOR BIT DATA' clauses are allowed for character string data types.boolean
Iftrue
GREATEST and LEAST ignore nullsboolean
Allow to use GROUP BY n, where n is column index in the SELECT list, similar to ORDER BYboolean
Whether SQL Server-style IDENTITY clause is supported.boolean
Iftrue
, identity columns have DEFAULT ON NULL clause.boolean
Whether IDENTITY pseudo data type is supported.boolean
Creating indexes in the CREATE TABLE statement is allowed usingINDEX(..)
orKEY(..)
.boolean
PostgreSQL style INSERT ...boolean
can set the isolation level using WITH {RR|RS|CS|UR}boolean
Whether LIMIT / OFFSET clauses are supported.boolean
The single-argument function LOG() uses base 10 instead of E.boolean
Iftrue
, merge when matched clause may have WHERE clause.boolean
Whether MINUS can be used as EXCEPT.boolean
Iftrue
MySQL table and column options are allowedboolean
Iftrue
, sequence.NEXTVAL and sequence.CURRVAL pseudo columns are supported.boolean
Iftrue
, the next value expression returns different values when invoked multiple times within a row.Determines how rows withNULL
values in indexed columns are handled in unique indexes and constraints by default.boolean
Whether NUMERIC and DECIMAL/DEC without parameters are parsed as DECFLOAT.boolean
Allow to compare numeric with BOOLEAN.boolean
MySQL style INSERT ...boolean
The function REGEXP_REPLACE() uses \ for back-references.boolean
MySQL style REPLACE INTO.boolean
Whether SERIAL and BIGSERIAL pseudo data types are supported.boolean
Identifiers may be quoted using square brackets as in [Test].Pattern describing the keys the java.sql.Connection.setClientInfo() method accepts.boolean
Support the # for column namesboolean
Swap the parameters of the CONVERT function.boolean
Swap the parameters of LOG() function.boolean
Support the pseudo-table SYSIBM.SYSDUMMY1.boolean
The system columns 'ctid' and 'oid' are supported.boolean
Iftrue
, last identity of the session is updated on generation of a new sequence value.boolean
Iftrue
, last identity of the session is updated on insertion of a new value into identity column.boolean
Whether TOP clause in DML commands is supported.boolean
Whether TOP clause in SELECT queries is supported.boolean
Empty strings are treated like NULL values.boolean
Iftrue
TRUNCATE TABLE uses RESTART IDENTITY by default.Custom mappings from type names to data types.boolean
Iftrue
, sequences of generated by default identity columns are updated when value is provided by user.How column names are generated for views.boolean
Iftrue
0x
-prefixed numbers are parsed as binary string literals, iffalse
they 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 withNULL
values 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 greatestLeastIgnoreNullsIftrue
GREATEST 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, iffalse
datetime value functions return the same value within a command. -
zeroExLiteralsAreBinaryStrings
public boolean zeroExLiteralsAreBinaryStringsIftrue
0x
-prefixed numbers are parsed as binary string literals, iffalse
they are parsed as hexadecimal numeric values. -
alterTableExtensionsMySQL
public boolean alterTableExtensionsMySQLIftrue
some additional non-standard ALTER TABLE commands are allowed. -
alterTableModifyColumn
public boolean alterTableModifyColumnIftrue
non-standard ALTER TABLE MODIFY COLUMN is allowed. -
alterTableModifyColumnPreserveNullability
public boolean alterTableModifyColumnPreserveNullabilityIftrue
non-standard ALTER TABLE MODIFY COLUMN preserves nullability when changing data type. -
mySqlTableOptions
public boolean mySqlTableOptionsIftrue
MySQL table and column options are allowed -
deleteIdentifierFrom
public boolean deleteIdentifierFromIftrue
DELETE identifier FROM is allowed -
truncateTableRestartIdentity
public boolean truncateTableRestartIdentityIftrue
TRUNCATE TABLE uses RESTART IDENTITY by default. -
decimalSequences
public boolean decimalSequencesIftrue
NEXT 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 allowEmptySchemaValuesAsDefaultSchemaIftrue
constructs like 'CREATE TABLE CATALOG..TABLE_NAME' are allowed, the default schema is used. -
allNumericTypesHavePrecision
public boolean allNumericTypesHavePrecisionIftrue
all 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. -
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). -
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