@storehouse/core - v2.1.0
    Preparing search index...

    Interface IManager

    Interface that all managers must implement to work with Storehouse

    class MyManager implements IManager {
    getConnection() { return this.client; }
    async closeConnection() { await this.client.close(); }
    getModel(name: string) { return this.models.get(name); }
    }
    interface IManager {
        closeConnection(): void | Promise<unknown>;
        getConnection(): unknown;
        getModel?(name: string): unknown;
        healthCheck?(): HealthCheckResult | Promise<HealthCheckResult>;
        isConnected?(): Promise<boolean>;
    }
    Index

    Methods

    • Close the connection gracefully

      Returns void | Promise<unknown>

      Promise that resolves when connection is closed, or void for synchronous close

    • Get the underlying connection/client instance

      Returns unknown

      The connection object (database client, pool, etc.)

    • Get a model by name (optional)

      Parameters

      • name: string

        The name of the model to retrieve

      Returns unknown

      The model instance or undefined if not found

    • Check if the connection is currently connected/active (optional)

      Returns Promise<boolean>

      true if connected, false otherwise