prorm API Reference
    Preparing search index...

    Interface PoolConfig

    Connection-pool sizing and lifecycle. A pooled connection is shared, so session state set on one query is not guaranteed to be visible to the next — use onConnect for settings that must apply to every connection.

    interface PoolConfig {
        evict?: number;
        onAcquire?: (connection: any) => void;
        onRelease?: (connection: any) => void;
        onDestroy?: (connection: any) => void;
        onError?: (error: Error) => void;
        healthCheck?: Partial<HealthCheckConfig>;
        validateOnBorrow?: boolean;
        validationTimeout?: number;
        validationQuery?: string;
        enableReconnection?: boolean;
        maxReconnectAttempts?: number;
        reconnectInterval?: number;
        max?: number;
        min?: number;
        acquire?: number;
        idle?: number;
        handleDisconnects?: boolean;
        onConnect?: (connection: any) => void;
        onDisconnect?: (connection: any) => void;
        enableEvents?: boolean;
        logPoolOperations?: boolean;
    }

    Hierarchy (View Summary)

    Index
    evict?: number

    Time in milliseconds to evict idle connections

    onAcquire?: (connection: any) => void

    Callback when a connection is acquired

    onRelease?: (connection: any) => void

    Callback when a connection is released

    onDestroy?: (connection: any) => void

    Callback when a connection is destroyed

    onError?: (error: Error) => void

    Callback on pool error

    healthCheck?: Partial<HealthCheckConfig>

    Health check configuration

    validateOnBorrow?: boolean

    Enable connection validation on borrow

    validationTimeout?: number

    Timeout for connection validation in milliseconds

    validationQuery?: string

    Custom validation query (overrides healthCheck.query)

    enableReconnection?: boolean

    Enable reconnection for failed connections

    maxReconnectAttempts?: number

    Maximum number of reconnection attempts

    reconnectInterval?: number

    Interval between reconnection attempts in milliseconds

    max?: number

    Maximum number of connections in the pool

    min?: number

    Minimum number of idle connections to maintain

    acquire?: number

    Maximum time in milliseconds to wait for a connection to become available

    idle?: number

    Maximum time in milliseconds that a connection can be idle before being evicted

    handleDisconnects?: boolean

    Whether to automatically handle disconnects

    onConnect?: (connection: any) => void

    Callback when a connection is acquired from the pool

    onDisconnect?: (connection: any) => void

    Callback when a connection is released back to the pool

    enableEvents?: boolean

    Enable pool event emission (for monitoring/debugging)

    logPoolOperations?: boolean

    Log pool operations (acquire, release, etc.)