wolf/gang
wolf/gang
DTDrizzle Team
Created by wolf/gang on 10/8/2024 in #help
How to connect to local sqlite database
I wanted to play around with drizzle and sqlite in a next.js project. But I can’t even create the client like it’s described in the docs:
// page.tsx
import { drizzle } from "drizzle-orm/connect";

const getData = async () => {
const db = await drizzle("libsql", "file:local.db");
};

export default async function Home() {
return <div>Hello</div>;
}
// page.tsx
import { drizzle } from "drizzle-orm/connect";

const getData = async () => {
const db = await drizzle("libsql", "file:local.db");
};

export default async function Home() {
return <div>Hello</div>;
}
I get the following error: Module build failed: UnhandledSchemeError: Reading from "bun:sqlite" is not handled by plugins (Unhandled scheme). Webpack supports "data:" and "file:" URIs by default. You may need an additional plugin to handle "bun:" URIs. What am I doing wrong here and how can I fix this? It’s very confusing because I’m not even trying to use bun. Thank you!
4 replies