From 3f98f13743f8ff6429013565de845b4ac137de85 Mon Sep 17 00:00:00 2001 From: Vladislav Shepilov Date: Thu, 21 Dec 2023 21:28:40 +0300 Subject: [PATCH] bug fix for multiple databases support, fix #17 --- fastapi_async_sqlalchemy/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi_async_sqlalchemy/middleware.py b/fastapi_async_sqlalchemy/middleware.py index 1a407fa..bb6024d 100644 --- a/fastapi_async_sqlalchemy/middleware.py +++ b/fastapi_async_sqlalchemy/middleware.py @@ -51,7 +51,7 @@ def __init__( ) async def dispatch(self, request: Request, call_next: RequestResponseEndpoint): - async with db(commit_on_exit=self.commit_on_exit): + async with DBSession(commit_on_exit=self.commit_on_exit): return await call_next(request) class DBSessionMeta(type):