Enum Class DatabaseType

java.lang.Object
java.lang.Enum<DatabaseType>
io.micronaut.data.model.runtime.convert.DatabaseType
All Implemented Interfaces:
Serializable, Comparable<DatabaseType>, Constable

public enum DatabaseType extends Enum<DatabaseType>
Canonical database types supported across SQL and NoSQL stores.

This abstraction is intentionally separate from SQL Dialect so conversion and definition providers can share one switch across SQL and non-SQL stores.

For SQL backends, use from(Dialect) to translate from the SQL dialect.

Since:
5.0.0
  • Enum Constant Details

    • POSTGRES

      public static final DatabaseType POSTGRES
      PostgreSQL and PostgreSQL-compatible vector backends.
    • MYSQL

      public static final DatabaseType MYSQL
      MySQL and MySQL-compatible vector backends.
    • ORACLE

      public static final DatabaseType ORACLE
      Oracle Database.
    • SQL_SERVER

      public static final DatabaseType SQL_SERVER
      Microsoft SQL Server.
    • H2

      public static final DatabaseType H2
      H2 database engine.
    • MONGODB

      public static final DatabaseType MONGODB
      MongoDB document store.
    • AZURE_COSMOS

      public static final DatabaseType AZURE_COSMOS
      Azure Cosmos DB.
    • OTHER

      public static final DatabaseType OTHER
      Fallback for unknown or unsupported mappings.
  • Method Details

    • values

      public static DatabaseType[] 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

      public static DatabaseType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • from

      public static DatabaseType from(@Nullable Dialect dialect)
      Map a SQL Dialect to a generic DatabaseType. If the dialect is null or unknown, returns OTHER.
      Parameters:
      dialect - SQL dialect (may be null)
      Returns:
      The corresponding database type