cloudflare / cloudflare/workers-sdk
🐛 BUG: d1 execute --file does not return results since Wrangler CLI 3.56
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.5k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 187
Description
### Which Cloudflare product(s) does this pertain to?
D1, Wrangler core
### What version(s) of the tool(s) are you using?
3.57+ [Wrangler]
### What version of Node are you using?
20.11.1
### What operating system and version are you using?
Mac Sonoma 14.5
### Describe the Bug
### Observed behavior
Since `3.57` running a `d1 execute` from Wrangler will return metadata of the results, rather than the results as per `3.56` backwards.
e.g. `wrangler d1 execute mydb --file sql/xy.sql --yes --remote --env myenv`
### Expected behavior
I expect to get the results returned, not the metadata. Unless I have missed something in the documentation for the release.
### Steps to reproduce
Minimal repro repo link is included. But, if you've already got a D1 database, you can just use wrangler `3.56` with a SQL file and then wrangler `3.57`+ with a SQL file and see the difference.
### Please provide a link to a minimal reproduction
https://github.com/smcstewart/wrangler-d1-execute-potential-defect
### Please provide any relevant error logs
_No response_
Contributor guide
Research direction
Start by running the minimal reproduction with Wrangler 3.56 and 3.57+ using `wrangler d1 execute ... --file ... --yes --remote --env ...`, then compare the outputs. Trace the Wrangler D1 execute command from its CLI entry point to the result formatting. Done means file-based execution returns the expected results consistently, with coverage for the regression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100