Closed
Description
Which Cloudflare product(s) does this pertain to?
D1
What versions & operating system are you using?
Wrangler 4.13.0
Please provide a link to a minimal reproduction
No response
Describe the Bug
- Create a table with a text column, and add some data with both the literal
\n
and normal linebreaks - Export the database with the Wrangler command
wrangler d1 export <db_name> --remote --output=./test.sql
- Inspect the SQL file downloaded
PRAGMA defer_foreign_keys=TRUE;
CREATE TABLE [test] ("test_text" text);
INSERT INTO test VALUES('AAA\nAAA');
INSERT INTO test VALUES(replace('AAA\nAAA','\n',char(10)));
INSERT INTO test VALUES(replace('AAA\nAAA\nBBB','\n',char(10)));
In this table, the first record contains only the literal \n
, the second one contains only linebreaks, these two appear intact.
However, the third one was messed up, and the literal \n
was converted to linebreaks.
Please provide any relevant error logs
No response
Metadata
Metadata
Assignees
Type
Projects
Status
Done