mirror of https://github.com/tiangolo/fastapi.git
📝 Update location of get_db in SQL docs (#1293)
This commit is contained in:
parent
f8f0a6e462
commit
d53a253c8d
|
|
@ -13,8 +13,8 @@ app = FastAPI()
|
|||
|
||||
# Dependency
|
||||
def get_db():
|
||||
db = SessionLocal()
|
||||
try:
|
||||
db = SessionLocal()
|
||||
yield db
|
||||
finally:
|
||||
db.close()
|
||||
|
|
|
|||
Loading…
Reference in New Issue