base

API Reference

Database session and engine.

src.server.lib.db.base.session() AsyncIterator[AsyncSession][source]

Use this to get a database session where you can’t in Litestar.

Deprecated since version Use: config.get_session instead. Introduced in Advanced Alchemy v0.5.2.

Returns:

AsyncIterator[AsyncSession]

src.server.lib.db.base.async_session_factory: async_sessionmaker[AsyncSession] = async_sessionmaker(class_='AsyncSession', bind=<sqlalchemy.ext.asyncio.engine.AsyncEngine object>, autoflush=True, expire_on_commit=False)

Database session factory.

See async_sessionmaker.