11 lines
258 B
Python
11 lines
258 B
Python
from typing import Generator
|
|
from sqlalchemy.orm import Session
|
|
from app.core.db.common import CommonSessionLocal
|
|
|
|
def get_common_db() -> Generator[Session, None, None]:
|
|
db = CommonSessionLocal()
|
|
try:
|
|
yield db
|
|
finally:
|
|
db.close()
|