workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: wrangler d1 export

Open nferch opened this issue 1 year ago • 0 comments

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

  • Create a D1 database with the following table:
CREATE TABLE IF NOT EXISTS "Message" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "status" TEXT,
    "from" TEXT NOT NULL,
    "to" TEXT NOT NULL,
    "subject" TEXT NOT NULL,
    "body" TEXT NOT NULL
);

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

nferch avatar Aug 29 '24 15:08 nferch