FIXED - Drop leftover Prisma ?schema=public from the DB URL
CI / quality (push) Waiting to run

- postgres.js forwarded schema as a startup param; Postgres rejected the connection
- Remove ?schema=public from docker-compose, CI, and the client default
- Strip any query string in lib/db/index.ts so this cannot recur
This commit is contained in:
Moh
2026-08-08 03:04:26 +02:00
parent 1264b577a1
commit 0f436ec05a
3 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -8,9 +8,12 @@ import * as schema from "./schema";
* used by the other projects. Replaces the old Prisma client (`lib/prisma.ts`).
* A single connection is reused across hot reloads in dev.
*/
const connectionString =
process.env.DATABASE_URL ??
"postgresql://postgres:postgres@localhost:5432/moh_sass?schema=public";
// Strip any query string (e.g. a leftover Prisma `?schema=public`) — postgres.js
// forwards unknown params to the server as startup options and Postgres rejects
// them ("unrecognized configuration parameter"). `public` is the default schema.
const connectionString = (
process.env.DATABASE_URL ?? "postgresql://postgres:postgres@localhost:5432/moh_sass"
).split("?")[0];
const globalForDb = globalThis as unknown as {
dbClient: ReturnType<typeof postgres> | undefined;