s365b.db.session¶
Database engine and session factory.
Classes¶
Holds the async engine and hands out sessions. |
Module Contents¶
- class s365b.db.session.Database(settings: s365b.core.config.Settings)[source]¶
Holds the async engine and hands out sessions.
- Parameters:
settings – Settings providing
database_url.
- async session() collections.abc.AsyncIterator[sqlalchemy.ext.asyncio.AsyncSession][source]¶
Open a session that commits on success and rolls back on error.
- Yields:
The session.