diff --git a/backend/db/index.ts b/backend/db/index.ts index 20dc9c7..4bc7093 100644 --- a/backend/db/index.ts +++ b/backend/db/index.ts @@ -3,7 +3,7 @@ import { Pool } from "pg" import {secrets} from "../src/utils/secrets"; import * as schema from "./schema" -const pool = new Pool({ +export const pool = new Pool({ connectionString: secrets.DATABASE_URL, max: 10, // je nach Last }) diff --git a/backend/src/plugins/db.ts b/backend/src/plugins/db.ts index fbe41ce..c0f7a11 100644 --- a/backend/src/plugins/db.ts +++ b/backend/src/plugins/db.ts @@ -1,7 +1,6 @@ import fp from "fastify-plugin" import {drizzle, NodePgDatabase} from "drizzle-orm/node-postgres" -import { Pool } from "pg" -import { db } from "../../db" +import { db, pool } from "../../db" export default fp(async (server, opts) => { // Dekorieren -> überall server.db