forked from farhoodlabs/paperclip
948e8e8c94
Postgres schema via Drizzle ORM for agents, goals, issues, projects, and activity log tables. Includes migration runner, seed script, and Drizzle config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
11 lines
283 B
TypeScript
11 lines
283 B
TypeScript
import { drizzle } from "drizzle-orm/postgres-js";
|
|
import postgres from "postgres";
|
|
import * as schema from "./schema/index.js";
|
|
|
|
export function createDb(url: string) {
|
|
const sql = postgres(url);
|
|
return drizzle(sql, { schema });
|
|
}
|
|
|
|
export type Db = ReturnType<typeof createDb>;
|