MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / primary_key

Method primary_key

lib/sqlalchemy/sql/selectable.py:986–996  ·  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

984
985 @util.ro_memoized_property
986 def primary_key(self) -> Iterable[NamedColumn[Any]]:
987 """Return the iterable collection of :class:`_schema.Column` objects
988 which comprise the primary key of this :class:`_selectable.FromClause`.
989
990 For a :class:`_schema.Table` object, this collection is represented
991 by the :class:`_schema.PrimaryKeyConstraint` which itself is an
992 iterable collection of :class:`_schema.Column` objects.
993
994 """
995 self._setup_collections()
996 return self.primary_key
997
998 @util.ro_memoized_property
999 def foreign_keys(self) -> Iterable[ForeignKey]:

Callers

nothing calls this directly

Calls 1

_setup_collectionsMethod · 0.95

Tested by

no test coverage detected