kysely
    Preparing search index...

    Interface MysqlDialectConfig

    Config for the MySQL dialect.

    interface MysqlDialectConfig {
        controlConnection?: {
            (connectionUri: string): MysqlConnection;
            (config: object): MysqlConnection;
        };
        onCreateConnection?: (
            connection: DatabaseConnection,
            options?: AbortableOperationOptions,
        ) => Promise<void>;
        onReserveConnection?: (
            connection: DatabaseConnection,
            options?: AbortableOperationOptions,
        ) => Promise<void>;
        pool:
            | MysqlPool
            | ((options?: AbortableOperationOptions) => Promise<MysqlPool>);
    }
    Index

    Properties

    controlConnection?: {
        (connectionUri: string): MysqlConnection;
        (config: object): MysqlConnection;
    }

    A mysql2 Client constructor, to be used for connecting to the database outside of the pool to avoid waiting for an idle connection.

    This is useful for cancelling queries on the database side.

    onCreateConnection?: (
        connection: DatabaseConnection,
        options?: AbortableOperationOptions,
    ) => Promise<void>

    Called once for each created connection.

    onReserveConnection?: (
        connection: DatabaseConnection,
        options?: AbortableOperationOptions,
    ) => Promise<void>

    Called every time a connection is acquired from the pool.

    pool: MysqlPool | ((options?: AbortableOperationOptions) => Promise<MysqlPool>)

    A mysql2 Pool instance or a function that returns one.

    If a function is provided, it's called once when the first query is executed.

    Once the driver has initialized, Kysely.destroy calls pool.end(callback), whether the pool is supplied directly or returned by a function. If initialization hasn't started, db.destroy() does nothing, even if the supplied pool has been used outside Kysely.

    If Kysely is not the sole consumer of the pool, or the pool's lifecycle is managed elsewhere, skip db.destroy(). Let the application call pool.end(callback) once all consumers, including Kysely, have finished. No separate cleanup of the Kysely instance is needed.

    https://github.com/sidorares/node-mysql2#using-connection-pools