feat(db): setup drizzle config, client and package scripts

- Add drizzle.config.ts with PostgreSQL dialect configuration
- Create lib/db/index.ts with Drizzle ORM client and pg Pool
- Add db:generate, db:migrate, db:studio, db:push scripts to package.json

Part of Chunk 1: Drizzle Config & DB Client setup
This commit is contained in:
2026-04-25 11:32:13 +08:00
parent 9a87b3c7be
commit ad3fd31feb
3 changed files with 26 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
import { drizzle } from "drizzle-orm/node-postgres"
import { Pool } from "pg"
import * as schema from "./schema"
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
})
export const db = drizzle(pool, { schema })