Interface EmergentRegistryStorageAdapter

Minimal storage adapter interface for SQLite persistence.

The registry uses this abstraction so it can work with any SQLite driver (better-sqlite3, sql.js, Drizzle raw, etc.) without taking a hard dependency. All methods are async to support both sync and async driver wrappers.

interface EmergentRegistryStorageAdapter {
    run(sql, params?): Promise<unknown>;
    get(sql, params?): Promise<unknown>;
    all(sql, params?): Promise<unknown[]>;
    exec?(sql): Promise<void>;
}

Methods

Methods

  • Execute a single SQL statement that does not return rows. Used for INSERT, UPDATE, DELETE, and DDL statements.

    Parameters

    • sql: string

      The SQL statement to execute.

    • Optional params: unknown[]

      Optional positional parameters bound to ? placeholders.

    Returns Promise<unknown>

  • Execute a single SQL query and return the first matching row.

    Parameters

    • sql: string

      The SQL SELECT statement.

    • Optional params: unknown[]

      Optional positional parameters bound to ? placeholders.

    Returns Promise<unknown>

    The first row as a plain object, or undefined if no rows match.

  • Execute a single SQL query and return all matching rows.

    Parameters

    • sql: string

      The SQL SELECT statement.

    • Optional params: unknown[]

      Optional positional parameters bound to ? placeholders.

    Returns Promise<unknown[]>

    An array of plain objects, one per matching row.

  • Execute a raw SQL string containing one or more statements. Used for schema DDL (CREATE TABLE, CREATE INDEX). Not all adapters support this — the registry falls back to run() if absent.

    Parameters

    • sql: string

      The raw SQL string to execute.

    Returns Promise<void>