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]


Drizzle function call:
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,
});


All seems good but no data being inserted into db, what might be wrong?

Code here: https://github.com/Jokcy/solidstart-cf
GitHub
Contribute to Jokcy/solidstart-cf development by creating an account on GitHub.
Was this page helpful?