Skip to content

Add extra Query method types #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions sqlalchemy-stubs/orm/query.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Optional, Union, TypeVar, Generic, List, Iterator
from typing import Any, Dict, Optional, Union, TypeVar, Generic, List, Iterator
from . import interfaces
from .base import InspectionAttr
from ..sql.selectable import ForUpdateArg, Alias, CTE
from ..sql.selectable import ForUpdateArg, Alias, CTE, Select
from ..sql.elements import Label
from .session import Session

@@ -22,7 +22,7 @@ class Query(Generic[_T]):
def label(self, name: str) -> Label: ...
def as_scalar(self): ...
@property
def selectable(self): ...
def selectable(self) -> Select: ...
def __clause_element__(self): ...
def enable_eagerloads(self: _Q, value: bool) -> _Q: ...
def with_labels(self: _Q) -> _Q: ...
@@ -36,11 +36,11 @@ class Query(Generic[_T]):
def correlate(self, *args): ...
def autoflush(self: _Q, setting: bool) -> _Q: ...
def populate_existing(self: _Q) -> _Q: ...
def with_parent(self, instance, property: Optional[Any] = ...): ...
def with_parent(self: _Q, instance, property: Optional[Any] = ...) -> _Q: ...
def add_entity(self, entity, alias: Optional[Any] = ...): ...
def with_session(self: _Q, session: Optional[Session]) -> _Q: ...
def from_self(self, *entities): ...
def values(self, *columns): ...
def from_self(self: _Q, *entities) -> _Q: ...
def values(self, *columns) -> Iterator[_T]: ...
def value(self, column): ...
def with_entities(self, *entities): ...
def add_columns(self, *column): ...
@@ -61,37 +61,37 @@ class Query(Generic[_T]):
def having(self: _Q, criterion) -> _Q: ...
def union(self, *q): ...
def union_all(self, *q): ...
def intersect(self, *q): ...
def intersect_all(self, *q): ...
def except_(self, *q): ...
def except_all(self, *q): ...
def join(self, *props, **kwargs): ...
def outerjoin(self, *props, **kwargs): ...
def reset_joinpoint(self): ...
def select_from(self, *from_obj): ...
def select_entity_from(self, from_obj): ...
def intersect(self: _Q, *q) -> _Q: ...
def intersect_all(self: _Q, *q) -> _Q: ...
def except_(self: _Q, *q): ...
def except_all(self: _Q, *q) -> _Q: ...
def join(self: _Q, *props, **kwargs) -> _Q: ...
def outerjoin(self: _Q, *props, **kwargs) -> _Q: ...
def reset_joinpoint(self: _Q) -> _Q: ...
def select_from(self: _Q, *from_obj) -> _Q: ...
def select_entity_from(self: _Q, from_obj) -> _Q: ...
def __getitem__(self, item): ...
def slice(self: _Q, start: Optional[int], stop: Optional[int]) -> _Q: ...
def limit(self: _Q, limit: Optional[int]) -> _Q: ...
def offset(self: _Q, offset: Optional[int]) -> _Q: ...
def distinct(self, *criterion): ...
def prefix_with(self, *prefixes): ...
def suffix_with(self, *suffixes): ...
def distinct(self: _Q, *criterion) -> _Q: ...
def prefix_with(self: _Q, *prefixes) -> _Q: ...
def suffix_with(self: _Q, *suffixes) -> _Q: ...
def all(self) -> List[_T]: ...
def from_statement(self, statement): ...
def from_statement(self: _Q, statement) -> _Q: ...
def first(self) -> Optional[_T]: ...
def one_or_none(self) -> Optional[_T]: ...
def one(self) -> _T: ...
def scalar(self): ...
def __iter__(self) -> Iterator[_T]: ...
@property
def column_descriptions(self): ...
def column_descriptions(self) -> List[Dict[str, Any]]: ...
def instances(self, cursor, __context: Optional[Any] = ...): ...
def merge_result(self, iterator, load: bool = ...): ...
def exists(self): ...
def count(self) -> int: ...
def delete(self, synchronize_session: Union[bool, str] = ...) -> int: ...
def update(self, values, synchronize_session: Union[bool, str] = ..., update_args: Optional[Any] = ...): ...
def update(self, values, synchronize_session: Union[bool, str] = ..., update_args: Optional[Any] = ...) -> int: ...

class LockmodeArg(ForUpdateArg):
@classmethod