Пример #1
0
def get_db() -> Generator:
    """
    获取sqlalchemy会话对象
    :return:
    """
    try:
        db = SessionLocal()
        yield db
    finally:
        db.close()
Пример #2
0
def get_db() -> Generator:  # pragma: no cover
    try:
        db = SessionLocal()
        yield db
    finally:
        db.close()
Пример #3
0
def get_db() -> Generator:
    try:
        db = SessionLocal()
        yield db
    finally:
        db.close()
Пример #4
0
def get_db():
    try:
        db = SessionLocal()
        yield db
    finally:
        db.close()