public interface Driver
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsOptions(SqlConnectOptions connectOptions) |
default int |
appendQueryPlaceholder(StringBuilder queryBuilder,
int index,
int current)
Append a parameter placeholder in the
query . |
ConnectionFactory |
createConnectionFactory(Vertx vertx,
SqlConnectOptions database)
Create a connection factory to the given
database . |
default Pool |
createPool(Vertx vertx,
List<? extends SqlConnectOptions> databases,
PoolOptions options)
Create a connection pool to the database configured with the given
connectOptions and poolOptions . |
Pool |
newPool(Vertx vertx,
List<? extends SqlConnectOptions> databases,
PoolOptions options,
io.vertx.core.impl.CloseFuture closeFuture)
Create a connection pool to the database configured with the given
connectOptions and poolOptions . |
SqlConnectOptions |
parseConnectionUri(String uri) |
default io.vertx.sqlclient.impl.SqlConnectionInternal |
wrapConnection(io.vertx.core.impl.ContextInternal context,
ConnectionFactory factory,
io.vertx.sqlclient.impl.Connection conn,
io.vertx.sqlclient.impl.tracing.QueryTracer tracer,
ClientMetrics metrics) |
default Pool createPool(Vertx vertx, List<? extends SqlConnectOptions> databases, PoolOptions options)
connectOptions
and poolOptions
.
The returned pool will automatically closed when vertx
is not null
and is closed or when the creating
context is closed (e.g verticle undeployment).
vertx
- the Vertx instance to be used with the connection pool or null
to create an auto closed Vertx instancedatabases
- the list of databasesoptions
- the options for creating the poolPool newPool(Vertx vertx, List<? extends SqlConnectOptions> databases, PoolOptions options, io.vertx.core.impl.CloseFuture closeFuture)
connectOptions
and poolOptions
.
This method is not meant to be used directly by users, instead they should use createPool(Vertx, List, PoolOptions)
.vertx
- the Vertx instance to be used with the connection pooldatabases
- the list of databasesoptions
- the options for creating the poolcloseFuture
- the close futureConnectionFactory createConnectionFactory(Vertx vertx, SqlConnectOptions database)
database
.vertx
- the Vertx instance tdatabase
- the database to connect toSqlConnectOptions parseConnectionUri(String uri)
true
if the driver accepts the connectOptions
, false
otherwiseboolean acceptsOptions(SqlConnectOptions connectOptions)
connectOptions
, false otherwisedefault int appendQueryPlaceholder(StringBuilder queryBuilder, int index, int current)
query
.
The index starts at 0
.
index == current
indicates it is a new parameter and therefore the same
* value should be returned.index < current
indicates the builder wants to reuse a parameter.
The implementation can either return the same value to indicate the parameter can be reused or
return the next index to use (which is shall be the current
valuequeryBuilder
- the builder to append toindex
- the parameter placeholder indexdefault io.vertx.sqlclient.impl.SqlConnectionInternal wrapConnection(io.vertx.core.impl.ContextInternal context, ConnectionFactory factory, io.vertx.sqlclient.impl.Connection conn, io.vertx.sqlclient.impl.tracing.QueryTracer tracer, ClientMetrics metrics)
Copyright © 2023 Eclipse. All rights reserved.