Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com
Open History to see the last commit

index.ts

14 lines301 Bytes

1import { PGlite } from "@electric-sql/pglite";
2import { drizzle } from "drizzle-orm/pglite";
3​
4const dbName = import.meta.env.DEV
5 ? "idb://DEV-trytanstackdb"
6 : "idb://trytanstackdb";
7​
8export const client = new PGlite(dbName);
9​
10export const db = drizzle({
11 client,
12});
13​
14export type DB = typeof db;