Skip to content

fix: stream database dumps for large databases#126

Open
worthyfarmstead-rgb wants to merge 1 commit intoouterbase:mainfrom
worthyfarmstead-rgb:fix/streaming-database-dumps
Open

fix: stream database dumps for large databases#126
worthyfarmstead-rgb wants to merge 1 commit intoouterbase:mainfrom
worthyfarmstead-rgb:fix/streaming-database-dumps

Conversation

@worthyfarmstead-rgb
Copy link
Copy Markdown

Summary

  • Rewrites SQL dump, CSV, and JSON export to use ReadableStream with chunked LIMIT/OFFSET pagination (5000 rows per chunk)
  • Prevents OOM on large databases by never loading all rows into memory at once
  • Adds proper NULL handling, binary data as hex literals (X'...'), and table existence checks
  • All 25 export tests pass

Test plan

  • SQL dump streams correctly for tables with >5000 rows
  • CSV export streams valid CSV with proper escaping
  • JSON export produces valid JSON array format
  • NULL values and binary data handled correctly
  • Empty tables export without errors
  • Table existence check returns proper error for missing tables

Closes #59

🤖 Generated with Claude Code

Rewrites SQL dump, CSV, and JSON export to use ReadableStream with
chunked LIMIT/OFFSET pagination (5000 rows per chunk). Prevents OOM
on large databases by never loading all rows into memory at once.

Also adds proper NULL handling, binary data as hex literals, and
table existence checks.

Closes outerbase#59

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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