summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/asyncio/session.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/session.py')
-rw-r--r--lib/sqlalchemy/ext/asyncio/session.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py
index 1956ea588..a74e87769 100644
--- a/lib/sqlalchemy/ext/asyncio/session.py
+++ b/lib/sqlalchemy/ext/asyncio/session.py
@@ -124,6 +124,7 @@ class AsyncSession(ReversibleProxy[Session]):
def __init__(
self,
bind: Optional[_AsyncSessionBind] = None,
+ *,
binds: Optional[Dict[_SessionBindKey, _AsyncSessionBind]] = None,
sync_session_class: Optional[Type[Session]] = None,
**kw: Any,
@@ -1436,9 +1437,35 @@ class async_sessionmaker(Generic[_AS]):
class_: Type[_AS]
+ @overload
+ def __init__(
+ self,
+ bind: Optional[_AsyncSessionBind] = ...,
+ *,
+ class_: Type[_AS],
+ autoflush: bool = ...,
+ expire_on_commit: bool = ...,
+ info: Optional[_InfoType] = ...,
+ **kw: Any,
+ ):
+ ...
+
+ @overload
+ def __init__(
+ self: "async_sessionmaker[AsyncSession]",
+ bind: Optional[_AsyncSessionBind] = ...,
+ *,
+ autoflush: bool = ...,
+ expire_on_commit: bool = ...,
+ info: Optional[_InfoType] = ...,
+ **kw: Any,
+ ):
+ ...
+
def __init__(
self,
bind: Optional[_AsyncSessionBind] = None,
+ *,
class_: Type[_AS] = AsyncSession, # type: ignore
autoflush: bool = True,
expire_on_commit: bool = True,