Documentation
    Preparing search index...

    Interface ReplicationPoolConfig<Connection, ConnectionOptions>

    interface ReplicationPoolConfig<
        Connection extends object,
        ConnectionOptions extends object,
    > {
        pool: ReplicationPoolOptions;
        readConfig: readonly ConnectionOptions[] | null;
        timeoutErrorClass?: Class<Error>;
        writeConfig: ConnectionOptions;
        afterAcquire?(
            connection: Connection,
            options: AcquireConnectionOptions,
        ): Promise<void>;
        beforeAcquire?(options: AcquireConnectionOptions): Promise<void>;
        connect(
            options: ConnectionOptions,
            register: (connection: Connection) => void,
        ): Promise<Connection>;
        disconnect(connection: Connection): Promise<void>;
        validate(connection: Connection): boolean;
    }

    Type Parameters

    • Connection extends object
    • ConnectionOptions extends object
    Index
    readConfig: readonly ConnectionOptions[] | null
    timeoutErrorClass?: Class<Error>
    writeConfig: ConnectionOptions
    • Parameters

      • options: ConnectionOptions
      • register: (connection: Connection) => void

        Must be called with the connection as soon as it exists, and before any code that could call pool.destroy() on it (e.g. an error handler) runs — this is what lets pool.destroy() find the connection instead of throwing.

      Returns Promise<Connection>

    • Parameters

      Returns boolean