Implement chunked R2-based database export to support any database size (up to 10GB). Uses DO alarms for exports exceeding the 30-second Worker timeout, with breathing intervals to prevent database lock contention. Includes callback URL notifications and new status/download endpoints.
/claim #59
POST /export/dump with optional callbackUrl paramGET /export/status/:exportId endpointGET /export/download/:exportId endpointpnpm vitest run src/export/chunked-dump.test.ts — 15 tests should passpnpm vitest run — all 166 existing tests still passGET /export/dump on a small DB — should return .sql file directlyPOST /export/dump?callbackUrl=https://example.com on a large DB — should return 202 with exportIdGET /export/status/:exportId — should show progressGET /export/download/:exportId — should return the .sql file#Short Demo video of changes
https://github.com/user-attachments/assets/7f237412-cba7-4fd5-8832-e29216dd266e
Utkarsh Gupta
@scrollingreel
Outerbase (YC W23)
@outerbase