import "server-only";
import postgres from "postgres";
import { drizzle } from "drizzle-orm/postgres-js";
import * as schema from "./schema";
import { loadEnv } from "@/lib/env";

const env = loadEnv();
const queryClient = postgres(env.databaseUrl, { max: 10 });
export const db = drizzle(queryClient, { schema });
export type Db = typeof db;
