Class PgDriver

    • Field Detail

      • INSTANCE

        public static final PgDriver INSTANCE
    • Constructor Detail

      • PgDriver

        public PgDriver()
    • Method Detail

      • newPool

        public Pool newPool​(Vertx vertx,
                            java.util.function.Supplier<Future<PgConnectOptions>> databases,
                            PoolOptions poolOptions,
                            NetClientOptions transportOptions,
                            Handler<SqlConnection> connectHandler,
                            io.vertx.core.internal.CloseFuture closeFuture)
        Description copied from interface: Driver
        Create a connection pool to the database configured with the given connectOptions and poolOptions.

        This method is not meant to be used directly by users, instead they should use Driver.createPool(Vertx, Supplier, PoolOptions, NetClientOptions, Handler).

        Specified by:
        newPool in interface Driver<PgConnectOptions>
        Parameters:
        vertx - the Vertx instance to be used with the connection pool
        databases - the list of databases
        poolOptions - the options for creating the pool
        transportOptions - the options to configure the TCP client
        connectHandler - the connect handler
        closeFuture - the close future
        Returns:
        the connection pool
      • appendQueryPlaceholder

        public int appendQueryPlaceholder​(StringBuilder queryBuilder,
                                          int index,
                                          int current)
        Description copied from interface: Driver
        Append a parameter placeholder in the query.

        The index starts at 0.

        • When index == current indicates it is a new parameter and therefore the same * value should be returned.
        • When 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 value
        Specified by:
        appendQueryPlaceholder in interface Driver<PgConnectOptions>
        Parameters:
        queryBuilder - the builder to append to
        index - the parameter placeholder index
        Returns:
        the index at which the parameter placeholder could be added