Interface IMigrationSource

Adapter for reading data from a migration source backend. Implementations exist for SQLite, Postgres, and Qdrant.

interface IMigrationSource {
    listTables(): Promise<string[]>;
    countRows(table): Promise<number>;
    readBatch(table, offset, limit): Promise<Record<string, unknown>[]>;
    scopeIdForms?(): Promise<Map<string, BrainScopeIdForm>>;
    close(): Promise<void>;
}

Methods

  • Read a batch of rows starting at offset.

    Parameters

    • table: string

      Table name to read from.

    • offset: number

      Number of rows to skip.

    • limit: number

      Maximum rows to return.

    Returns Promise<Record<string, unknown>[]>

    Array of row objects with column values.

  • Every brain the source holds, with its scope-id form (brain_meta.scope_id_form), for the handshake the engine runs before it copies any table. A Qdrant source reads the brains its sidecar names, and counts each as holding traces whose scope ids the two forms read apart, since its traces are in Qdrant. A source that names no brain (a Pinecone index, a Qdrant source with no sidecar) leaves it out.

    Returns Promise<Map<string, BrainScopeIdForm>>