-
I need to pass a connection to a multiple services and would like to know if cloning database connection creates a new pool? For example if 1 poll creates 5 connections and I will clone poll 100 times does it mean I will create 500 active db connections? If so, is there an easy way to use a shared connection pool without lifetimes?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @ziimakc, sorry I make a mistake.
As stated in the SQLx documentation.
So, the connection pool above will keep at least 5 active connections at all time and at most 100 connections. You can feel free to clone |
Beta Was this translation helpful? Give feedback.
Hey @ziimakc, sorry I make a mistake.
sea_orm::DatabaseConnection
is based onsqlx::Pool
.As stated in the SQLx documentation.
So, the connection pool above will keep at least 5 active connections at all time and at most 100 connections. You can feel free to clone
sea_orm::DatabaseConnection
.