Spaces:
Paused
Paused
Download apps/prevision-api/src/prisma/connection-string.ts from modventures/prevision: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/spaces/modventures/prevision/resolve/main/apps/prevision-api/src/prisma/connection-string.ts
- Command line
-
hf download hf://spaces/modventures/prevision/apps/prevision-api/src/prisma/connection-string.ts
-
curl -L -o connection-string.ts https://huggingface.co/spaces/modventures/prevision/resolve/main/apps/prevision-api/src/prisma/connection-string.ts
457 Bytes
| /** | |
| * node-postgres reads `sslmode=require` as "verify the certificate"; libpq (and the | |
| * BAETES API) only require encryption. Keep the libpq meaning so both APIs share DATABASE_URL. | |
| */ | |
| export function pgConnectionString(url: string): string { | |
| const parsed = new URL(url); | |
| if (parsed.searchParams.has('sslmode') && !parsed.searchParams.has('uselibpqcompat')) { | |
| parsed.searchParams.set('uselibpqcompat', 'true'); | |
| } | |
| return parsed.toString(); | |
| } | |