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()