drop/server/prisma.config.ts

18 lines
470 B
TypeScript
Raw Permalink Normal View History

import { config } from "dotenv";
import { defineConfig } from "prisma/config";
2025-11-15 10:59:17 +11:00
import path from "node:path";
// load .env variables
config();
// need to use built in env access as prisma's env function throws when DATABASE_URL is undefined
// this is acceptable as prisma throws already it actually needs the URL
const databaseURL = process.env.DATABASE_URL;
export default defineConfig({
2025-11-15 10:59:17 +11:00
schema: path.join("prisma"),
datasource: {
url: databaseURL,
},
});