Skip to content

type_bridge.migration.ref

ref

Stable schema-label references for generated migration source.

Active application model classes can disappear when bindgen regenerates a package after a schema deletion. Migration refs are the historical authoring surface for generated migrations: they carry only the TypeDB label needed to review or remove schema objects, while sidecars carry full executable payloads for schema-bearing add operations.

EntityRef dataclass

EntityRef(label, kind='entity')

Historical reference to an entity type label.

RelationRef dataclass

RelationRef(label, kind='relation')

Historical reference to a relation type label.

AttributeRef dataclass

AttributeRef(label, kind='attribute')

Historical reference to an attribute type label.

entity

entity(label)

Return a stable migration reference to an entity label.

Source code in type_bridge/migration/ref.py
def entity(label: str) -> EntityRef:
    """Return a stable migration reference to an entity label."""
    return EntityRef(label)

relation

relation(label)

Return a stable migration reference to a relation label.

Source code in type_bridge/migration/ref.py
def relation(label: str) -> RelationRef:
    """Return a stable migration reference to a relation label."""
    return RelationRef(label)

attribute

attribute(label)

Return a stable migration reference to an attribute label.

Source code in type_bridge/migration/ref.py
def attribute(label: str) -> AttributeRef:
    """Return a stable migration reference to an attribute label."""
    return AttributeRef(label)