h0rn3t / fastapi-async-sqlalchemy

FastAPI Async SQLAlchemy middleware
MIT License
142 stars 11 forks source link

Enable usage of multiple databases #15

Closed tappress closed 1 year ago

tappress commented 1 year ago

Added middleware factory to enable creation of multiple middlewares and session proxies.

This way it will be possible to use multiple databases at the same time, which was not possible previously, since there was only one middleware class and global session proxy.

Default SQLAlchemyMiddleware and global db are preserved for convenience and backward compatibility.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.07% :tada:

Comparison is base (fd7fee1) 97.14% compared to head (fc81664) 97.22%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #15 +/- ## ========================================== + Coverage 97.14% 97.22% +0.07% ========================================== Files 3 3 Lines 70 72 +2 ========================================== + Hits 68 70 +2 Misses 2 2 ``` | [Files Changed](https://app.codecov.io/gh/h0rn3t/fastapi-async-sqlalchemy/pull/15?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Eugene) | Coverage Δ | | |---|---|---| | [fastapi\_async\_sqlalchemy/middleware.py](https://app.codecov.io/gh/h0rn3t/fastapi-async-sqlalchemy/pull/15?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Eugene#diff-ZmFzdGFwaV9hc3luY19zcWxhbGNoZW15L21pZGRsZXdhcmUucHk=) | `96.72% <100.00%> (+0.11%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.