Expand description
Global connection-pool management for the compile-time selected database backend.
Exactly one database backend feature (mysql, postgres, or sqlite) selects
the concrete sqlx Database used throughout this module. The
pool is stored in a process-wide OnceLock and shared by reference, so
get_db_pool is effectively free to call from anywhere.
Structs§
- Pool
Settings - Connection-pool tuning resolved from the
database.*configuration namespace.
Functions§
- close_
db_ pool - Gracefully closes the global pool, waiting for in-flight connections to be returned and closed. Intended to be called during shutdown. This is a no-op if the pool was never initialized, so it is always safe to call.
- get_
db_ pool - Returns a reference to the global database pool.
- init_
db_ pool - Initializes the global database pool exactly once.