Docs unclear on connection pool vs. direct connection
In the docs under "Supabase" it teaches you how to setup Drizzle w/ supabase. The last part shows how to set up the connection:
But underneath it simply says:
Connect to your database using the Connection Pooler for serverless environments, and the Direct Connection for long-running servers.
I'm assuming the code above is for Direct Connection? If that is the case, why is there no implementation demonstration for the Connection Pooler? Also isn't Supabase always going to be serverless? Maybe I'm missing something but this just feels confusing
10 Replies
I guess you're right. Would you like to open an issue in GitHub for this?
Sure I’ll do this
In the meantime tho, how do you set up drizzle with serverless supabase?
Use a pool as it's recommended
Maybe I am dumb but I can't make pooler url working with Supabase. It always ends on errors when my code runs.
Afaik, postgressjs handles pooler. You just have to choose the good connection string.
Connecting to your database | Supabase Docs
Explore the options for connecting to your Postgres database.
Read carefully if you use prepared statements, the default pool mode on Supabase is "transaction" and doesn't handle them.
Looks like a connection pooler is the way to go according to this
Any luck resolving this?
I opened a ticket and no clear answer
What happen to me: deploying 3 instances on fly.io (docker containers), few minutes later everything is done with cryptic errors related to pooler
I chatted with someone with the same issue
Is the Drizzle team aware of this? I’m sure there are tons of ppl using Drizzle w serverless Postgres dbs so I’m guessing we’re just missing something?
This is at least a driver issue or a Supabase issue 🥶
Or this is just me 😂