13 lines
368 B
TypeScript
13 lines
368 B
TypeScript
import { drizzle } from "drizzle-orm/postgres-js";
|
|
import postgres from "postgres";
|
|
import * as schema from "./schema";
|
|
|
|
const connectionString = process.env.POSTGRES_URL as string;
|
|
|
|
if (!connectionString) {
|
|
throw new Error("POSTGRES_URL environment variable is not set");
|
|
}
|
|
|
|
const client = postgres(connectionString);
|
|
export const db = drizzle(client, { schema });
|