syncsession.py 339 B

12345678910111213
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from sqlalchemy import create_engine
  4. from sqlalchemy.orm import sessionmaker
  5. from core.config import settings
  6. engine = create_engine(settings.SYNC_MYSQL_URI, pool_pre_ping=True)
  7. LocalSyncSession = sessionmaker(autocommit=False, autoflush=False, bind=engine)
  8. __all__ = ["LocalSyncSession"]