stashing code
This commit is contained in:
17
packages/db/index.ts
Normal file
17
packages/db/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import "dotenv/config";
|
||||
|
||||
import { drizzle } from "drizzle-orm/postgres-js";
|
||||
import postgres from "postgres";
|
||||
import * as schema from "./schema";
|
||||
|
||||
const dbUrl = process.env.DATABASE_URL ?? "";
|
||||
|
||||
const client = postgres(dbUrl);
|
||||
|
||||
const db = drizzle(client, { schema });
|
||||
|
||||
export type Database = typeof db;
|
||||
|
||||
export * from "drizzle-orm";
|
||||
|
||||
export { db, schema };
|
||||
Reference in New Issue
Block a user