- All Implemented Interfaces:
Serializable
,Comparable<SQLDialect>
,Constable
The commercial jOOQ distributions support a variety of dialects, which are
grouped into dialect families. For instance, the PostgreSQL dialect family
POSTGRES
is specialised by its dialects
#POSTGRES_9_3
#POSTGRES_9_4
#POSTGRES_9_5
#POSTGRES_10
#POSTGRES_11
#POSTGRES_12
#POSTGRES_13
#POSTGRES_14
The open source jOOQ distributions only support the dialect family, which corresponds to the latest supported dialect version of the commercial distribution. A full list of mappings between dialect families and latest supported version can be seen here https://www.jooq.org/download/support-matrix.
If a dialect is documented but does not seem to be available in your jOOQ Edition, you may be using the wrong edition, e.g. because of a transitive dependency introduced by Spring Boot. See this article about how to exclude such transitive dependencies from your classpath https://blog.jooq.org/how-to-use-jooqs-commercial-distributions-with-spring-boot/.
- Author:
- Lukas Eder
-
Nested Class Summary
Modifier and TypeClassDescriptionfinal class
Third party representations of the enclosingSQLDialect
.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDeprecated, for removal: This API element is subject to removal in a future version.- [#9403] - 3.13.0 - This dialect is hardly used by anyone with jOOQ or without jOOQ and will be removed in the near future.The default SQL dialect.The Apache Derby dialect family.The Firebird dialect family.The H2 dialect family.The Hypersonic dialect family.Deprecated, for removal: This API element is subject to removal in a future version.- [#12465] - 3.16.0 - This dialect is hardly used by anyone with jOOQ or without jOOQ and will be removed in the near future.The MariaDB dialect family.The MySQL dialect family.The PostgreSQL dialect family.The SQLite dialect family.The YugabyteDB dialect family. -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull SQLDialectCategory
category()
The dialect category.final boolean
Whether this dialect is supported with the jOOQ commercial license only.static final @NotNull SQLDialect @NotNull []
families()
Get a list of allfamily()
values.final @NotNull SQLDialect
family()
The dialect family.final @NotNull String
getName()
The name of this dialect as it appears in related class names.final @NotNull String
The name of this dialect as it appears in related package names.final @NotNull String
The name of this dialect as it appears in related enum values.final boolean
isFamily()
Whether this dialect is afamily()
.final boolean
Whether this dialect is a versioned dialect or a family with versioned dialects.final boolean
precedes
(SQLDialect other) Whether this dialect precedes an other dialect from the same family.final boolean
precedesStrictly
(SQLDialect other) Whether this dialect strictly precedes an other dialect from the same family.final @NotNull SQLDialect
The predecessor dialect.final @NotNull Set<SQLDialect>
The predecessor dialects.static final @NotNull Set<SQLDialect>
predecessors
(SQLDialect... dialects) Get a set of dialects preceding a given set of dialects.final boolean
Whether this dialect is supported by jOOQ as an output dialect.static final @NotNull Set<SQLDialect>
supportedBy
(SQLDialect dialect) Get a set of supported dialect versions and successors given a dialect version.static final @NotNull Set<SQLDialect>
supportedBy
(SQLDialect... dialects) Get a set of supported dialect versions and successors given a set of dialect versions.static final @NotNull Set<SQLDialect>
supportedUntil
(SQLDialect dialect) Get a set of supported dialect versions and predecessors given a dialect version.static final @NotNull Set<SQLDialect>
supportedUntil
(SQLDialect... dialects) Get a set of supported dialect versions and predecessors given a dialect version.final boolean
supports
(Collection<SQLDialect> other) Deprecated, for removal: This API element is subject to removal in a future version.- [#9882] - 3.14.0 - UsesupportedBy(SQLDialect...)
insteadfinal boolean
supports
(SQLDialect other) Check whether this dialect supports another one.final boolean
supportsDatabaseVersion
(int majorVersion, int minorVersion, String productVersion) Check if thisSQLDialect
supports a JDBCDatabaseMetaData.getDatabaseMajorVersion()
,DatabaseMetaData.getDatabaseMinorVersion()
, patch version.final @NotNull SQLDialect.ThirdParty
Get access to third party representations of thisSQLDialect
.static SQLDialect
Returns the enum constant of this class with the specified name.static SQLDialect[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
The default SQL dialect.This dialect is chosen in the absence of a more explicit dialect. It is not intended to be used with any actual database as it may combined dialect-specific things from various dialects.
-
CUBRID
Deprecated, for removal: This API element is subject to removal in a future version.- [#9403] - 3.13.0 - This dialect is hardly used by anyone with jOOQ or without jOOQ and will be removed in the near future.The CUBRID dialect family. -
DERBY
The Apache Derby dialect family. -
FIREBIRD
The Firebird dialect family.This family behaves like the versioned dialect
#FIREBIRD_3_0
. -
H2
The H2 dialect family. -
HSQLDB
The Hypersonic dialect family. -
IGNITE
Deprecated, for removal: This API element is subject to removal in a future version.- [#12465] - 3.16.0 - This dialect is hardly used by anyone with jOOQ or without jOOQ and will be removed in the near future. If you're actively using this dialect, please get in touch for extended support: https://github.com/jOOQ/jOOQ/issues/12465The Apache Ignite dialect family. -
MARIADB
The MariaDB dialect family.This family behaves like the versioned dialect
#MARIADB_10_5
. -
MYSQL
The MySQL dialect family.This family behaves like the versioned dialect
#MYSQL_8_0_31
. -
POSTGRES
The PostgreSQL dialect family.This family behaves like the versioned dialect
#POSTGRES_15
.While this family (and its dialects) have been observed to work to some extent on Amazon RedShift as well, we strongly suggest you use the official
#REDSHIFT
support, instead. -
SQLITE
The SQLite dialect family.This family behaves like the versioned dialect
#SQLITE_3_39
. -
YUGABYTEDB
The YugabyteDB dialect family.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
families
Get a list of allfamily()
values. -
predecessors
Get a set of dialects preceding a given set of dialects.The resulting set of dialects contain all the families and dialect versions that precede the argument dialects, including the argument dialects.
-
supportedUntil
Get a set of supported dialect versions and predecessors given a dialect version.The resulting set of dialects contain all the families and dialect versions that precede the argument dialect, including the argument dialect.
-
supportedUntil
Get a set of supported dialect versions and predecessors given a dialect version.The resulting set of dialects contain all the families and dialect versions that precede the argument dialect, including the argument dialects.
-
supportedBy
Get a set of supported dialect versions and successors given a dialect version.The resulting set of dialects contain all the families and dialect versions that support the argument dialect, i.e. that succeed it, including the argument dialect.
-
supportedBy
Get a set of supported dialect versions and successors given a set of dialect versions.The resulting set of dialects contain all the families and dialect versions that support the argument dialects, i.e. that succeed them, including the argument dialects.
-
commercial
public final boolean commercial()Whether this dialect is supported with the jOOQ commercial license only. -
supported
public final boolean supported()Whether this dialect is supported by jOOQ as an output dialect.Unsupported, non-output dialects include:
DEFAULT
: A hypothetical dialect used forQueryPart.toString()
calls of unattached query parts.#POSTGRESPLUS
: A not yet supported dialect.
-
family
The dialect family.This returns the dialect itself, if it has no "parent family". E.g.
SQLSERVER == SQLSERVER2012.family(); SQLSERVER == SQLSERVER2008.family(); SQLSERVER == SQLSERVER.family();
-
category
The dialect category. -
isFamily
public final boolean isFamily()Whether this dialect is afamily()
. -
isVersioned
public final boolean isVersioned()Whether this dialect is a versioned dialect or a family with versioned dialects. -
predecessor
The predecessor dialect.If this is a dialect version (e.g.
#POSTGRES_9_4
) within a family (e.g.POSTGRES
), then the predecessor will point to the historically previous dialect version (e.g.#POSTGRES_9_3
) within the same family, or to the dialect itself if there was no predecessor explicitly supported by jOOQ. -
predecessors
The predecessor dialects.Recursively calls
predecessor()
and finds all the preceding dialects to this one, including this one. -
precedes
Whether this dialect precedes an other dialect from the same family.This returns:
true
if this dialect is the same as the other dialecttrue
if this dialect precedes the other dialect via any number of calls topredecessor()
false
if the two dialects do not belong to the same family
This is useful to see if some feature is supported by "at least" a given dialect version. Example:
// Do this block only if the chosen dialect supports PostgreSQL 9.4+ features if (POSTGRES_9_4.precedes(dialect)) { } // Do this block only if the chosen dialect supports PostgreSQL 9.3+ features else if (POSTGRES_9_3.precedes(dialect)) { } // Fall back to pre-PostgreSQL 9.3 behaviour else { }
-
precedesStrictly
Whether this dialect strictly precedes an other dialect from the same family.This returns:
false
if this dialect is the same as the other dialecttrue
if this dialect precedes the other dialect via any number of calls topredecessor()
false
if the two dialects do not belong to the same family
This is useful to see if some feature is supported by "at least" a given dialect version. Example:
// Do this block only if the chosen dialect was before PostgreSQL 9.3- if (dialect.precedesStrictly(POSTGRES)) { } // Do this block only if the chosen dialect was before PostgreSQL 9.4- else if (dialect.precedesStrictly(POSTGRES)) { } // Fall back to post-PostgreSQL 9.4+ behaviour else { }
-
supports
Check whether this dialect supports another one.This is:
false
if dialects don't belong to the same familytrue
if either dialectisFamily()
true
ifother
dialect precedes this dialect
The
other
argument dialect is typically referenced from aSupport
annotation, whereas this dialect is the user dialect. -
supports
@Deprecated(forRemoval=true, since="3.14") public final boolean supports(Collection<SQLDialect> other) Deprecated, for removal: This API element is subject to removal in a future version.- [#9882] - 3.14.0 - UsesupportedBy(SQLDialect...)
insteadCheck whether this dialect supports any dialect from the argument collection. -
supportsDatabaseVersion
public final boolean supportsDatabaseVersion(int majorVersion, int minorVersion, String productVersion) Check if thisSQLDialect
supports a JDBCDatabaseMetaData.getDatabaseMajorVersion()
,DatabaseMetaData.getDatabaseMinorVersion()
, patch version. -
getName
The name of this dialect as it appears in related class names. -
getNameLC
The name of this dialect as it appears in related package names. -
getNameUC
The name of this dialect as it appears in related enum values. -
thirdParty
Get access to third party representations of thisSQLDialect
.
-