- bun workspaces + Turborepo monorepo (apps/web, apps/mcp; packages/*, scripts) - @mcpedia/core single business-logic layer (Document/Content/Search services) - @mcpedia/db Drizzle schema: documents + weighted tsvector (GIN) for FTS - @mcpedia/parser frontmatter, @mcpedia/search Postgres FTS (ts_rank+ts_headline) - Next.js 16 Web UI (home/doc SSG, search dynamic) + react-markdown render - MCP server (stdio) with 4 tools + in-memory smoke test - scripts/indexer walks content/ -> upserts into Postgres - 4 seed docs; README + PHASES status
16 lines
497 B
TypeScript
16 lines
497 B
TypeScript
import { drizzle } from "drizzle-orm/postgres-js";
|
|
import postgres from "postgres";
|
|
import { DATABASE_URL } from "@mcpedia/config";
|
|
import * as schema from "./schema";
|
|
|
|
// PgBouncer (imrnes :6432) uses transaction pooling, which rejects protocol
|
|
//-level prepared statements. prepare:false makes postgres-js use simple queries.
|
|
const client = postgres(DATABASE_URL, {
|
|
prepare: false,
|
|
max: 5,
|
|
onnotice: () => {},
|
|
});
|
|
|
|
export const db = drizzle(client, { schema });
|
|
export { schema, client };
|