public final class MySqlConnectionFactoryProvider extends Object implements io.r2dbc.spi.ConnectionFactoryProvider
ConnectionFactoryProvider for creating MySqlConnectionFactorys.| Modifier and Type | Field and Description |
|---|---|
static io.r2dbc.spi.Option<String> |
ALLOW_LOAD_LOCAL_INFILE_IN_PATH
Option to set the allowed local infile path.
|
static io.r2dbc.spi.Option<Boolean> |
AUTODETECT_EXTENSIONS
Enable/Disable auto-detect driver extensions.
|
static io.r2dbc.spi.Option<CompressionAlgorithm[]> |
COMPRESSION_ALGORITHMS
Option to set compression algorithms.
|
static io.r2dbc.spi.Option<String> |
CONNECTION_TIME_ZONE
Option to set the time zone of connection.
|
static io.r2dbc.spi.Option<Boolean> |
CREATE_DATABASE_IF_NOT_EXIST
Enable/Disable database creation if not exist.
|
static io.r2dbc.spi.Option<Boolean> |
FORCE_CONNECTION_TIME_ZONE_TO_SESSION
Option to force the time zone of connection to session time zone.
|
static io.r2dbc.spi.Option<Integer> |
LOCAL_INFILE_BUFFER_SIZE
Option to set the buffer size for local infile.
|
static io.r2dbc.spi.Option<reactor.netty.resources.LoopResources> |
LOOP_RESOURCES
Option to set the
LoopResources for the connection. |
static String |
MYSQL_DRIVER
The name of the driver used for discovery, should not be changed.
|
static io.r2dbc.spi.Option<Publisher<String>> |
PASSWORD_PUBLISHER
Password Publisher function can be used to retrieve password before creating a connection.
|
static io.r2dbc.spi.Option<Integer> |
PREPARE_CACHE_SIZE
Option to set the maximum size of the
Query parsing cache. |
static io.r2dbc.spi.Option<Boolean> |
PRESERVE_INSTANTS
Option to set the time zone conversion.
|
static io.r2dbc.spi.Option<Integer> |
QUERY_CACHE_SIZE
Option to set the maximum size of the server-preparing cache.
|
static io.r2dbc.spi.Option<ZoneId> |
SERVER_ZONE_ID
Deprecated.
since 1.1.2, use
CONNECTION_TIME_ZONE instead. |
static io.r2dbc.spi.Option<String[]> |
SESSION_VARIABLES
Option to set session variables.
|
static io.r2dbc.spi.Option<String> |
SSL_CA
Option to set a PEM file of server SSL CA.
|
static io.r2dbc.spi.Option<String> |
SSL_CERT
Option to set a PEM file of client SSL cert.
|
static io.r2dbc.spi.Option<Function<io.netty.handler.ssl.SslContextBuilder,io.netty.handler.ssl.SslContextBuilder>> |
SSL_CONTEXT_BUILDER_CUSTOMIZER
Option to custom
SslContextBuilder. |
static io.r2dbc.spi.Option<HostnameVerifier> |
SSL_HOSTNAME_VERIFIER
Option to configure
HostnameVerifier. |
static io.r2dbc.spi.Option<String> |
SSL_KEY
Option to set a PEM file of client SSL key.
|
static io.r2dbc.spi.Option<CharSequence> |
SSL_KEY_PASSWORD
Option to set a PEM file password of client SSL key.
|
static io.r2dbc.spi.Option<SslMode> |
SSL_MODE
Option to
SslMode. |
static io.r2dbc.spi.Option<Boolean> |
TCP_KEEP_ALIVE
Enable/Disable TCP KeepAlive.
|
static io.r2dbc.spi.Option<Boolean> |
TCP_NO_DELAY
Enable/Disable TCP NoDelay.
|
static io.r2dbc.spi.Option<String[]> |
TLS_VERSION
Option to TLS versions for SslContext protocols, see also
TlsVersions. |
static io.r2dbc.spi.Option<String> |
UNIX_SOCKET
Option to set the Unix Domain Socket.
|
static io.r2dbc.spi.Option<Object> |
USE_SERVER_PREPARE_STATEMENT
Enable server preparing for parameterized statements and prefer server preparing simple statements.
|
static io.r2dbc.spi.Option<ZeroDateOption> |
ZERO_DATE
Option to configure handling when MySQL server returning "zero date" (aka.
|
static io.r2dbc.spi.Option<Integer> |
ZSTD_COMPRESSION_LEVEL
Option to set the zstd compression level.
|
| Constructor and Description |
|---|
MySqlConnectionFactoryProvider() |
| Modifier and Type | Method and Description |
|---|---|
io.r2dbc.spi.ConnectionFactory |
create(io.r2dbc.spi.ConnectionFactoryOptions options) |
String |
getDriver() |
boolean |
supports(io.r2dbc.spi.ConnectionFactoryOptions options) |
public static final String MYSQL_DRIVER
public static final io.r2dbc.spi.Option<String> UNIX_SOCKET
public static final io.r2dbc.spi.Option<Boolean> PRESERVE_INSTANTS
true means enable conversion between JVM
and CONNECTION_TIME_ZONE.
Note: disable it will ignore the time zone of connection, and use the JVM local time zone.
public static final io.r2dbc.spi.Option<String> CONNECTION_TIME_ZONE
LOCAL means use JVM local time zone.
It should be "LOCAL", "SERVER", or a valid ID of ZoneId. "SERVER" means
querying the server-side timezone during initialization.public static final io.r2dbc.spi.Option<Boolean> FORCE_CONNECTION_TIME_ZONE_TO_SESSION
false.
Note: alter the time zone of session will affect the results of MySQL date/time functions, e.g.
NOW([n]), CURRENT_TIME([n]), CURRENT_DATE(), etc. Please use with caution.
@Deprecated public static final io.r2dbc.spi.Option<ZoneId> SERVER_ZONE_ID
CONNECTION_TIME_ZONE instead.ZoneId of server. If it is set, driver will ignore the real time zone of
server-side.public static final io.r2dbc.spi.Option<ZeroDateOption> ZERO_DATE
public static final io.r2dbc.spi.Option<HostnameVerifier> SSL_HOSTNAME_VERIFIER
HostnameVerifier. It is available only if the SSL_MODE set to
SslMode.VERIFY_IDENTITY. It can be an implementation class name of HostnameVerifier
with a public no-args constructor.public static final io.r2dbc.spi.Option<String[]> TLS_VERSION
TlsVersions. Usually sorted from
higher to lower. It can be a Collection<String>. It can be a String, protocols will be
split by ,. e.g. "TLSv1.2,TLSv1.1,TLSv1".public static final io.r2dbc.spi.Option<String> SSL_CA
SSL_MODE set to SslMode.VERIFY_CA or higher level.public static final io.r2dbc.spi.Option<String> SSL_KEY
public static final io.r2dbc.spi.Option<CharSequence> SSL_KEY_PASSWORD
SSL_KEY and
SSL_CERT set.public static final io.r2dbc.spi.Option<String> SSL_CERT
public static final io.r2dbc.spi.Option<Function<io.netty.handler.ssl.SslContextBuilder,io.netty.handler.ssl.SslContextBuilder>> SSL_CONTEXT_BUILDER_CUSTOMIZER
SslContextBuilder. It can be an implementation class name of Function
with a public no-args constructor.public static final io.r2dbc.spi.Option<Boolean> TCP_KEEP_ALIVE
public static final io.r2dbc.spi.Option<Boolean> TCP_NO_DELAY
public static final io.r2dbc.spi.Option<Boolean> CREATE_DATABASE_IF_NOT_EXIST
public static final io.r2dbc.spi.Option<Object> USE_SERVER_PREPARE_STATEMENT
The value can be a Boolean. If it is true, driver will use server preparing for
parameterized statements and text query for simple statements. If it is false, driver will use
client preparing for parameterized statements and text query for simple statements.
The value can be a Predicate<String>. If it is set, driver will server
preparing for parameterized statements, it configures whether to prefer prepare execution on a
statement-by-statement basis (simple statements). The Predicate<String>
accepts the simple SQL query string and returns a boolean flag indicating preference.
The value can be a String. If it is set, driver will try to convert it to Boolean or an
instance of Predicate<String> which use reflection with a public
no-args constructor.
public static final io.r2dbc.spi.Option<String[]> SESSION_VARIABLES
["sql_mode='ANSI_QUOTES,STRICT_TRANS_TABLES'", "time_zone=00:00"].public static final io.r2dbc.spi.Option<String> ALLOW_LOAD_LOCAL_INFILE_IN_PATH
public static final io.r2dbc.spi.Option<Integer> LOCAL_INFILE_BUFFER_SIZE
8192.public static final io.r2dbc.spi.Option<CompressionAlgorithm[]> COMPRESSION_ALGORITHMS
CompressionAlgorithm.UNCOMPRESSED].
It will auto choose an algorithm that's contained in the list and supported by the server, preferring
zstd, then zlib. If the list does not contain CompressionAlgorithm.UNCOMPRESSED and the server
does not support any algorithm in the list, an exception will be thrown when connecting.
Note: zstd requires a dependency com.github.luben:zstd-jni.
public static final io.r2dbc.spi.Option<Integer> ZSTD_COMPRESSION_LEVEL
3.
It is only used if zstd is chosen for the connection.
Note: MySQL protocol does not allow to set the zlib compression level of the server, only zstd is configurable.
public static final io.r2dbc.spi.Option<reactor.netty.resources.LoopResources> LOOP_RESOURCES
LoopResources for the connection. Default to
global tcp Resourcespublic static final io.r2dbc.spi.Option<Integer> PREPARE_CACHE_SIZE
Query parsing cache. Default to 256.public static final io.r2dbc.spi.Option<Integer> QUERY_CACHE_SIZE
0.public static final io.r2dbc.spi.Option<Boolean> AUTODETECT_EXTENSIONS
public static final io.r2dbc.spi.Option<Publisher<String>> PASSWORD_PUBLISHER
public io.r2dbc.spi.ConnectionFactory create(io.r2dbc.spi.ConnectionFactoryOptions options)
create in interface io.r2dbc.spi.ConnectionFactoryProviderpublic boolean supports(io.r2dbc.spi.ConnectionFactoryOptions options)
supports in interface io.r2dbc.spi.ConnectionFactoryProviderpublic String getDriver()
getDriver in interface io.r2dbc.spi.ConnectionFactoryProviderCopyright © 2018–2024 asyncer.io. All rights reserved.