Basic kysely setup

This commit is contained in:
Dominic Ferrando
2026-07-01 23:16:31 -04:00
parent ab6eb56814
commit 593db80067
6 changed files with 124 additions and 8 deletions
View File
+12
View File
@@ -0,0 +1,12 @@
import { Kysely, PostgresDialect } from 'kysely';
import { type DB } from 'kysely-codegen';
import { Pool } from "pg";
import { env } from '../env';
const db = new Kysely<DB>({
dialect: new PostgresDialect({
pool: new Pool({
connectionString: env.DATABASE_URL,
}),
})
});
+1
View File
@@ -19,6 +19,7 @@ export const env = {
WEBFLOW_WEBHOOK_SECRET: requireEnv("WEBFLOW_WEBHOOK_SECRET"),
AUTH_SECRET: requireEnv("AUTH_SECRET"),
ADMIN_PASSWORD: requireEnv("ADMIN_PASSWORD"),
DATABASE_URL: requireEnv("DATABASE_URL"),
NODE_ENV: optionEnv("NODE_ENV", "development"),
LOG_LEVEL: optionEnv("LOG_LEVEL", "info"),
};
-7
View File
@@ -25,13 +25,6 @@ import { env } from "./env";
import serverTiming from "@elysia/server-timing";
import jwt from "@elysia/jwt";
const log = pino({
level: env.LOG_LEVEL,
transport: env.NODE_ENV != "production"
? { target: "pino-pretty" }
: undefined,
});
// SERVICES
// -----------
const levelCalculator = new LevelCalculator(