- 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:
+6
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user