#6675 D1 export will fail schema contains reserved words
Fixed by PR #9866 (merged 2025-07-18). Properly escapes column/table names in D1 SQL dump to prevent syntax errors with reserved keywords like "index". Released in miniflare 4.20250712.1+, backported to v3 via PR #10035.
Close with comment explaining fix is available in current wrangler versions
Analysis Report
Issue Review: cloudflare/workers-sdk#6675
Summary
D1 export fails when schema contains SQLite reserved words (e.g., column named "index") due to unescaped identifiers in SQL generation.
Findings
- Created: 2024-09-11
- Updated: 2025-10-30
- Version: wrangler 3.76.0 (reported) -> 4.60.0 (current)
- Component: D1 / Miniflare
- Labels: bug, d1
- Comments: 3 (users confirming the issue persists, last comment 2025-08-16)
Key Evidence
Fix was merged: PR #9866 "fix: escape column names and handle mismatched data types in D1 SQL dump" was merged on 2025-07-18
- Explicitly states: "Properly escape column and table names to prevent syntax errors"
- Backported to v3-maintenance branch via PR #10035 (merged 2025-07-22)
Fix is in miniflare 4.20250712.1 (changelog entry confirms):
"Fix D1 SQL dump generation: escape identifiers and handle SQLite's dynamic typing. Escape column and table names to prevent SQL syntax errors."
Current versions include the fix:
- Current miniflare: 4.20260120.0 (fix is in 4.20250712.1+)
- Current wrangler: 4.60.0
User comments after fix was released: The last comment (2025-08-16) is about a month after the fix was merged. Users may not have upgraded to a version containing the fix.
Recommendation
Status: CLOSE
Reasoning: This issue has been fixed in PR #9866, merged on 2025-07-18. The fix properly escapes column and table names in D1 SQL dump generation to prevent syntax errors with reserved keywords like "index". The fix is available in miniflare 4.20250712.1+ and has been backported to wrangler v3 via PR #10035.
Action: Close the issue with a comment explaining the fix and asking users to upgrade.
Suggested Comment
This issue has been fixed in PR #9866 (merged July 2025), which properly escapes column and table names in D1 SQL dump generation.
The fix is available in:
- miniflare 4.20250712.1+ (wrangler v4)
- wrangler v3 via backport PR #10035
Please upgrade to the latest version of wrangler (
npm install wrangler@latest) and try again. If you're still experiencing issues after upgrading, please open a new issue with your updated version information.Closing as fixed.
Notes & Feedback (0)
No notes yet.