I have a field (tags) that is of type JSON. I insert a record with the json value stringified. That appears to succeed. However, when I read the record back out, the value is missing inner quotes around values that need them.
The actual result is unusable.
Steps to Reproduce
await db.run(`
CREATE TABLE IF NOT EXISTS foo (
_id CHAR(6) NOT NULL PRIMARY KEY,
tags JSON DEFAULT []
);
`);
const _id = uid(6);
const tags = ["groceries"];
await db.run(`INSERT INTO foo (_id,tags) VALUES (${uid},${JSON.stringify(tags)});`);
const record = await db.run(`SELECT * FROM foo WHERE _id = ${uid};`);
console.log(record);
Issue Summary
I have a field (
tags
) that is of typeJSON
. I insert a record with the json value stringified. That appears to succeed. However, when I read the record back out, the value is missing inner quotes around values that need them.The actual result is unusable.
Steps to Reproduce
Actual result:
Expected result:
OR
Version
5.1.7
Node.js Version
21.5.0
How did you install the library?
npm i -S sqlite3