Skip to content

fix(wrangler): handle d1 export with multiple tables#12734

Open
flostellbrink wants to merge 4 commits intocloudflare:mainfrom
flostellbrink:feature/d1-export-multiple-tables
Open

fix(wrangler): handle d1 export with multiple tables#12734
flostellbrink wants to merge 4 commits intocloudflare:mainfrom
flostellbrink:feature/d1-export-multiple-tables

Conversation

@flostellbrink
Copy link

@flostellbrink flostellbrink commented Mar 3, 2026

didn't find a corresponding issue. but encountered this:

wrangler d1 export <db-name> --remote --no-schema --table foo --table baz --output export.sql
✘ [ERROR] The argument "--table" expects a single value, but received multiple: ["foo","baz"].

this was clearly intended to work, and did work in earlier version, but has been broken.

added a test and fixed the command args.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: Documentation already refers to this option in plural as: Specify which tables to include in export

Open with Devin

@flostellbrink flostellbrink requested review from a team as code owners March 3, 2026 00:46
@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2026

🦋 Changeset detected

Latest commit: a3c11dc

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod
Copy link
Contributor

Codeowners approval required for this PR:

  • @cloudflare/d1
  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/wrangler/src/tests/d1/export.test.ts: [@cloudflare/d1 @cloudflare/wrangler]
  • packages/wrangler/src/d1/export.ts: [@cloudflare/d1 @cloudflare/wrangler]

@flostellbrink
Copy link
Author

looks like it regressed here: #11393
@penalosa @joshthoward

@flostellbrink flostellbrink force-pushed the feature/d1-export-multiple-tables branch from ed2695e to 468599b Compare March 7, 2026 13:32
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Contributor

@alsuren alsuren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh. Sorry about breaking that. Fix looks good.

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Mar 9, 2026
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 9, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 9, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12734

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12734

miniflare

npm i https://pkg.pr.new/miniflare@12734

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12734

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12734

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12734

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12734

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12734

wrangler

npm i https://pkg.pr.new/wrangler@12734

commit: 529b20a

this was clearly intended to work, and did work in earlier version, but has been broken.
added a test and fixed the command args.
@flostellbrink flostellbrink force-pushed the feature/d1-export-multiple-tables branch from 3b7ef77 to 5b1990f Compare March 10, 2026 10:02
@workers-devprod
Copy link
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
  • ✅ @cloudflare/d1
Show detailed file reviewers
  • packages/wrangler/src/tests/d1/export.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/d1/export.ts: [@cloudflare/wrangler]

@NuroDev NuroDev self-requested a review March 10, 2026 13:09
Copy link
Member

@NuroDev NuroDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one little suggestion, then happy to get this merged and shipped 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a bit more detail to this change log. Maybe some kind of example showing how the previous setup of one --table flag still works like before, but now also supporting adding multiple --table flags to get multiple tables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

4 participants