Backend con base de datos relacional MySQL

This commit is contained in:
Mireya Cueto Garrido
2026-03-27 09:02:28 +01:00
parent e9a3bf6c21
commit 57b64b4f1e
15 changed files with 106 additions and 19 deletions
+15
View File
@@ -0,0 +1,15 @@
from sqlalchemy.orm import sessionmaker
from .connection import engine
SessionLocal = sessionmaker(
autocommit=False,
autoflush=False,
bind=engine
)
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()