Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vague "Statement too long" error when importing large SQL files into D1 #15053

Closed
t-rupe opened this issue Jun 11, 2024 · 2 comments
Closed

Vague "Statement too long" error when importing large SQL files into D1 #15053

t-rupe opened this issue Jun 11, 2024 · 2 comments
Assignees
Labels
content:new Request for new/missing content documentation Documentation edits product:d1 D1: https://developers.cloudflare.com/d1/

Comments

@t-rupe
Copy link

t-rupe commented Jun 11, 2024

Proposed changes

https://developers.cloudflare.com/d1/build-with-d1/import-data/

I want to suggest adding a less vague error description for the "Statement too long" error message received when you go to import a large sqlite database file to Cloudflare D1 using Wrangler. It'd be helpful to include somewhere the maximum size of a statement, whether it's the data size or lines of SQL. Additionally, it would be good to have documentation explaining why it occurred and adding a simple troubleshooting suggestion to fix the issue, which can easily be fixed by converting a large statement into multiple statements or simply reducing the file size via lines of code or otherwise.

Subject Matter

An explanation of the error, step-by-step instructions to break down large SQL statements, and offering code examples to demonstrate the suggested approaches.

Content Location

https://developers.cloudflare.com/d1/build-with-d1/import-data/#troubleshooting

Additional information

No response

@t-rupe t-rupe added content:new Request for new/missing content documentation Documentation edits labels Jun 11, 2024
@github-actions github-actions bot added the product:d1 D1: https://developers.cloudflare.com/d1/ label Jun 11, 2024
@Oxyjun
Copy link
Contributor

Oxyjun commented Nov 4, 2024

Update: Since this Issue, we have added a new section for troubleshooting this particular error here

Also, our maximum SQL statement length, and our maximum row lengths are both documented in out limits page.

@Oxyjun
Copy link
Contributor

Oxyjun commented Dec 4, 2024

There is another issue/internal effort to consolidate D1 errors in one page.

Related GH issue: #18485

Closing this issue for now.

@Oxyjun Oxyjun closed this as completed Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content:new Request for new/missing content documentation Documentation edits product:d1 D1: https://developers.cloudflare.com/d1/
Projects
None yet
Development

No branches or pull requests

7 participants