def get_db() -> Generator: """ 获取sqlalchemy会话对象 :return: """ try: db = SessionLocal() yield db finally: db.close()
def get_db() -> Generator: # pragma: no cover try: db = SessionLocal() yield db finally: db.close()
def get_db() -> Generator: try: db = SessionLocal() yield db finally: db.close()
def get_db(): try: db = SessionLocal() yield db finally: db.close()