Updated to just use DATABASE_* in everything other than local docker.
This commit is contained in:
Stefan Lazic committed 2026-08-07 17:30:12 +01:00
1 parent 769d3f9ebc
commit 51de4f4ef5
19 files changed
+120 -56

No files matched your search

@@ -5,7 +5,7 @@ import type { BusinessReviewSummary, ReviewsProvider } from "../reviews.service"
describe("reviews.service", () => {
// The module has no eager default provider (see reviews.service.ts's
// header — it lazily resolves a real, DB-backed provider on first use
// otherwise, which would need a live DATABASE_URL). Every test here
// otherwise, which would need live database env vars). Every test here
// explicitly opts into the demo provider so none of them ever touch it.
beforeEach(() => {
setReviewsProvider(createDemoReviewsProvider());
+2 -2
View File
@@ -102,8 +102,8 @@ export class DbReviewsProvider implements ReviewsProvider {
* `null` = no explicit override; resolved lazily to a real DbReviewsProvider
* on first use. Deliberately NOT constructed eagerly at module load — this
* file must stay importable from a pure unit-test context with no
* DATABASE_URL (see reviews.service.test.ts), and src/lib/db/prisma.ts
* throws at import time if that's unset.
* database env vars set (see reviews.service.test.ts), and src/lib/db/prisma.ts
* throws at import time if they're unset.
*/
let provider: ReviewsProvider | null = null;
let cachedDefaultProvider: ReviewsProvider | null = null;
@@ -11,7 +11,7 @@ import { Weekday } from "@/generated/prisma/enums";
* (migrated from PostgreSQL to MySQL in Phase 7).
*/
const adapter = new PrismaMariaDb(buildMysqlPoolConfig(process.env.DATABASE_URL));
const adapter = new PrismaMariaDb(buildMysqlPoolConfig());
export const prisma = new PrismaClient({ adapter });
let counter = 0;