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

Method primary_key

lib/sqlalchemy/sql/selectable.py:955–965  ·  view source on GitHub ↗

Return the iterable collection of :class:`_schema.Column` objects which comprise the primary key of this :class:`_selectable.FromClause`. For a :class:`_schema.Table` object, this collection is represented by the :class:`_schema.PrimaryKeyConstraint` which itself is an

(self)

Source from the content-addressed store, hash-verified

953
954 @util.ro_memoized_property
955 def primary_key(self) -> Iterable[NamedColumn[Any]]:
956 """Return the iterable collection of :class:`_schema.Column` objects
957 which comprise the primary key of this :class:`_selectable.FromClause`.
958
959 For a :class:`_schema.Table` object, this collection is represented
960 by the :class:`_schema.PrimaryKeyConstraint` which itself is an
961 iterable collection of :class:`_schema.Column` objects.
962
963 """
964 self._setup_collections()
965 return self.primary_key
966
967 @util.ro_memoized_property
968 def foreign_keys(self) -> Iterable[ForeignKey]:

Callers

nothing calls this directly

Calls 1

_setup_collectionsMethod · 0.95

Tested by

no test coverage detected