|
1 | 1 | from typing import Any
|
| 2 | +from typing import Collection |
| 3 | +from typing import Dict |
| 4 | +from typing import List |
2 | 5 | from typing import Optional
|
| 6 | +from typing import Set |
| 7 | +from typing import Tuple |
| 8 | +from typing import Type |
| 9 | +from typing import TypeVar |
3 | 10 |
|
4 |
| -from .base import Connectable as Connectable |
5 |
| -from .base import Connection as Connection |
6 |
| -from .base import Engine as Engine |
7 |
| -from .. import exc as exc |
8 |
| -from .. import inspection as inspection |
9 |
| -from .. import sql as sql |
10 |
| -from .. import util as util |
11 |
| -from ..sql import operators as operators |
12 |
| -from ..sql.type_api import TypeEngine as TypeEngine |
13 |
| -from ..util import topological as topological |
| 11 | +from .base import Connectable |
| 12 | +from ..sql.schema import Table |
14 | 13 |
|
15 |
| -def cache(fn: Any, self: Any, con: Any, *args: Any, **kw: Any): ... |
| 14 | +_TInspector = TypeVar("_TInspector", bound=Inspector) |
| 15 | + |
| 16 | +def cache(fn: Any, self: Any, con: Any, *args: Any, **kw: Any) -> Any: ... |
16 | 17 |
|
17 | 18 | class Inspector:
|
18 |
| - def __init__(self, bind: Any): ... |
| 19 | + def __init__(self, bind: Connectable): ... |
19 | 20 | @classmethod
|
20 |
| - def from_engine(cls, bind: Any): ... |
| 21 | + def from_engine( |
| 22 | + cls: Type[_TInspector], bind: Connectable |
| 23 | + ) -> _TInspector: ... |
21 | 24 | @property
|
22 |
| - def default_schema_name(self): ... |
23 |
| - def get_schema_names(self): ... |
24 |
| - def get_table_names(self, schema: Optional[Any] = ...): ... |
25 |
| - def has_table(self, table_name: Any, schema: Optional[Any] = ...): ... |
| 25 | + def default_schema_name(self) -> str: ... |
| 26 | + def get_schema_names(self) -> List[str]: ... |
| 27 | + def get_table_names(self, schema: Optional[str] = ...) -> List[str]: ... |
| 28 | + def has_table( |
| 29 | + self, table_name: str, schema: Optional[str] = ... |
| 30 | + ) -> bool: ... |
26 | 31 | def has_sequence(
|
27 |
| - self, sequence_name: Any, schema: Optional[Any] = ... |
28 |
| - ): ... |
29 |
| - def get_sorted_table_and_fkc_names(self, schema: Optional[Any] = ...): ... |
30 |
| - def get_temp_table_names(self): ... |
31 |
| - def get_temp_view_names(self): ... |
| 32 | + self, sequence_name: str, schema: Optional[str] = ... |
| 33 | + ) -> bool: ... |
| 34 | + def get_sorted_table_and_fkc_names( |
| 35 | + self, schema: Optional[str] = ... |
| 36 | + ) -> List[Tuple[Optional[str], List[Tuple[str, str]]]]: ... |
| 37 | + def get_temp_table_names(self) -> List[str]: ... |
| 38 | + def get_temp_view_names(self) -> List[str]: ... |
32 | 39 | def get_table_options(
|
33 |
| - self, table_name: Any, schema: Optional[Any] = ..., **kw: Any |
34 |
| - ): ... |
35 |
| - def get_view_names(self, schema: Optional[Any] = ...): ... |
36 |
| - def get_sequence_names(self, schema: Optional[Any] = ...): ... |
| 40 | + self, table_name: str, schema: Optional[str] = ..., **kw: Any |
| 41 | + ) -> Dict[str, Any]: ... |
| 42 | + def get_view_names(self, schema: Optional[str] = ...) -> List[str]: ... |
| 43 | + def get_sequence_names(self, schema: Optional[str] = ...) -> List[str]: ... |
37 | 44 | def get_view_definition(
|
38 |
| - self, view_name: Any, schema: Optional[Any] = ... |
39 |
| - ): ... |
| 45 | + self, view_name: str, schema: Optional[str] = ... |
| 46 | + ) -> Any: ... |
40 | 47 | def get_columns(
|
41 |
| - self, table_name: Any, schema: Optional[Any] = ..., **kw: Any |
42 |
| - ): ... |
| 48 | + self, table_name: str, schema: Optional[str] = ..., **kw: Any |
| 49 | + ) -> List[Dict[str, Any]]: ... |
43 | 50 | def get_pk_constraint(
|
44 |
| - self, table_name: Any, schema: Optional[Any] = ..., **kw: Any |
45 |
| - ): ... |
| 51 | + self, table_name: str, schema: Optional[str] = ..., **kw: Any |
| 52 | + ) -> Dict[str, Any]: ... |
46 | 53 | def get_foreign_keys(
|
47 |
| - self, table_name: Any, schema: Optional[Any] = ..., **kw: Any |
48 |
| - ): ... |
| 54 | + self, table_name: str, schema: Optional[str] = ..., **kw: Any |
| 55 | + ) -> List[Dict[str, Any]]: ... |
49 | 56 | def get_indexes(
|
50 |
| - self, table_name: Any, schema: Optional[Any] = ..., **kw: Any |
51 |
| - ): ... |
| 57 | + self, table_name: str, schema: Optional[str] = ..., **kw: Any |
| 58 | + ) -> List[Dict[str, Any]]: ... |
52 | 59 | def get_unique_constraints(
|
53 |
| - self, table_name: Any, schema: Optional[Any] = ..., **kw: Any |
54 |
| - ): ... |
| 60 | + self, table_name: str, schema: Optional[str] = ..., **kw: Any |
| 61 | + ) -> List[Dict[str, Any]]: ... |
55 | 62 | def get_table_comment(
|
56 |
| - self, table_name: Any, schema: Optional[Any] = ..., **kw: Any |
57 |
| - ): ... |
| 63 | + self, table_name: str, schema: Optional[str] = ..., **kw: Any |
| 64 | + ) -> Dict[str, Any]: ... |
58 | 65 | def get_check_constraints(
|
59 |
| - self, table_name: Any, schema: Optional[Any] = ..., **kw: Any |
60 |
| - ): ... |
61 |
| - def reflecttable(self, *args: Any, **kwargs: Any): ... |
| 66 | + self, table_name: str, schema: Optional[str] = ..., **kw: Any |
| 67 | + ) -> List[Dict[str, Any]]: ... |
| 68 | + def reflecttable( |
| 69 | + self, |
| 70 | + table: Table, |
| 71 | + include_columns: Collection[str], |
| 72 | + exclude_columns: Collection[str] = ..., |
| 73 | + resolve_fks: bool = ..., |
| 74 | + _extend_on: Set[Table] = ..., |
| 75 | + ) -> None: ... |
62 | 76 | def reflect_table(
|
63 | 77 | self,
|
64 |
| - table: Any, |
65 |
| - include_columns: Any, |
66 |
| - exclude_columns: Any = ..., |
| 78 | + table: Table, |
| 79 | + include_columns: Collection[str], |
| 80 | + exclude_columns: Collection[str] = ..., |
67 | 81 | resolve_fks: bool = ...,
|
68 |
| - _extend_on: Optional[Any] = ..., |
| 82 | + _extend_on: Set[Table] = ..., |
69 | 83 | ) -> None: ...
|
0 commit comments