Keep the possibility to pass an existing Pool to `@prisma/adapter-pg`
In 6.6.0, the DX of
@prisma/adapter-pg
was simplified that a pool is created for you, but I'd like to keep the ability to pass an existing pool myself.8 Replies
You selected to wait for the human sages. They'll share their wisdom soon.
Grab some tea while you wait, or check out
#ask-ai
if you'd like a quick chat with the bot anyway!Hey 👋
Are you referring to this recent change in Driver Adapters?

Hey, yes, exactly. It’s cool that you don’t have to provide a pool yourself, but keeping the option to provide it would be great.
Is there any specific use case you would like to achieve by creating the pool manually? I assume you can do all the things with new changes as well.
I'll still ask team if we intend to keep the old way or not
We have set up the work with sharing the connection pool with different tools, that also use that pool, to maximize the connection pool limit between the different tools used for a background work runner (pg-boss).
Now we have to split the connections again, to reserve some for pg-boss and some for Prisma, because it’s a 2 different pools.
It made sense in our context to keep it together, but I understand the general divide. I just would welcome to keep the option to provide a pool yourself.
To explain the context a bit more: with using RDS, we have to keep an eye on the used number of possible connections to the database because of a limit.
Thanks for sharing the additional context 👍
I've added an additional use case to the matching GitHub Issue (https://github.com/prisma/prisma/issues/26885). For the pg adapter, pg Pool supports hooking into lifecycle events and expects error handling via such a hook to prevent crashing the process.
Is the created Pool instance in 6.6.0 handling this behaviour?
GitHub
Issues · prisma/prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB - Issues · prisma/prisma
Thank you for creating the feature request! Our ORM team will share their thoughts on the feature request 🙏