diff options
Diffstat (limited to 'lib/sqlalchemy/orm/session.py')
-rw-r--r-- | lib/sqlalchemy/orm/session.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 849d37ab2..15cd58792 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -1362,6 +1362,7 @@ class Session(_SessionClassMethods, EventTarget): def __init__( self, bind: Optional[_SessionBind] = None, + *, autoflush: bool = True, future: Literal[True] = True, expire_on_commit: bool = True, @@ -4621,9 +4622,35 @@ class sessionmaker(_SessionClassMethods, Generic[_S]): class_: Type[_S] + @overload + def __init__( + self, + bind: Optional[_SessionBind] = ..., + *, + class_: Type[_S], + autoflush: bool = ..., + expire_on_commit: bool = ..., + info: Optional[_InfoType] = ..., + **kw: Any, + ): + ... + + @overload + def __init__( + self: "sessionmaker[Session]", + bind: Optional[_SessionBind] = ..., + *, + autoflush: bool = ..., + expire_on_commit: bool = ..., + info: Optional[_InfoType] = ..., + **kw: Any, + ): + ... + def __init__( self, bind: Optional[_SessionBind] = None, + *, class_: Type[_S] = Session, # type: ignore autoflush: bool = True, expire_on_commit: bool = True, |