8 lines
327 B
Python
8 lines
327 B
Python
"""Async engine/session for the bot's own tables (same postgres as the api)."""
|
|
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
|
|
|
|
from app.config import settings
|
|
|
|
engine = create_async_engine(settings.DATABASE_URL, pool_pre_ping=True)
|
|
SessionLocal = async_sessionmaker(engine, expire_on_commit=False)
|