We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f2c485 commit 4f52a7fCopy full SHA for 4f52a7f
src/mrmat_python_api_fastapi/db.py
@@ -35,5 +35,6 @@ def get_db() -> Session:
35
else:
36
engine = create_engine(url=app_config.db_url)
37
session_local = sessionmaker(autocommit=False, autoflush=False, bind=engine)
38
- ORMBase.metadata.create_all(bind=engine)
+ with session_local():
39
+ ORMBase.metadata.create_all(bind=engine)
40
return session_local()
0 commit comments