peppa/packages/db/src/index.ts
Асель 4168e8c867 Bootstrap Peppa monorepo, DB schema, OpenSpec and project template
- pnpm workspace: apps/web (Next.js), apps/bot, packages/{db,shared,mcp,runner}
- Drizzle schema: projects, goals, tasks, sessions, questions, events
- Postgres via infra/docker-compose.yml
- template/: AGENTS.md workflow on OpenSpec, Claude hooks, peppa MCP config
- scripts to push template and bootstrap projects in Gitea

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 19:13:16 +05:00

15 lines
402 B
TypeScript

import { loadEnv } from "@peppa/shared";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import * as schema from "./schema.ts";
export * from "./schema.ts";
export { schema };
export function createDb(url = loadEnv().DATABASE_URL) {
const client = postgres(url, { max: 5 });
return drizzle(client, { schema });
}
export type Db = ReturnType<typeof createDb>;