sql-switch - v1.0.1
    Preparing search index...

    Interface DalSwapOptions

    Options for DAL.swapEngine => same as EngineSwapOptions, except the paths & connection string default to whatever this DAL was connected with.

    interface DalSwapOptions {
        direction: SwapDirection;
        connectionString?: string;
        dataDir?: string;
        keepLocalFiles?: boolean;
        onConflict?: ConflictHandler;
        onProgress?: (message: string) => void;
        reconnect?: boolean;
    }

    Hierarchy (View Summary)

    Index
    direction: SwapDirection

    'up' = SQLite to Postgres, 'down' = Postgres to SQLite.

    connectionString?: string

    Postgres connection string.

    process.env.DATABASE_URL

    dataDir?: string

    Directory holding the SQLite .db files. Created if missing.

    './data/databases'

    keepLocalFiles?: boolean

    Upward only: keep the local .db files after a successful migration.

    false (files are deleted, same as the CLI without --keep)

    onConflict?: ConflictHandler

    How to handle a target that already has data in it.

    'skip' => nothing gets clobbered unless you say so

    onProgress?: (message: string) => void

    Called with human readable progress lines. Handy for piping into your own logger.

    reconnect?: boolean

    Reconnect on the target engine once the data has moved (up => cloud, down => local), reusing the current collector settings. Set false to leave the DAL closed.

    true