MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / entity_description

Method entity_description

lib/sqlalchemy/sql/dml.py:924–957  ·  view source on GitHub ↗

Return a :term:`plugin-enabled` description of the table and/or entity which this DML construct is operating against. This attribute is generally useful when using the ORM, as an extended structure which includes information about mapped entities is returned. The se

(self)

Source from the content-addressed store, hash-verified

922
923 @property
924 def entity_description(self) -> Dict[str, Any]:
925 """Return a :term:`plugin-enabled` description of the table and/or
926 entity which this DML construct is operating against.
927
928 This attribute is generally useful when using the ORM, as an
929 extended structure which includes information about mapped
930 entities is returned. The section :ref:`queryguide_inspection`
931 contains more background.
932
933 For a Core statement, the structure returned by this accessor
934 is derived from the :attr:`.UpdateBase.table` attribute, and
935 refers to the :class:`.Table` being inserted, updated, or deleted::
936
937 >>> stmt = insert(user_table)
938 >>> stmt.entity_description
939 {
940 "name": "user_table",
941 "table": Table("user_table", ...)
942 }
943
944 .. versionadded:: 1.4.33
945
946 .. seealso::
947
948 :attr:`.UpdateBase.returning_column_descriptions`
949
950 :attr:`.Select.column_descriptions` - entity information for
951 a :func:`.select` construct
952
953 :ref:`queryguide_inspection` - ORM background
954
955 """
956 meth = DMLState.get_plugin_class(self).get_entity_description
957 return meth(self)
958
959 @property
960 def returning_column_descriptions(self) -> List[Dict[str, Any]]:

Callers

nothing calls this directly

Calls 1

get_plugin_classMethod · 0.45

Tested by

no test coverage detected