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:
2026-08-28 16:13:57 +00:00
commit fad0a52690
20 changed files with 661 additions and 0 deletions
+18
View File
@@ -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;