db/ fix DB env var name

This commit is contained in:
Leon van Zyl
2025-08-13 15:28:44 +02:00
parent 15a2efbd17
commit 955a14dfe5
8 changed files with 42 additions and 48 deletions

View File

@@ -1,12 +1,12 @@
import { drizzle } from "drizzle-orm/postgres-js"
import postgres from "postgres"
import * as schema from "./schema"
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import * as schema from "./schema";
const connectionString = process.env.DATABASE_URL as string
const connectionString = process.env.POSTGRES_URL as string;
if (!connectionString) {
throw new Error("DATABASE_URL environment variable is not set")
throw new Error("POSTGRES_URL environment variable is not set");
}
const client = postgres(connectionString)
export const db = drizzle(client, { schema })
const client = postgres(connectionString);
export const db = drizzle(client, { schema });