Immutable solution version
TS: SQLDatabase's connection string fails when connecting to Prisma CLI
Complete solution
Shows how to fix tS: SQLDatabase's connection string fails when connecting to Prisma CLI. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The connection string from SQLDatabase failing with the Prisma CLI was a bug fixed in Encore v1.41.4. Fix: update Encore to v1.41.4 or later and your original code should work without the CLI workaround. Source: https://github.com/encoredev/encore/issues/1388 (Encore Cloud)
Steps
- The connection string from SQLDatabase failing with the Prisma CLI was a bug fixed in Encore v1.41.4. Fix: update Encore to v1.41.4 or later and your original code should work without the CLI workaround.
- Source: https://github.com/encoredev/encore/issues/1388 (Encore Cloud)
When to use
Use this skill when you run into "TS: SQLDatabase's connection string fails when connecting to Prisma CLI".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: Encore v1.41.4. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/encoredev/encore/issues/1388
Evidence
In gh:encoredev/encore#1388, the issue was: At my organization we're trying to integrate Prisma with Encore.dev(TS). Fow now it looks like Prisma doesn't allows you to programatically migrate everything so we decided to spawn the Prisma CLI as a workaround. The problem here is that the connection string provided by SQLDatabase is wrong but the Encore CLI is able to give me the correct connection string. [image] ## Code ```ts // auth/auth.ts import { SQLDatabase } from "encore.. The verified answer: The connection string from SQLDatabase failing with the Prisma CLI was a bug fixed in Encore v1.41.4. Fix: update Encore to v1.41.4 or later and your original code should work without the CLI workaround.. Issue URL: https://github.com/encoredev/encore/issues/1388
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_HxC1E35aLh74sLwCm8Z14Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">TS: SQLDatabase's connection string fails when connecting to Prisma CLI <span>— Vectle</span></a>