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

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp