public enum Database extends Enum<Database>
Dialect
resolution. R2DBC ConnectionFactory
provides metadata
that allows resolving an appropriate Dialect
if none was configured explicitly.Enum Constant and Description |
---|
H2 |
MYSQL |
POSTGRES |
SQL_SERVER |
Modifier and Type | Method and Description |
---|---|
abstract Dialect |
defaultDialect()
Returns the latest
Dialect for the underlying database. |
abstract String |
driverName()
Returns the driver name.
|
static Optional<Database> |
findDatabase(io.r2dbc.spi.ConnectionFactory connectionFactory)
Find a
Database type using ConnectionFactory and its metadata. |
static Database |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Database[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Database POSTGRES
public static final Database SQL_SERVER
public static final Database H2
public static final Database MYSQL
public static Database[] values()
for (Database c : Database.values()) System.out.println(c);
public static Database valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Optional<Database> findDatabase(io.r2dbc.spi.ConnectionFactory connectionFactory)
Database
type using ConnectionFactory
and its metadata.connectionFactory
- must not be null.Database
or Optional.empty()
if the database type cannot be determined from
ConnectionFactory
.public abstract String driverName()
ConnectionFactoryMetadata.getName()
Copyright © 2018–2019 Pivotal Software, Inc.. All rights reserved.