Dear Team, I am following this tutorial guide Connect with the Neon Vercel Integration — Neon Docs to connect neon to vercel.
It all works like magic, thank you!
Now however, the default injected secrets are direct connection URIs.
I see in the docs Connection pooling — Neon Docs that it requires changing the URI to add -pooler
.
Same for the ?sslmode=require
Is there any possible way to use connection pooling with the Vercel integration without manually manipulating the env variable?
Thank you!
1 Like
Hi @ThibaultJanBeyer ,
The current version of the integration only adds direct connections to Vercel projects. Pooled connections have to be added manually. It is something we plan to add in future iterations of the integration.
Regarding ?sslmode=require
, what driver are you using?
Hi Raouf thanks for coming back to me, I use:
import { drizzle } from “drizzle-orm/postgres-js”;
import postgres from “postgres”;
Which would complain on connection is not set to require
Thanks @ThibaultJanBeyer ,
You can also add Postgres options with postgres.js
driver in your code .
Can you try the below code?
const sql = postgres(connectionString, { ssl: { rejectUnauthorized: false } })
Let me know if this helps.
Hi @Raouf_Chebri,
is there an ETA for the pooled connection string env var via the Vercel Neon Integration? How do people connect to pooled connection in serverless environments?
1 Like
For now, if you want to use the pooled connection you will need to set it for your Vercel project manually. There is no exact ETA for when we’ll add it to the integration, but I’ll let the Product team know so we can prioritize it.
Was searching to see if there was a solution for this and want to say this would be a nice to have. Or at least include both the direct connection URI and the pooling connection URI as separate environment variables somehow.