MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / entity_description

Method entity_description

lib/sqlalchemy/sql/dml.py:906–939  ·  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

904
905 @property
906 def entity_description(self) -> Dict[str, Any]:
907 """Return a :term:`plugin-enabled` description of the table and/or
908 entity which this DML construct is operating against.
909
910 This attribute is generally useful when using the ORM, as an
911 extended structure which includes information about mapped
912 entities is returned. The section :ref:`queryguide_inspection`
913 contains more background.
914
915 For a Core statement, the structure returned by this accessor
916 is derived from the :attr:`.UpdateBase.table` attribute, and
917 refers to the :class:`.Table` being inserted, updated, or deleted::
918
919 >>> stmt = insert(user_table)
920 >>> stmt.entity_description
921 {
922 "name": "user_table",
923 "table": Table("user_table", ...)
924 }
925
926 .. versionadded:: 1.4.33
927
928 .. seealso::
929
930 :attr:`.UpdateBase.returning_column_descriptions`
931
932 :attr:`.Select.column_descriptions` - entity information for
933 a :func:`.select` construct
934
935 :ref:`queryguide_inspection` - ORM background
936
937 """
938 meth = DMLState.get_plugin_class(self).get_entity_description
939 return meth(self)
940
941 @property
942 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