Open nferch opened 2 weeks ago
I encountered the same error when trying to export a database using wrangler d1 export
. In my case, I was able to resolve the issue by renaming the "from"
column to something else, as it seems that "from"
might be causing the problem due to being a reserved word in SQL. After renaming the column, the export completed successfully.
You might want to try renaming "from"
to something like "sender"
or "from_address"
and see if that fixes the issue.
Hope this helps!
Great shout @SirRodney . Turns out both from
and to
were problematic
oh my god, thanks guys, I'm having limit as a column name
near "limit": syntax error at offset 40: SQLITE_ERROR
@rozenmd can we use quoted-strings to workaround this issue or add a note about this limitation in the docs (eg. "cannot use reserved SQL keywords as column names")
Which Cloudflare product(s) does this pertain to?
D1
What version(s) of the tool(s) are you using?
3.72.3 [Wrangler]
What version of Node are you using?
v18.19.1
What operating system and version are you using?
Sonoma 14.6.1
Describe the Bug
Observed behavior
wrangler d1 export
fails with the error message✘ [ERROR] near "from": syntax error at offset 28: SQLITE_ERROR
Expected behavior
wrangler d1 export
succeeds, creating a SQL file.Steps to reproduce
Attempt to export the database, e.g.
wrangler d1 export testdb --remote --output foo.sql
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response