better-auth/packages/database/drizzle/client.ts
 Илья Шалонин 8538ab969a first
2025-10-29 13:43:43 +05:00

15 lines
445 B
TypeScript

import { drizzle } from "drizzle-orm/node-postgres";
import * as schema from "./schema/postgres";
// Check the drizzle documentation for more information on how to connect to your preferred database provider
// https://orm.drizzle.team/docs/get-started-postgresql
const databaseUrl = process.env.DATABASE_URL as string;
if (!databaseUrl) {
throw new Error("DATABASE_URL is not set");
}
export const db = drizzle(databaseUrl, {
schema,
});