Coverage for app/db/engine.py: 100%
5 statements
« prev ^ index » next coverage.py v7.14.1, created at 2026-10-31 11:18 +0000
« prev ^ index » next coverage.py v7.14.1, created at 2026-10-31 11:18 +0000
1"""SQLAlchemy engine + session factory for svc-auth's durable session store.
3Redis remains the runtime fast-path (token storage, `/verify`); Postgres is the
4durable source of truth for the session list/history shown in the account UI.
5"""
7from sqlalchemy import create_engine
8from sqlalchemy.orm import sessionmaker, Session
10from app.config import settings
12engine = create_engine(
13 settings.POSTGRES_URL_FULL,
14 pool_pre_ping=True,
15 pool_size=5,
16 max_overflow=10,
17 future=True,
18)
20SessionLocal = sessionmaker(
21 bind=engine,
22 autoflush=False,
23 autocommit=False,
24 class_=Session,
25)