export const POOL_CONFIGURATION_KEY: unique symbol;
export default VelociousDatabasePoolBase;
/**
 * ConnectionCheckoutOptions type.
 */
export type ConnectionCheckoutOptions = {
    /**
     * - Human-readable name for the checked-out connection.
     */
    name?: string | undefined;
};
/**
 * DatabasePoolDebugSnapshot type.
 */
export type DatabasePoolDebugSnapshot = {
    /**
     * - Sanitized resolved database configuration.
     */
    configuration: Record<string, unknown>;
    /**
     * - Live connection snapshots.
     */
    connections: Array<Record<string, unknown>>;
    /**
     * - Number of in-progress connection spawns.
     */
    connectionsBeingSpawned: number;
    /**
     * - Number of idle connections.
     */
    idleCount: number;
    /**
     * - Database identifier.
     */
    identifier: string;
    /**
     * - Number of checked-out connections.
     */
    inUseCount: number;
    /**
     * - Waiting checkout snapshots.
     */
    pendingCheckouts?: Record<string, any>[] | undefined;
    /**
     * - Number of queued checkout requests.
     */
    pendingCheckoutCount: number;
    /**
     * - Pool class name.
     */
    poolClass: string;
};
declare class VelociousDatabasePoolBase {
    /**
     * Runs current.
     * @returns {VelociousDatabasePoolBase} - The current.
     */
    static current(): VelociousDatabasePoolBase;
    /**
     * Clears any global connections for the given configuration.
     * @returns {void} - No return value.
     */
    static clearGlobalConnections(): void;
    /**
     * Runs constructor.
     * @param {object} args - Options object.
     * @param {Configuration} args.configuration - Configuration instance.
     * @param {string} args.identifier - Identifier.
     */
    constructor({ configuration, identifier }: {
        configuration: Configuration;
        identifier: string;
    });
    /**
     * Without current connection context.
      @type {undefined | ((callback: () => ?) => ?)} */
    _withoutCurrentConnectionContext: undefined | ((callback: () => unknown) => unknown);
    configuration: Configuration;
    identifier: string;
    logger: Logger;
    /**
     * Runs checkin.
     * @abstract
     * @param {import("../drivers/base.js").default} _connection - Connection.
     */
    checkin(_connection: import("../drivers/base.js").default): void;
    /**
     * Runs checkout.
     * @abstract
     * @param {ConnectionCheckoutOptions} [_options] - Checkout options.
     * @returns {Promise<import("../drivers/base.js").default>} - Resolves with the checkout.
     */
    checkout(_options?: ConnectionCheckoutOptions): Promise<import("../drivers/base.js").default>;
    /**
     * Runs get current connection.
     * @abstract
     * @returns {import("../drivers/base.js").default} - The current connection.
     */
    getCurrentConnection(): import("../drivers/base.js").default;
    /**
     * Returns the connection pinned to the current context, if any.
     * Default implementation defers to `getCurrentConnection`.
     * @returns {import("../drivers/base.js").default | undefined} - The current context connection.
     */
    getCurrentContextConnection(): import("../drivers/base.js").default | undefined;
    /**
     * Runs without current connection context.
     * @template T
     * @param {() => T} callback - Callback to run without ? current connection context.
     * @returns {T} - Callback result.
     */
    withoutCurrentConnectionContext<T>(callback: () => T): T;
    /**
     * Runs get configuration.
     * @returns {import("../../configuration-types.js").DatabaseConfigurationType} - Resolved database configuration for the pool identifier.
     */
    getConfiguration(): import("../../configuration-types.js").DatabaseConfigurationType;
    /**
     * Runs get configuration reuse key.
     * @returns {string} - Reuse key for the currently resolved database configuration.
     */
    getConfigurationReuseKey(): string;
    /**
     * Runs connection matches current configuration.
     * @param {import("../drivers/base.js").default} connection - Connection.
     * @returns {boolean} - Whether connection matches current resolved configuration.
     */
    connectionMatchesCurrentConfiguration(connection: import("../drivers/base.js").default): boolean;
    /**
     * Clears schema metadata cached by this pool's current connection.
     * Pools that keep multiple connections alive should override this to clear every live connection.
     * @returns {void} - No return value.
     */
    clearSchemaCache(): void;
    /**
     * Runs clear connection schema cache.
     * @param {import("../drivers/base.js").default} connection - Connection whose local schema cache should be cleared.
     * @returns {void} - No return value.
     */
    _clearConnectionSchemaCache(connection: import("../drivers/base.js").default): void;
    /**
     * Runs primary key type.
     * @abstract
     * @returns {string} - The primary key type.
     */
    primaryKeyType(): string;
    /**
     * Runs set current.
     * @returns {void} - No return value.
     */
    setCurrent(): void;
    /**
     * Runs set driver class.
     * @param {typeof import("../drivers/base.js").default} driverClass - Driver class.
     */
    setDriverClass(driverClass: typeof import("../drivers/base.js").default): void;
    driverClass: typeof import("../drivers/base.js").default | undefined;
    /**
     * Runs spawn connection.
     * @returns {Promise<import("../drivers/base.js").default>} - Resolves with the spawn connection.
     */
    spawnConnection(): Promise<import("../drivers/base.js").default>;
    /**
     * Runs spawn connection with configuration.
     * @param {import("../../configuration-types.js").DatabaseConfigurationType} config - Configuration object.
     * @returns {Promise<import("../drivers/base.js").default>} - Resolves with the spawn connection with configuration.
     */
    spawnConnectionWithConfiguration(config: import("../../configuration-types.js").DatabaseConfigurationType): Promise<import("../drivers/base.js").default>;
    /**
     * Runs close connection after failed connect.
     * @param {import("../drivers/base.js").default} connection - Connection to close.
     * @returns {Promise<void>} - Resolves when cleanup has been attempted.
     */
    closeConnectionAfterFailedConnect(connection: import("../drivers/base.js").default): Promise<void>;
    /**
     * Runs with connection.
     * @template T
     * @abstract
     * @param {ConnectionCheckoutOptions | function(import("../drivers/base.js").default) : Promise<T>} _optionsOrCallback - Checkout options or callback function.
     * @param {function(import("../drivers/base.js").default) : Promise<T>} [_callback] - Callback function.
     * @returns {Promise<T>} - Resolves with the callback result.
     */
    withConnection<T>(_optionsOrCallback: ConnectionCheckoutOptions | ((arg0: import("../drivers/base.js").default) => Promise<T>), _callback?: (arg0: import("../drivers/base.js").default) => Promise<T>): Promise<T>;
    /**
     * Ensures a reusable connection exists for contexts where AsyncLocalStorage isn't set.
     * Default implementation just checks out a connection.
     * @returns {Promise<import("../drivers/base.js").default>} - Resolves with the global connection.
     */
    ensureGlobalConnection(): Promise<import("../drivers/base.js").default>;
    /**
     * Runs get debug snapshot.
     * @returns {DatabasePoolDebugSnapshot} - Diagnostic snapshot for this pool.
     */
    getDebugSnapshot(): DatabasePoolDebugSnapshot;
    /**
     * Runs debug configuration snapshot.
     * @returns {Record<string, ?>} - Sanitized resolved database configuration.
     */
    debugConfigurationSnapshot(): Record<string, unknown>;
    /**
     * Runs debug connection snapshot.
     * @param {import("../drivers/base.js").default} connection - Database connection.
     * @param {Record<string, ?>} details - Extra diagnostic fields.
     * @returns {Record<string, ?>} - Connection diagnostic snapshot.
     */
    debugConnectionSnapshot(connection: import("../drivers/base.js").default, details?: Record<string, unknown>): Record<string, unknown>;
    /**
     * Closes all connections for this pool.
     * @returns {Promise<void>} - Resolves when complete.
     */
    closeAll(): Promise<void>;
}
import Configuration from "../../configuration.js";
import Logger from "../../logger.js";
//# sourceMappingURL=base.d.ts.map