diff --git a/src/lib/server/db/index.ts b/src/lib/server/db/index.ts index e4b3c9d..a666c77 100644 --- a/src/lib/server/db/index.ts +++ b/src/lib/server/db/index.ts @@ -1,7 +1,8 @@ import { drizzle } from 'drizzle-orm/postgres-js'; import postgres from 'postgres'; import { env } from '$env/dynamic/private'; +import { building } from '$app/environment'; -if (!env.DATABASE_URL) throw new Error('DATABASE_URL is not set'); -const client = postgres(env.DATABASE_URL); +if (!env.DATABASE_URL && !building) throw new Error('DATABASE_URL is not set'); +const client = postgres(env.DATABASE_URL!); export const db = drizzle(client);