I use the pooling mode on my db endpoint but the tool I use to manage db migrations does not work with pgbouncer.
It would be great to have a method of connecting directly to DB, even when pooling is enabled. According to the Prisma docs, several other DB providers have this feature.
@Nick_Randall@psugihara This is something we’re actively working on and will ship very soon! We will expose two connection strings (pooled and non-pooled) so you will be able to run migrations when you have connection pooling enabled.
Any recommendation on how this could be done in Vercel, using @psugihara 's temp solution? I’m trying to switch to neon right now and this is the only thing holding me up as I do migrations with Prisma and host on Vercel
We shipped a solution for this but haven’t exposed it in our UI yet. First, make sure to disable the “pooler enabled” option in the endpoint settings.
To access the compute directly (without pooler), use the connection string & host values from the UI.
On the other hand, to access the compute via pooler, modify the connection string and add the -pooler suffix to the endpoint id just before the region part of the hostname.
I assume then that this work-around won’t work for the neon-vercel integration just yet? I.e. when I open a new pull request and neon creates a db branch of the production database for that particular preview enviornment, neon won’t yet automatically update the respective preview DATABASE_URL to the new pooling URL, correct? Or would it right now just default to the non-pooling URL with the integration enabled?
No specific ETA at the moment. It shouldn’t be a blocker from using the integration though, since previews generally don’t have the amount of traffic that requires connection pooling.
Hey @Krystian! We will soon make the pooled connection the default one for the integration and provide the direct connection as well. No exact ETA yet
We’re also working directly with the Prisma team so that migrations can be applied when using the pooled connection. This way, you will only need one connection string
We are trying to switch to Neon with Prisma on Vercel (using the integration) but the DATABASE_URL value that is set for preview branches, despite containing the pooling hostname, does not contain the pgbouncer=true flag at the end of the URL.
Because of this, queries fail with errors like:
prepared statement \"s41\" does not exist
Is there anything that can be done to add this value to the end of the URL? There is no way for us to do this in Prisma via env AFAICT.