Initial API scaffold: Elysia + Bun + Drizzle + BetterAuth + LangChain

This commit is contained in:
2026-01-27 02:43:11 +00:00
commit 06f1b4e548
18 changed files with 1807 additions and 0 deletions

16
src/db/index.ts Normal file
View File

@@ -0,0 +1,16 @@
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
import * as schema from './schema';
const connectionString = process.env.DATABASE_URL!;
if (!connectionString) {
throw new Error('DATABASE_URL environment variable is required');
}
// For query purposes
const queryClient = postgres(connectionString);
export const db = drizzle(queryClient, { schema });
// For migrations (uses a different client)
export const migrationClient = postgres(connectionString, { max: 1 });