chore(turborepo): initial setup and config, move db to package

This commit is contained in:
Hyteq
2025-06-24 11:23:40 +03:00
parent 65bff0d2da
commit 140880a444
15 changed files with 614 additions and 6701 deletions

16
packages/db/src/index.ts Normal file
View File

@ -0,0 +1,16 @@
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import * as schema from "./schema";
if (!process.env.DATABASE_URL) {
throw new Error("DATABASE_URL is not set");
}
// Create the postgres client
const client = postgres(process.env.DATABASE_URL);
// Create the drizzle instance
export const db = drizzle(client, { schema });
// Re-export schema for convenience
export * from "./schema";