import type { IContainer } from 'node-cqrs'; import type { Database } from 'better-sqlite3'; /** * Abstract base class for accessing a SQLite database. * * Manages the database connection lifecycle, ensuring initialization via `assertDb`. * Supports providing a database instance directly or a factory function for lazy initialization. * * Subclasses must implement the `initialize` method for specific setup tasks. */ export declare abstract class AbstractSqliteAccessor { #private; protected db: Database | undefined; constructor(c: Partial>); protected abstract initialize(db: Database): Promise | void; /** * Ensures that the database connection is initialized. * Uses a lock to prevent race conditions during concurrent initialization attempts. * If the database is not already initialized, it creates the database connection * using the provided factory and calls the `initialize` method. * * This method is idempotent and safe to call multiple times. */ assertConnection(): Promise; }