|
| 1 | +from typing import AbstractSet |
| 2 | +from typing import Any |
| 3 | +from typing import Callable |
| 4 | +from typing import Literal |
| 5 | +from typing import Mapping |
| 6 | +from typing import MutableMapping |
| 7 | +from typing import Optional |
| 8 | +from typing import overload |
| 9 | +from typing import Sequence |
| 10 | +from typing import Tuple |
| 11 | +from typing import Type |
| 12 | +from typing import TypeVar |
| 13 | +from typing import Union |
| 14 | + |
| 15 | +from sqlalchemy.sql.elements import ColumnElement |
| 16 | +from . import exc as exc |
| 17 | +from . import mapper as mapperlib # noqa |
| 18 | +from .attributes import AttributeEvent as AttributeEvent |
| 19 | +from .attributes import InstrumentedAttribute as InstrumentedAttribute |
| 20 | +from .attributes import Mapped as Mapped |
| 21 | +from .attributes import Mapped |
| 22 | +from .attributes import QueryableAttribute as QueryableAttribute |
| 23 | +from .context import QueryContext as QueryContext |
| 24 | +from .decl_api import as_declarative as as_declarative |
| 25 | +from .decl_api import declarative_base as declarative_base |
| 26 | +from .decl_api import declarative_mixin as declarative_mixin |
| 27 | +from .decl_api import DeclarativeMeta as DeclarativeMeta |
| 28 | +from .decl_api import declared_attr as declared_attr |
| 29 | +from .decl_api import has_inherited_table as has_inherited_table |
| 30 | +from .decl_api import registry as registry |
| 31 | +from .decl_api import synonym_for as synonym_for |
| 32 | +from .descriptor_props import CompositeProperty as CompositeProperty |
| 33 | +from .descriptor_props import SynonymProperty as SynonymProperty |
| 34 | +from .dynamic import AppenderQuery as AppenderQuery |
| 35 | +from .identity import IdentityMap as IdentityMap |
| 36 | +from .instrumentation import ClassManager as ClassManager |
| 37 | +from .interfaces import EXT_CONTINUE as EXT_CONTINUE |
| 38 | +from .interfaces import EXT_SKIP as EXT_SKIP |
| 39 | +from .interfaces import EXT_STOP as EXT_STOP |
| 40 | +from .interfaces import InspectionAttr as InspectionAttr |
| 41 | +from .interfaces import InspectionAttrInfo as InspectionAttrInfo |
| 42 | +from .interfaces import MANYTOMANY as MANYTOMANY |
| 43 | +from .interfaces import MANYTOONE as MANYTOONE |
| 44 | +from .interfaces import MapperProperty as MapperProperty |
| 45 | +from .interfaces import NOT_EXTENSION as NOT_EXTENSION |
| 46 | +from .interfaces import ONETOMANY as ONETOMANY |
| 47 | +from .interfaces import PropComparator as PropComparator |
| 48 | +from .loading import merge_frozen_result as merge_frozen_result |
| 49 | +from .loading import merge_result as merge_result |
| 50 | +from .mapper import class_mapper as class_mapper |
| 51 | +from .mapper import configure_mappers as configure_mappers |
| 52 | +from .mapper import Mapper as Mapper |
| 53 | +from .mapper import reconstructor as reconstructor |
| 54 | +from .mapper import validates as validates |
| 55 | +from .properties import ColumnProperty as ColumnProperty |
| 56 | +from .query import AliasOption as AliasOption |
| 57 | +from .query import FromStatement as FromStatement |
| 58 | +from .query import Query as Query |
| 59 | +from .relationships import _OrderByArgument |
| 60 | +from .relationships import foreign as foreign |
| 61 | +from .relationships import RelationshipProperty as RelationshipProperty |
| 62 | +from .relationships import remote as remote |
| 63 | +from .scoping import scoped_session as scoped_session |
| 64 | +from .session import close_all_sessions as close_all_sessions |
| 65 | +from .session import make_transient as make_transient |
| 66 | +from .session import make_transient_to_detached as make_transient_to_detached |
| 67 | +from .session import object_session as object_session |
| 68 | +from .session import ORMExecuteState as ORMExecuteState |
| 69 | +from .session import Session as Session |
| 70 | +from .session import sessionmaker as sessionmaker |
| 71 | +from .session import SessionTransaction as SessionTransaction |
| 72 | +from .state import AttributeState as AttributeState |
| 73 | +from .state import InstanceState as InstanceState |
| 74 | +from .strategy_options import Load as Load |
| 75 | +from .unitofwork import UOWTransaction as UOWTransaction |
| 76 | +from .util import aliased as aliased |
| 77 | +from .util import Bundle as Bundle |
| 78 | +from .util import CascadeOptions as CascadeOptions |
| 79 | +from .util import join as join |
| 80 | +from .util import LoaderCriteriaOption as LoaderCriteriaOption |
| 81 | +from .util import object_mapper as object_mapper |
| 82 | +from .util import outerjoin as outerjoin |
| 83 | +from .util import polymorphic_union as polymorphic_union |
| 84 | +from .util import was_deleted as was_deleted |
| 85 | +from .util import with_parent as with_parent |
| 86 | +from .util import with_polymorphic as with_polymorphic |
| 87 | +from ..sql import schema |
| 88 | +from ..sql import sqltypes |
| 89 | +from ..sql.schema import _ServerDefaultType |
| 90 | +from ..sql.schema import FetchedValue |
| 91 | +from ..sql.schema import SchemaEventTarget |
| 92 | + |
| 93 | +_T = TypeVar("_T") |
| 94 | + |
| 95 | +_BackrefResult = Tuple[str, Mapping[str, Any]] |
| 96 | + |
| 97 | +class MappedColumn(Mapped[_T]): |
| 98 | + def __init__(self, expr: _T) -> None: ... |
| 99 | + def operate(self, op: Any, *other: Any, **kwargs: Any): ... |
| 100 | + def reverse_operate(self, op: Any, other: Any, **kwargs: Any): ... |
| 101 | + |
| 102 | +@overload |
| 103 | +def column( |
| 104 | + __name: str, |
| 105 | + *args: SchemaEventTarget, |
| 106 | + autoincrement: Union[bool, Literal["auto", "ignore_fk"]] = ..., |
| 107 | + default: Optional[Any] = ..., |
| 108 | + doc: Optional[str] = ..., |
| 109 | + key: Optional[str] = ..., |
| 110 | + index: Optional[bool] = ..., |
| 111 | + info: MutableMapping[Any, Any] = ..., |
| 112 | + nullable: bool = ..., |
| 113 | + onupdate: Optional[Any] = ..., |
| 114 | + primary_key: bool = ..., |
| 115 | + server_default: Optional[_ServerDefaultType[Any]] = ..., |
| 116 | + server_onupdate: Optional[FetchedValue] = ..., |
| 117 | + quote: Optional[bool] = ..., |
| 118 | + unique: Optional[bool] = ..., |
| 119 | + system: bool = ..., |
| 120 | + comment: Optional[str] = ..., |
| 121 | + **kwargs: Any, |
| 122 | +) -> Mapped[Any]: ... |
| 123 | +@overload |
| 124 | +def column( |
| 125 | + *args: SchemaEventTarget, |
| 126 | + autoincrement: Union[bool, Literal["auto", "ignore_fk"]] = ..., |
| 127 | + default: Optional[Any] = ..., |
| 128 | + doc: Optional[str] = ..., |
| 129 | + key: Optional[str] = ..., |
| 130 | + index: Optional[bool] = ..., |
| 131 | + info: MutableMapping[Any, Any] = ..., |
| 132 | + nullable: bool = ..., |
| 133 | + onupdate: Optional[Any] = ..., |
| 134 | + primary_key: bool = ..., |
| 135 | + server_default: Optional[_ServerDefaultType[Any]] = ..., |
| 136 | + server_onupdate: Optional[FetchedValue] = ..., |
| 137 | + quote: Optional[bool] = ..., |
| 138 | + unique: Optional[bool] = ..., |
| 139 | + system: bool = ..., |
| 140 | + comment: Optional[str] = ..., |
| 141 | + **kwargs: Any, |
| 142 | +) -> Mapped[Any]: ... |
| 143 | +@overload |
| 144 | +def column( |
| 145 | + __name: str, |
| 146 | + _type: Union[sqltypes.TypeEngine[_T], Type[sqltypes.TypeEngine[_T]]], |
| 147 | + *args: SchemaEventTarget, |
| 148 | + autoincrement: Union[bool, Literal["auto", "ignore_fk"]] = ..., |
| 149 | + default: Optional[Any] = ..., |
| 150 | + doc: Optional[str] = ..., |
| 151 | + key: Optional[str] = ..., |
| 152 | + index: Optional[bool] = ..., |
| 153 | + info: MutableMapping[Any, Any] = ..., |
| 154 | + nullable: bool = ..., |
| 155 | + onupdate: Optional[Any] = ..., |
| 156 | + primary_key: bool = ..., |
| 157 | + server_default: Optional[_ServerDefaultType[schema._TE]] = ..., |
| 158 | + server_onupdate: Optional[FetchedValue] = ..., |
| 159 | + quote: Optional[bool] = ..., |
| 160 | + unique: Optional[bool] = ..., |
| 161 | + system: bool = ..., |
| 162 | + comment: Optional[str] = ..., |
| 163 | + **kwargs: Any, |
| 164 | +) -> Mapped[_T]: ... |
| 165 | +@overload |
| 166 | +def column( |
| 167 | + _type: Union[sqltypes.TypeEngine[_T], Type[sqltypes.TypeEngine[_T]]], |
| 168 | + *args: SchemaEventTarget, |
| 169 | + autoincrement: Union[bool, Literal["auto", "ignore_fk"]] = ..., |
| 170 | + default: Optional[Any] = ..., |
| 171 | + doc: Optional[str] = ..., |
| 172 | + key: Optional[str] = ..., |
| 173 | + index: Optional[bool] = ..., |
| 174 | + info: MutableMapping[Any, Any] = ..., |
| 175 | + nullable: bool = ..., |
| 176 | + onupdate: Optional[Any] = ..., |
| 177 | + primary_key: bool = ..., |
| 178 | + server_default: Optional[_ServerDefaultType[schema._TE]] = ..., |
| 179 | + server_onupdate: Optional[FetchedValue] = ..., |
| 180 | + quote: Optional[bool] = ..., |
| 181 | + unique: Optional[bool] = ..., |
| 182 | + system: bool = ..., |
| 183 | + comment: Optional[str] = ..., |
| 184 | + **kwargs: Any, |
| 185 | +) -> Mapped[_T]: ... |
| 186 | +def column_property( |
| 187 | + expr: ColumnElement[sqltypes.TypeEngine[_T]], |
| 188 | + *addl: ColumnElement[Any], |
| 189 | + **kw: Any, |
| 190 | +) -> Mapped[_T]: ... |
| 191 | +def composite(cls: _T, *arg: Any, **kw: Any) -> Mapped[_T]: ... |
| 192 | +def deferred( |
| 193 | + expr: ColumnElement[sqltypes.TypeEngine[_T]], |
| 194 | + *addl: ColumnElement[Any], |
| 195 | + **kw: Any, |
| 196 | +) -> Mapped[_T]: ... |
| 197 | +def query_expression( |
| 198 | + typ: sqltypes.TypeEngine[_T], default_expr: Any = ... |
| 199 | +) -> Mapped[_T]: ... |
| 200 | +def synonym(*arg, **kw) -> Any: ... |
| 201 | +def related( |
| 202 | + entity: Optional[_T] = ..., |
| 203 | + secondary: Optional[Any] = ..., |
| 204 | + primaryjoin: Optional[Any] = ..., |
| 205 | + secondaryjoin: Optional[Any] = ..., |
| 206 | + foreign_keys: Optional[Any] = ..., |
| 207 | + uselist: Optional[bool] = ..., |
| 208 | + order_by: _OrderByArgument = ..., |
| 209 | + backref: Union[str, _BackrefResult] = ..., |
| 210 | + back_populates: str = ..., |
| 211 | + overlaps: Union[AbstractSet[str], str] = ..., |
| 212 | + post_update: bool = ..., |
| 213 | + cascade: Union[Literal[False], Sequence[str]] = ..., |
| 214 | + viewonly: bool = ..., |
| 215 | + lazy: str = ..., |
| 216 | + collection_class: Optional[Union[Type[Any], Callable[[], Any]]] = ..., |
| 217 | + passive_deletes: Union[bool, Literal["all"]] = ..., |
| 218 | + passive_updates: bool = ..., |
| 219 | + remote_side: Optional[Any] = ..., |
| 220 | + enable_typechecks: bool = ..., # NOTE: not documented |
| 221 | + join_depth: Optional[int] = ..., |
| 222 | + comparator_factory: Optional[Any] = ..., |
| 223 | + single_parent: bool = ..., |
| 224 | + innerjoin: Union[bool, str] = ..., |
| 225 | + distinct_target_key: Optional[bool] = ..., |
| 226 | + doc: Optional[str] = ..., |
| 227 | + active_history: bool = ..., |
| 228 | + cascade_backrefs: bool = ..., |
| 229 | + load_on_pending: bool = ..., |
| 230 | + bake_queries: bool = ..., |
| 231 | + _local_remote_pairs: Optional[Any] = ..., |
| 232 | + query_class: Optional[Any] = ..., |
| 233 | + info: Optional[MutableMapping[Any, Any]] = ..., |
| 234 | + omit_join: Optional[Literal[False]] = ..., |
| 235 | + sync_backref: Optional[Any] = ..., |
| 236 | +) -> Mapped[_T]: ... |
0 commit comments