Skip to content

fix: Support large database dumps with streaming and pagination#271

Open
codeboost-tr wants to merge 3 commits into
outerbase:mainfrom
codeboost-tr:fix/large-database-dump-streaming
Open

fix: Support large database dumps with streaming and pagination#271
codeboost-tr wants to merge 3 commits into
outerbase:mainfrom
codeboost-tr:fix/large-database-dump-streaming

Conversation

@codeboost-tr

Copy link
Copy Markdown

Fixes #59

Problem

Database dump endpoints load all data into memory. For >1GB databases, this causes memory exhaustion (128MB limit) and 30-second CPU timeout.

Changes

  • Streaming: dump, JSON, CSV exports now use ReadableStream
  • Pagination: SQL queries use LIMIT/OFFSET (500 rows/chunk)
  • Memory safe: constant memory usage regardless of DB size

New endpoints

  • /export/json-stream/:tableName - streaming JSON
  • /export/csv-stream/:tableName - streaming CSV

codeboost-tr and others added 2 commits June 5, 2026 09:58
Fixes outerbase#59

- Streaming ReadableStream for dump, JSON, CSV exports
- Paginated SQL queries with LIMIT/OFFSET (500 rows/chunk)
- Memory-safe: never loads entire dataset into memory
- Backward compatible - existing endpoints still work with limit/offset
@codeboost-tr

Copy link
Copy Markdown
Author

I have updated the PR to resolve several regressions found in the initial streaming implementation. Fixed a crash in the database dump route and updated the unit tests to match the new chunked/streaming behavior. All export-related tests are now passing locally.

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