Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé
Module « sqlalchemy »

Classe « Inspector »

Informations générales

Héritage

builtins.object
    Generic
        Inspectable
            Inspector

Définition

class Inspector(Inspectable):

help(Inspector)

Performs database schema inspection.

The Inspector acts as a proxy to the reflection methods of the
:class:`~sqlalchemy.engine.interfaces.Dialect`, providing a
consistent interface as well as caching support for previously
fetched metadata.

A :class:`_reflection.Inspector` object is usually created via the
:func:`_sa.inspect` function, which may be passed an
:class:`_engine.Engine`
or a :class:`_engine.Connection`::

    from sqlalchemy import inspect, create_engine

    engine = create_engine("...")
    insp = inspect(engine)

Where above, the :class:`~sqlalchemy.engine.interfaces.Dialect` associated
with the engine may opt to return an :class:`_reflection.Inspector`
subclass that
provides additional methods specific to the dialect's target database.

Constructeur(s)

Signature du constructeur Description
__init__(self, bind: 'Union[Engine, Connection]') Initialize a new :class:`_reflection.Inspector`. [extrait de __init__.__doc__]

Liste des propriétés

Nom de la propriétéDescription
default_schema_nameReturn the default schema name presented by the dialect [extrait de default_schema_name.__doc__]

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__class_getitem__ Parameterizes a generic class. [extrait de __class_getitem__.__doc__]
clear_cache(self) -> 'None' reset the cache for this :class:`.Inspector`. [extrait de clear_cache.__doc__]
from_engine(bind: 'Engine') -> 'Inspector' Construct a new dialect-specific Inspector object from the given [extrait de from_engine.__doc__]
get_check_constraints(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[ReflectedCheckConstraint]' Return information about check constraints in ``table_name``. [extrait de get_check_constraints.__doc__]
get_columns(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[ReflectedColumn]' Return information about columns in ``table_name``. [extrait de get_columns.__doc__]
get_foreign_keys(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[ReflectedForeignKeyConstraint]' Return information about foreign_keys in ``table_name``. [extrait de get_foreign_keys.__doc__]
get_indexes(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[ReflectedIndex]' Return information about indexes in ``table_name``. [extrait de get_indexes.__doc__]
get_materialized_view_names(self, schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[str]' Return all materialized view names in `schema`. [extrait de get_materialized_view_names.__doc__]
get_multi_check_constraints(self, schema: 'Optional[str]' = None, filter_names: 'Optional[Sequence[str]]' = None, kind: 'ObjectKind' = <ObjectKind.TABLE: 1>, scope: 'ObjectScope' = <ObjectScope.DEFAULT: 1>, **kw: 'Any') -> 'Dict[TableKey, List[ReflectedCheckConstraint]]' Return information about check constraints in all tables [extrait de get_multi_check_constraints.__doc__]
get_multi_columns(self, schema: 'Optional[str]' = None, filter_names: 'Optional[Sequence[str]]' = None, kind: 'ObjectKind' = <ObjectKind.TABLE: 1>, scope: 'ObjectScope' = <ObjectScope.DEFAULT: 1>, **kw: 'Any') -> 'Dict[TableKey, List[ReflectedColumn]]' Return information about columns in all objects in the given [extrait de get_multi_columns.__doc__]
get_multi_foreign_keys(self, schema: 'Optional[str]' = None, filter_names: 'Optional[Sequence[str]]' = None, kind: 'ObjectKind' = <ObjectKind.TABLE: 1>, scope: 'ObjectScope' = <ObjectScope.DEFAULT: 1>, **kw: 'Any') -> 'Dict[TableKey, List[ReflectedForeignKeyConstraint]]' Return information about foreign_keys in all tables [extrait de get_multi_foreign_keys.__doc__]
get_multi_indexes(self, schema: 'Optional[str]' = None, filter_names: 'Optional[Sequence[str]]' = None, kind: 'ObjectKind' = <ObjectKind.TABLE: 1>, scope: 'ObjectScope' = <ObjectScope.DEFAULT: 1>, **kw: 'Any') -> 'Dict[TableKey, List[ReflectedIndex]]' Return information about indexes in in all objects [extrait de get_multi_indexes.__doc__]
get_multi_pk_constraint(self, schema: 'Optional[str]' = None, filter_names: 'Optional[Sequence[str]]' = None, kind: 'ObjectKind' = <ObjectKind.TABLE: 1>, scope: 'ObjectScope' = <ObjectScope.DEFAULT: 1>, **kw: 'Any') -> 'Dict[TableKey, ReflectedPrimaryKeyConstraint]' Return information about primary key constraints in [extrait de get_multi_pk_constraint.__doc__]
get_multi_table_comment(self, schema: 'Optional[str]' = None, filter_names: 'Optional[Sequence[str]]' = None, kind: 'ObjectKind' = <ObjectKind.TABLE: 1>, scope: 'ObjectScope' = <ObjectScope.DEFAULT: 1>, **kw: 'Any') -> 'Dict[TableKey, ReflectedTableComment]' Return information about the table comment in all objects [extrait de get_multi_table_comment.__doc__]
get_multi_table_options(self, schema: 'Optional[str]' = None, filter_names: 'Optional[Sequence[str]]' = None, kind: 'ObjectKind' = <ObjectKind.TABLE: 1>, scope: 'ObjectScope' = <ObjectScope.DEFAULT: 1>, **kw: 'Any') -> 'Dict[TableKey, Dict[str, Any]]' Return a dictionary of options specified when the tables in the [extrait de get_multi_table_options.__doc__]
get_multi_unique_constraints(self, schema: 'Optional[str]' = None, filter_names: 'Optional[Sequence[str]]' = None, kind: 'ObjectKind' = <ObjectKind.TABLE: 1>, scope: 'ObjectScope' = <ObjectScope.DEFAULT: 1>, **kw: 'Any') -> 'Dict[TableKey, List[ReflectedUniqueConstraint]]' Return information about unique constraints in all tables [extrait de get_multi_unique_constraints.__doc__]
get_pk_constraint(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'ReflectedPrimaryKeyConstraint' Return information about primary key constraint in ``table_name``. [extrait de get_pk_constraint.__doc__]
get_schema_names(self, **kw: 'Any') -> 'List[str]' Return all schema names. [extrait de get_schema_names.__doc__]
get_sequence_names(self, schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[str]' Return all sequence names in `schema`. [extrait de get_sequence_names.__doc__]
get_sorted_table_and_fkc_names(self, schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[Tuple[Optional[str], List[Tuple[str, Optional[str]]]]]' Return dependency-sorted table and foreign key constraint names in [extrait de get_sorted_table_and_fkc_names.__doc__]
get_table_comment(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'ReflectedTableComment' Return information about the table comment for ``table_name``. [extrait de get_table_comment.__doc__]
get_table_names(self, schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[str]' Return all table names within a particular schema. [extrait de get_table_names.__doc__]
get_table_options(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'Dict[str, Any]' Return a dictionary of options specified when the table of the [extrait de get_table_options.__doc__]
get_temp_table_names(self, **kw: 'Any') -> 'List[str]' Return a list of temporary table names for the current bind. [extrait de get_temp_table_names.__doc__]
get_temp_view_names(self, **kw: 'Any') -> 'List[str]' Return a list of temporary view names for the current bind. [extrait de get_temp_view_names.__doc__]
get_unique_constraints(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[ReflectedUniqueConstraint]' Return information about unique constraints in ``table_name``. [extrait de get_unique_constraints.__doc__]
get_view_definition(self, view_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'str' Return definition for the plain or materialized view called [extrait de get_view_definition.__doc__]
get_view_names(self, schema: 'Optional[str]' = None, **kw: 'Any') -> 'List[str]' Return all non-materialized view names in `schema`. [extrait de get_view_names.__doc__]
has_index(self, table_name: 'str', index_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'bool' Check the existence of a particular index name in the database. [extrait de has_index.__doc__]
has_schema(self, schema_name: 'str', **kw: 'Any') -> 'bool' Return True if the backend has a schema with the given name. [extrait de has_schema.__doc__]
has_sequence(self, sequence_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'bool' Return True if the backend has a sequence with the given name. [extrait de has_sequence.__doc__]
has_table(self, table_name: 'str', schema: 'Optional[str]' = None, **kw: 'Any') -> 'bool' Return True if the backend has a table, view, or temporary [extrait de has_table.__doc__]
reflect_table(self, table: 'sa_schema.Table', include_columns: 'Optional[Collection[str]]', exclude_columns: 'Collection[str]' = (), resolve_fks: 'bool' = True, _extend_on: 'Optional[Set[sa_schema.Table]]' = None, _reflect_info: 'Optional[_ReflectionInfo]' = None) -> 'None' Given a :class:`_schema.Table` object, load its internal [extrait de reflect_table.__doc__]
sort_tables_on_foreign_key_dependency(self, consider_schemas: 'Collection[Optional[str]]' = (None,), **kw: 'Any') -> 'List[Tuple[Optional[Tuple[Optional[str], str]], List[Tuple[Tuple[Optional[str], str], Optional[str]]]]]' Return dependency-sorted table and foreign key constraint names [extrait de sort_tables_on_foreign_key_dependency.__doc__]

Méthodes héritées de la classe Inspectable

__init_subclass__, __subclasshook__

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__

Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé