but so far only on my local dev. on heroku i’m get...
# prisma-data-platform
p
but so far only on my local dev. on heroku i’m getting
Could not parse URL of the datasource
a
Can you provide more details? @Perry Raskin It should be possible to connect the proxy to your heroku deployment, if that’s your setup.
p
i have by DATABASE_URL env variable set up as the proxy, as well as the PRISMA_CLIENT_ENGINE_TYPE, as it says in the docs
i have it working on my dev. what else can i be missing for heroku?
a
Maybe the engine type is not set correctly at the time of generating the client? Are you generating it on heroku? Or commiting it to the repository? If you work without the proxy locally, for example, and push that version of the client, it’s going to be different than the one you need on heroku with the proxy.
p
i’m using the same exact names and setup as my local
Copy code
datasource db {
  provider          = "postgresql"
  url               = env("DATABASE_URL")
  shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}
this is my datasource in my schema file
👍 1
a
The proxy implementation has a constraint where the datasource needs to be named db for it to parse correctly. This is not an issue when not using the proxy. Hence my question
p
right, it is named
db
, so any idea what might be wrong? i’m so confused haha
on both local dev and Heroku,
DATABASE_URL
is the proxy URL
a
Let me ask the engineers on the team.
p
thanks so much i appreciate it!
j
Hey @Perry Raskin, this error means that you're using data proxy engine for Prisma but the URL provided cannot be parsed. We simply pass the value to the
URL
constructor and see if it throws: https://github.com/prisma/prisma/blob/main/packages/engine-core/src/data-proxy/DataProxyEngine.ts#L187-L199; my hunch is that the env var is not set correctly in Heroku. In your app, can you try to log
process.env.DATABASE_URL
?
p
yes, on dev it works lol. so how do u think i should debug on heroku?
j
In your app, can you try to log
process.env.DATABASE_URL
?
p
i had a feeling this is the issue, and if DATABASE_URL is returning
null
, what’s the best way to fix? it’s been working until i starting using proxy
alright ill log it and push. but yes it probably is
null
going to check the log now.. but i have that set properly
oh wow it logged properly!
ok it seems to work now. what could have changed haha i don’t understand
j
maybe you had some whitespace in the value?
p
i dont think so, i didnt change anything at all. so weird! but im glad it works!!
j
ok! keep an eye on it and ping us if it happens again
p
thanks so much!
and the pooling works like a charm! incredible work
🦜 3
a
Great to read it’s working now!