import { env } from "@haushaltsApp/env/server";
import { drizzle } from "drizzle-orm/node-postgres";

import * as schema from "./schema";

export const db = drizzle(env.DATABASE_URL, { schema });

// Re-export commonly used Drizzle utilities so consumers don't need a separate drizzle-orm dep
export { eq, and, or, not, gt, gte, lt, lte, isNull, isNotNull, inArray, asc, desc, sql } from "drizzle-orm";
