We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bcbc07 commit bf18c59Copy full SHA for bf18c59
src/lib/server/db/index.ts
@@ -1,7 +1,8 @@
1
import { drizzle } from 'drizzle-orm/postgres-js';
2
import postgres from 'postgres';
3
import { env } from '$env/dynamic/private';
4
+import { building } from '$app/environment';
5
-if (!env.DATABASE_URL) throw new Error('DATABASE_URL is not set');
6
-const client = postgres(env.DATABASE_URL);
+if (!env.DATABASE_URL && !building) throw new Error('DATABASE_URL is not set');
7
+const client = postgres(env.DATABASE_URL!);
8
export const db = drizzle(client);
0 commit comments