Open ruanjiayou opened 2 weeks ago
1.1.26
Darwin 21.6.0 x86_64 i386
the condition where name="title" always return 0, others condition works.
where name="title"
import { expect, test, describe } from "bun:test"; import { Database } from "bun:sqlite"; const db = new Database("data/temp.db", { create: true }); db.query(`DROP TABLE IF EXISTS apps`).run(); db.query(`CREATE TABLE IF NOT EXISTS apps( id INTEGER PRIMARY KEY, name CHAR(100), title CHAR(100) ); `).run(); describe("sqlite", () => { test("insert", async () => { const result = db.query(`INSERT INTO apps (id,name) VALUES(1, "title")`).run(); expect(result).toStrictEqual({ changes: 1, lastInsertRowid: 1 }); }); test("count", async () => { const v = db.query(`SELECT COUNT(*) as count FROM apps WHERE name="title"`).get() console.log(v) expect(v).toStrictEqual({ count: 1 }); }); });
No response
resolution: query with single quotes. eg, name='title'. double quotes maybe fail!
name='title'
What version of Bun is running?
1.1.26
What platform is your computer?
Darwin 21.6.0 x86_64 i386
What steps can reproduce the bug?
the condition
where name="title"
always return 0, others condition works.What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response