Add support for creating DB connection pools without establishing connections up front. This is already supported by SQLx via the Pool::connect_lazy method.
This was discussed previously
here, but it appears support was never added to SEA ORM directly.
Bug Fixes
[x] N/A
Breaking Changes
[x] N/A
Changes
This PR adds a new connect_lazy option to database::ConnectOptions. If set to true, the SQLx Pool will be created using the Pool::connect_lazy_with method; otherwise, the Pool::connect_with method will be used (e.g., the existing behavior). This "lazy" behavior is implemented for each DB variant (Postgres/MySQL/SQLite).
PR Info
New Features
Add support for creating DB connection pools without establishing connections up front. This is already supported by SQLx via the Pool::connect_lazy method.
This was discussed previously here, but it appears support was never added to SEA ORM directly.
Bug Fixes
Breaking Changes
Changes
This PR adds a new
connect_lazy
option todatabase::ConnectOptions
. If set totrue
, the SQLxPool
will be created using thePool::connect_lazy_with
method; otherwise, thePool::connect_with
method will be used (e.g., the existing behavior). This "lazy" behavior is implemented for each DB variant (Postgres/MySQL/SQLite).