s365b.db.session ================ .. py:module:: s365b.db.session .. autoapi-nested-parse:: Database engine and session factory. Classes ------- .. autoapisummary:: s365b.db.session.Database Module Contents --------------- .. py:class:: Database(settings: s365b.core.config.Settings) Holds the async engine and hands out sessions. :param settings: Settings providing ``database_url``. .. py:attribute:: engine :type: sqlalchemy.ext.asyncio.AsyncEngine .. py:method:: session() -> collections.abc.AsyncIterator[sqlalchemy.ext.asyncio.AsyncSession] :async: Open a session that commits on success and rolls back on error. :Yields: The session. .. py:method:: ping() -> bool :async: Check the database is reachable. :returns: True if a trivial query succeeds. .. py:method:: dispose() -> None :async: Close all pooled connections.