This repository has been archived on 2026-11-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
everythingbutwork/packages/db/src/client.ts
T
dejanandClaude Opus 4.7 4f33509a0f
ci / quality (push) Has been cancelled
ci / build (push) Has been cancelled
Initial commit: everythingbutwork MVP
Internes Project-Management-Tool für ToolCTRL — ergänzend zu Plane (Tickets)
und Outline (Doku). Umfasst Puls-Übersicht, Tagesrhythmus (Lock-in + Reflexion),
Bereichs-Detail-Views (Entwicklung/Vertrieb/Marketing), Pflicht-Minimum-Check
und Blocker-Lifecycle gemäß Projektmanagement-Leitfaden v3.0.

Stack: pnpm-Monorepo · Vite + React 18 + Tailwind · Fastify + tRPC v11 +
Drizzle ORM · Postgres 16 · Authentik OIDC (Phase 2, Dev-Auto-Login aktiv).

Planungs-Artefakte unter _bmad-output/planning-artifacts/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 22:47:26 +02:00

24 lines
556 B
TypeScript

import { drizzle, type NodePgDatabase } from 'drizzle-orm/node-postgres';
import pg from 'pg';
import * as schema from './schema.js';
export type Db = NodePgDatabase<typeof schema>;
export interface CreateDbClientOptions {
connectionString: string;
poolSize?: number;
}
export function createDbClient(options: CreateDbClientOptions): {
db: Db;
pool: pg.Pool;
} {
const pool = new pg.Pool({
connectionString: options.connectionString,
max: options.poolSize ?? 10,
});
const db = drizzle(pool, { schema });
return { db, pool };
}