Basic kysely setup
This commit is contained in:
@@ -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,
|
||||
}),
|
||||
})
|
||||
});
|
||||
@@ -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"),
|
||||
};
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user