Sqlite3 support for Deno

Apologies if I'm being dense, but is there support for deno with a local sqlite3 db? I can't seem to get better-sqlite3 working in Deno. TIA
7 Replies
Braveheart
Braveheart2y ago
did u get anywhere? we decided on the same stack Also the recent advances in sqlite make that an interesting choice for production apps, and it’s much easier to work with in development than postgres
Braveheart
Braveheart2y ago
GitHub
GitHub - superfly/litefs: FUSE-based file system for replicating SQ...
FUSE-based file system for replicating SQLite databases across a cluster of machines - GitHub - superfly/litefs: FUSE-based file system for replicating SQLite databases across a cluster of machines
Braveheart
Braveheart2y ago
I get this error: Uncaught Error: Could not locate the bindings file. Tried: → /Users/nikos/WebstormProjects/vanillajs-patterns/backend/node_modules/.deno/[email protected]/node_modules/bindings/build/better_sqlite3.node from this
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
import { drizzle } from 'drizzle-orm/better-sqlite3';
import Database from 'better-sqlite3';

const users = sqliteTable('users', {
id: integer('id').primaryKey(), // 'id' is the column name
fullName: text('full_name'),
});

const sqlite = new Database('sqlite.db');
const db = drizzle(sqlite);

const allUsers = db.select().from(users).all();
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
import { drizzle } from 'drizzle-orm/better-sqlite3';
import Database from 'better-sqlite3';

const users = sqliteTable('users', {
id: integer('id').primaryKey(), // 'id' is the column name
fullName: text('full_name'),
});

const sqlite = new Database('sqlite.db');
const db = drizzle(sqlite);

const allUsers = db.select().from(users).all();
the above works in deno
nam.exe
nam.exe2y ago
I am having the same errors, tried out both bun and deno, always get errors while pushing when using sqlite. Are there any potential fixes?
Braveheart
Braveheart2y ago
sorry to hear lets sync up later in few hours if you like 6am in ukraine atm
hirefrank
hirefrankOP2y ago
I didn't make it anywhere fwiw. Did you figure it out?
benjick
benjick16mo ago
I have the same issue, but I'm using bun:sqlite (but not as driver, since it doesn't exist)

Did you find this page helpful?