Initial boilerplate scaffold for continuum-backend
Bun + ElysiaJS control plane: Drizzle/Postgres schema (printers, farms, print_jobs, pgvector frame_embeddings), R2 presigned URLs, Redis Streams frame ingestion queue, REST routes, and the /ws/edge/v1 edge-gateway WebSocket uplink.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { drizzle } from "drizzle-orm/postgres-js";
|
||||
import postgres from "postgres";
|
||||
import * as schema from "./schema";
|
||||
|
||||
// Points at pgCat/PgBouncer, not Postgres directly, so keep prepared
|
||||
// statements disabled and cap the pool per-instance connections low.
|
||||
const connectionString = process.env.DATABASE_URL;
|
||||
if (!connectionString) {
|
||||
throw new Error("DATABASE_URL is not set");
|
||||
}
|
||||
|
||||
const client = postgres(connectionString, {
|
||||
prepare: false,
|
||||
max: Number(process.env.DATABASE_POOL_MAX ?? 10),
|
||||
});
|
||||
|
||||
export const db = drizzle(client, { schema });
|
||||
export type Database = typeof db;
|
||||
Reference in New Issue
Block a user