drupflare/worker - v1.0.0
    Preparing search index...

    Function storeImport

    • Stores a dump as replay chunks and returns what a loader will find.

      ATOMIC, for the same reason the replay is: the parent row and every chunk commit together or not at all. Without that, an invocation killed midway leaves a cfw_import row claiming N chunks with fewer than N stored -- and that row is what latestImport() offers a rollback as a restore point. The replay would start, run until the first missing chunk, and stop with the database half overwritten and the backup only partly applied.

      Parameters

      • sql: SqlLike

        the object's own SQL

      • dump: string

        the SQL text, as dumpDatabase() or /export produces it

      • opts: {
            generation: string;
            nowMs: number;
            perChunk?: number;
            source: string;
            storage: StorageLike;
        }

        storage supplies the transaction; generation labels the import; source records where it came from, for the audit trail a rollback needs

      Returns StoredImport