async-fastapi-postgres-template icon indicating copy to clipboard operation
async-fastapi-postgres-template copied to clipboard

Unnecesary redeclaration of sessionmaker

Open suspiciousRaccoon opened this issue 1 year ago • 0 comments

In src/fastapi_server/app/api/dependencies/database.py you have a function that redeclares the sessionmaker each time you call it. The purpose of the sessionmaker is to have the settings for all sessions defined in a single place. You can move it to database.py like how the FastAPI tutorial does.

suspiciousRaccoon avatar May 26 '24 00:05 suspiciousRaccoon