mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
SQLAlchemy: Fix annotations for Query.{update,delete} (#8388)
Closes: #8387
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
from typing import Any
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
from ..sql.base import CompileState, Options
|
||||
from ..sql.dml import DeleteDMLState, UpdateDMLState
|
||||
|
||||
_SynchronizeSessionArgument: TypeAlias = Literal[False, "evaluate", "fetch"]
|
||||
|
||||
def save_obj(base_mapper, states, uowtransaction, single: bool = ...) -> None: ...
|
||||
def post_update(base_mapper, states, uowtransaction, post_update_cols) -> None: ...
|
||||
def delete_obj(base_mapper, states, uowtransaction) -> None: ...
|
||||
|
||||
@@ -7,6 +7,7 @@ from ..sql.base import Executable
|
||||
from ..sql.selectable import GroupedElement, HasHints, HasPrefixes, HasSuffixes, SelectBase, _SelectFromElements
|
||||
from . import interfaces
|
||||
from .context import QueryContext as QueryContext
|
||||
from .persistence import _SynchronizeSessionArgument
|
||||
from .util import aliased as aliased
|
||||
|
||||
__all__ = ["Query", "QueryContext", "aliased"]
|
||||
@@ -100,8 +101,8 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi
|
||||
def merge_result(self, iterator, load: bool = ...): ...
|
||||
def exists(self): ...
|
||||
def count(self) -> int: ...
|
||||
def delete(self, synchronize_session: str = ...) -> int: ...
|
||||
def update(self, values, synchronize_session: str = ..., update_args: Any | None = ...): ...
|
||||
def delete(self, synchronize_session: _SynchronizeSessionArgument = ...) -> int: ...
|
||||
def update(self, values, synchronize_session: _SynchronizeSessionArgument = ..., update_args: Any | None = ...): ...
|
||||
|
||||
class FromStatement(GroupedElement, SelectBase, Executable):
|
||||
__visit_name__: str
|
||||
|
||||
Reference in New Issue
Block a user