Module org.jooq
Package org.jooq

Enum SQLDialect

  • All Implemented Interfaces:
    Serializable, Comparable<SQLDialect>

    public enum SQLDialect
    extends Enum<SQLDialect>
    Dialects and dialect families as supported by jOOQ.

    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/2019/06/26/how-to-use-jooqs-commercial-distributions-with-spring-boot/.

    Author:
    Lukas Eder
    • Enum Constant Detail

      • DEFAULT

        public static final SQLDialect 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(forRemoval=true,
                    since="3.13")
        public static final SQLDialect 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

        public static final SQLDialect DERBY
        The Apache Derby dialect family.
      • FIREBIRD

        public static final SQLDialect FIREBIRD
        The Firebird dialect family.

        This family behaves like the versioned dialect #FIREBIRD_3_0.

      • H2

        public static final SQLDialect H2
        The H2 dialect family.
      • HSQLDB

        public static final SQLDialect HSQLDB
        The Hypersonic dialect family.
      • IGNITE

        @Deprecated(forRemoval=true,
                    since="3.16")
        public static final SQLDialect 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/12465
        The Apache Ignite dialect family.
      • MARIADB

        public static final SQLDialect MARIADB
        The MariaDB dialect family.

        This family behaves like the versioned dialect #MARIADB_10_5.

      • MYSQL

        public static final SQLDialect MYSQL
        The MySQL dialect family.

        This family behaves like the versioned dialect #MYSQL_8_0_19.

      • POSTGRES

        public static final SQLDialect POSTGRES
        The PostgreSQL dialect family.

        This family behaves like the versioned dialect #POSTGRES_13.

        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

        public static final SQLDialect SQLITE
        The SQLite dialect family.

        This family behaves like the versioned dialect #SQLITE_3_30.

      • YUGABYTEDB

        public static final SQLDialect YUGABYTEDB
        The YugabyteDB dialect family.
    • Method Detail

      • values

        public static SQLDialect[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SQLDialect c : SQLDialect.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SQLDialect valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • families

        @NotNull
        public static final @NotNull SQLDialect @NotNull [] families()
        Get a list of all family() values.
      • predecessors

        @NotNull
        public static final @NotNull Set<SQLDialect> predecessors​(SQLDialect... dialects)
        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

        @NotNull
        public static final @NotNull Set<SQLDialect> supportedUntil​(SQLDialect dialect)
        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

        @NotNull
        public static final @NotNull Set<SQLDialect> supportedUntil​(SQLDialect... dialects)
        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

        @NotNull
        public static final @NotNull Set<SQLDialect> supportedBy​(SQLDialect dialect)
        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

        @NotNull
        public static final @NotNull Set<SQLDialect> supportedBy​(SQLDialect... dialects)
        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 for QueryPart.toString() calls of unattached query parts.
        • #POSTGRESPLUS: A not yet supported dialect.
      • family

        @NotNull
        public final @NotNull SQLDialect 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();
         
      • isFamily

        public final boolean isFamily()
        Whether this dialect is a family().
      • isVersioned

        public final boolean isVersioned()
        Whether this dialect is a versioned dialect or a family with versioned dialects.
      • predecessor

        @NotNull
        public final @NotNull SQLDialect 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

        @NotNull
        public final @NotNull Set<SQLDialect> predecessors()
        The predecessor dialects.

        Recursively calls predecessor() and finds all the preceding dialects to this one, including this one.

      • precedes

        public final boolean precedes​(SQLDialect other)
        Whether this dialect precedes an other dialect from the same family.

        This returns:

        • true if this dialect is the same as the other dialect
        • true if this dialect precedes the other dialect via any number of calls to predecessor()
        The above also implies that:
        • 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 {
         }
         
      • supports

        public final boolean supports​(SQLDialect other)
        Check whether this dialect supports another one.

        This is:

        • false if dialects don't belong to the same family
        • true if either dialect isFamily()
        • true if other dialect precedes this dialect

        The other argument dialect is typically referenced from a Support annotation, whereas this dialect is the user dialect.

      • getName

        @NotNull
        public final @NotNull String getName()
        The name of this dialect as it appears in related class names.
      • getNameLC

        @NotNull
        public final @NotNull String getNameLC()
        The name of this dialect as it appears in related package names.
      • getNameUC

        @NotNull
        public final @NotNull String getNameUC()
        The name of this dialect as it appears in related enum values.