I am building an API at work. For that, I use Python library FastAPI as web framework and SQLAlchemy for database management. Since I know, model repository is the neatest way to handle database interactions, I define a SQLAlchemy model called User
and try to advance based on this approach for others in case it works succesfully.
It requires, however, the so-called dependencies for session instanciation at every database interaction.
The database infrastructure sofar is on route path src/storage/db
.
https://github.com/trouchet/chemistry
You can try to run within an environment (Linux oriented instructions):
- Create the environment with command run
make env
; - Activate it with command run source .venv/bin/activate;
- Run the tests with command run
make test
.
Any help is very appreciated. I thank in advance.