PIbd-42_SSPR/db/postgres_db_connection.py

6 lines
276 B
Python
Raw Normal View History

from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker
from settings import settings
engine_postgres = create_async_engine(url=settings.db_url_asyncpg_docker, echo=True)
async_session_postgres = async_sessionmaker(engine_postgres, expire_on_commit=False)