Fixes #59 by replacing memory-heavy export behavior with streaming + async job-based dump processing that can continue beyond request limits, with optional R2 artifact storage, callback notification, and alarm-driven continuation.
Closes #59 /claim #59
POST /export/dump, GET /export/dump/:jobId, GET /export/dump/:jobId/downloadtmp_export_jobs, tmp_export_job_tables, tmp_export_job_chunks)EXPORT_R2_BUCKET) and stream downloads from R2 when availablepnpm vitest run \
src/handler.test.ts \
src/do.test.ts \
src/export/async-dump.test.ts \
src/export/dump.test.ts \
src/export/csv.test.ts \
src/export/json.test.ts \
src/export/index.test.ts
# Start async export
curl --location --request POST 'https://starbasedb.YOUR-ID-HERE.workers.dev/export/dump' \
--header 'Authorization: Bearer ABC123' \
--header 'Content-Type: application/json' \
--data '{"callbackUrl":"https://example.com/webhooks/export-complete"}'
# Poll status
curl --location 'https://starbasedb.YOUR-ID-HERE.workers.dev/export/dump/JOB_ID_HERE' \
--header 'Authorization: Bearer ABC123'
# Download result
curl --location 'https://starbasedb.YOUR-ID-HERE.workers.dev/export/dump/JOB_ID_HERE/download' \
--header 'Authorization: Bearer ABC123' \
--output database_dump.sql
Large DB dump requests could fail due to request timeout / memory-heavy accumulation.
NIYOKWIZERA JEAND'AMOUR
@jeid12
Outerbase (YC W23)
@outerbase