Add Elysia API scaffold

This commit is contained in:
Asep Haryana Saputra
2026-05-22 12:25:41 +00:00
parent e543226209
commit 5e38c9276a
10 changed files with 110 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
import { env } from '../config/env';
import * as schema from './schema';
export function createDbClient() {
if (!env.databaseUrl) {
throw new Error('DATABASE_URL is required to create a database client');
}
const client = postgres(env.databaseUrl);
return drizzle(client, { schema });
}