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

    Function writeHeapSnapshot

    • Writes a heap into the object's own SQLite.

      Elide, chunk, then insert each chunk as a BOUND BLOB PARAMETER. The binding is not a style choice: a base64 payload would become statement TEXT and blow the 100,000-character statement ceiling long before the record cap, which is why the codec is bypassed entirely here.

      The fd table goes in the metadata row rather than being derived on restore. It is the load-bearing part of a restore, so it is stored WITH the bytes it belongs to -- a snapshot whose descriptor table is reconstructed from a different instance's state is not a snapshot.

      Parameters

      • sql: HeapSql
      • opts: {
            chunkBytes?: number;
            generation: string;
            handles?: HandleRecord[];
            heap: Uint8Array;
            nowMs: number;
            pageBytes?: number;
            streams: StreamRecord[];
        }

      Returns {
          digest: string;
          id: number;
          keptPages: number;
          rows: number;
          storedBytes: number;
      }