Class PgDriver
- All Implemented Interfaces:
Driver<PgConnectOptions>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsOptions(SqlConnectOptions options) intappendQueryPlaceholder(StringBuilder queryBuilder, int index, int current) Append a parameter placeholder in thequery.createConnectionFactory(Vertx vertx, NetClientOptions transportOptions) Create a connection factory to the givendatabase.downcast(SqlConnectOptions connectOptions) Downcast the connect options to the specific driver options.protected PoolnewPool(io.vertx.core.internal.VertxInternal vertx, Handler<SqlConnection> connectHandler, Supplier<Future<PgConnectOptions>> databases, PoolOptions poolOptions, NetClientOptions transportOptions, io.vertx.core.internal.CloseFuture closeFuture) parseConnectionUri(String uri) io.vertx.sqlclient.internal.SqlConnectionInternalwrapConnection(io.vertx.core.internal.ContextInternal context, ConnectionFactory<PgConnectOptions> factory, Connection connection) Wrap a givenconnectioninto aSqlConnectionInternal.Methods inherited from class DriverBase
newPoolMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Driver
createPool
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
PgDriver
public PgDriver()
-
-
Method Details
-
newPool
protected Pool newPool(io.vertx.core.internal.VertxInternal vertx, Handler<SqlConnection> connectHandler, Supplier<Future<PgConnectOptions>> databases, PoolOptions poolOptions, NetClientOptions transportOptions, io.vertx.core.internal.CloseFuture closeFuture) - Overrides:
newPoolin classDriverBase<PgConnectOptions>
-
parseConnectionUri
- Returns:
trueif the driver accepts theconnectOptions,falseotherwise
-
acceptsOptions
- Returns:
- true if the driver accepts the
connectOptions, false otherwise
-
downcast
Description copied from interface:DriverDowncast the connect options to the specific driver options.- Parameters:
connectOptions- the options to downcast- Returns:
- the downcasted options
-
createConnectionFactory
public ConnectionFactory<PgConnectOptions> createConnectionFactory(Vertx vertx, NetClientOptions transportOptions) Description copied from class:DriverBaseCreate a connection factory to the givendatabase.- Specified by:
createConnectionFactoryin classDriverBase<PgConnectOptions>- Parameters:
vertx- the Vertx instancetransportOptions- the options to configure the TCP client- Returns:
- the connection factory
-
appendQueryPlaceholder
Description copied from interface:DriverAppend a parameter placeholder in thequery.The index starts at
0.- When
index == currentindicates it is a new parameter and therefore the same * value should be returned. - When
index < currentindicates 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 thecurrentvalue
- Parameters:
queryBuilder- the builder to append toindex- the parameter placeholder index- Returns:
- the index at which the parameter placeholder could be added
- When
-
wrapConnection
public io.vertx.sqlclient.internal.SqlConnectionInternal wrapConnection(io.vertx.core.internal.ContextInternal context, ConnectionFactory<PgConnectOptions> factory, Connection connection) Description copied from class:DriverBaseWrap a givenconnectioninto aSqlConnectionInternal. The default implementation wraps with a genericSqlConnectionBase.- Overrides:
wrapConnectionin classDriverBase<PgConnectOptions>- Parameters:
context- the connection contextfactory- the connection factoryconnection- the connection to wrap- Returns:
- the wrapped connection
-