Skip to content

feat(export): stream large database dumps in paginated batches with cooperative yields (#59) - #343

Open
KrazyArcher wants to merge 1 commit into
outerbase:mainfrom
KrazyArcher:fix-issue-59
Open

KrazyArcher wants to merge 1 commit into
outerbase:mainfrom
KrazyArcher:fix-issue-59

Conversation

@KrazyArcher

Copy link
Copy Markdown

Fixes #59

Summary

  • Replaces full-database in-memory string/Blob accumulation in dumpDatabaseRoute (src/export/dump.ts) with a web-standard ReadableStream<Uint8Array> so large databases can be streamed directly to the client with constant memory overhead.
  • Adds paginated batch fetching (batchSize, default 500) and cooperative event-loop breathing yields (maxWorkSliceMs) so Durable Objects do not lock up or hit memory ceilings during multi-GB exports.
  • Properly formats NULL, booleans, single-escaped strings, and Uint8Array blobs while preserving full backward compatibility with the existing Vitest test suite (src/export/dump.test.ts) plus a new multi-batch streaming test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Database dumps do not work on large databases

1 participant