aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/server/db/index.ts
blob: 0e69fad280df7b413d5297693b94def6330c147a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { drizzle } from "drizzle-orm/node-postgres";
import * as schema from "./schema.js";
import * as schemaCrdt from "./schema-crdt.js";

const databaseUrl = process.env.DATABASE_URL;

if (!databaseUrl) {
	throw new Error("DATABASE_URL environment variable is not set");
}

export const db = drizzle(databaseUrl, {
	schema: { ...schema, ...schemaCrdt },
});

export * from "./schema.js";
export * from "./schema-crdt.js";