Jokcy
Jokcy
Explore posts from servers
DTDrizzle Team
Created by Jokcy on 1/30/2024 in #help
Insert into sqlite3 with better-sqlite3 not working
The drizzle logger out put:
Query: insert into "todos" ("id", "title", "completed", "created_at") values (null, ?, ?, ?) returning "id", "title", "completed", "created_at" -- params: ["asd", 0, 1706613150]
Query: insert into "todos" ("id", "title", "completed", "created_at") values (null, ?, ?, ?) returning "id", "title", "completed", "created_at" -- params: ["asd", 0, 1706613150]
Drizzle function call:
const x = await db
.insert(todos)
.values({
title: text,
createdAt: new Date(),
})
.returning()
.execute();
const x = await db
.insert(todos)
.values({
title: text,
createdAt: new Date(),
})
.returning()
.execute();
DB:
const sqlite = new Database(join(process.cwd(), "./db.sqlite"));
_db = drizzle(sqlite, {
schema,
logger: true,
});
const sqlite = new Database(join(process.cwd(), "./db.sqlite"));
_db = drizzle(sqlite, {
schema,
logger: true,
});
All seems good but no data being inserted into db, what might be wrong? Code here: https://github.com/Jokcy/solidstart-cf
6 replies