Skip to main content

Module connection

Module connection 

Source
Expand description

Database connection helpers and SQLite reader/writer pool setup.

The module wraps SeaORM connection creation with retry behavior, optional metrics callbacks, and SQLite-specific pooling rules. SQLite writer connections are constrained so transaction serialization is explicit, while read-only handles can still be split out when the URL supports it.

Structs§

DatabaseConfig
Database connection configuration.
DbHandles
Pair of writer and reader database handles.

Functions§

connect
Connects to the configured database without metrics.
connect_reader_for_writer
Creates reader/writer handles for an existing writer connection without metrics.
connect_reader_for_writer_with_metrics
Creates reader/writer handles for an existing writer connection and metrics recorder.
connect_with_metrics
Connects to the configured database and installs a metrics callback.