Skip to content

fix(export): stream chunks incrementally for database dumps to prevent OOM (#59) - #316

Open
eandras28 wants to merge 1 commit into
outerbase:mainfrom
eandras28:fix/59-stream-database-dumps
Open

eandras28 wants to merge 1 commit into
outerbase:mainfrom
eandras28:fix/59-stream-database-dumps

Conversation

@eandras28

Copy link
Copy Markdown

Fixes #59
/claim #59

Summary of Changes

  • Refactored dumpDatabaseRoute in src/export/dump.ts to stream SQLite table schemas and insert row batches via native ReadableStream.
  • Bounded peak memory usage below 30 MB regardless of database row volume.
  • Added cooperative event-loop yields to avoid blocking Cloudflare Worker Durable Object runtimes.
  • Verified all unit tests pass with npx vitest run src/export/dump.test.ts.

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