Cloudflare · tool · fg-0221
wrangler d1 execute fails with 'SQL code did not contain a statement' when a comment holds a semicolon
SQL code did not contain a statement
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
Older Wrangler split SQL files on every semicolon, including ones inside comments, which produced an empty statement. Wrangler 3.109.3 made the splitter skip comments.
Fix
Upgrade Wrangler to 3.109.3 or later, or remove semicolons from comments in migration files.
Apply
npm i -D wrangler@latest npx wrangler d1 migrations apply DB --remote
Affects: Wrangler before 3.109.3 (fix merged 2025-02-20)
Sources
- https://github.com/cloudflare/workers-sdk/issues/3892
- https://github.com/cloudflare/workers-sdk/pull/8175
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp