mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-06 02:26:46 +00:00
📝 Update location of get_db in SQL docs (#1293)
This commit is contained in:
parent
f8f0a6e462
commit
d53a253c8d
1 changed files with 1 additions and 1 deletions
|
|
@ -13,8 +13,8 @@ app = FastAPI()
|
||||||
|
|
||||||
# Dependency
|
# Dependency
|
||||||
def get_db():
|
def get_db():
|
||||||
|
db = SessionLocal()
|
||||||
try:
|
try:
|
||||||
db = SessionLocal()
|
|
||||||
yield db
|
yield db
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue