Skip to main content

schema

SQLAlchemy ORM for the schema_versions cache table (v1).

Each version package declares its own local Base (its own MetaData) so that multiple versions of the same table can coexist in one process without a __tablename__ collision. Base carries the shared nullable tags column and every ORM in this version inherits it directly.

Adding a column to a new version is an additive migration (see migrations.py): add a nullable mapped_column in the new version's schema and a corresponding upgrade step — never rename/drop/retype in place.

Classes

Base

class Base(**kwargs: Any):

Local declarative base for schema_versions v1.

Owns an isolated MetaData (so it never collides with another version of this table) and carries the shared nullable tags JSON column that every ORM in this version inherits.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.

Subclasses

Variables

  • static metadata
  • static registry
  • static tags : sqlalchemy.orm.base.Mapped[dict[str, typing.Any] | None]

SchemaVersion

class SchemaVersion(**kwargs):

SQLAlchemy model for the schema_versions cache table.

Stores pipeline schema version snapshots for each task hash. Multiple rows per task hash are allowed — each store call creates a distinct row identified by (task_hash, created_at).

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.

Variables

  • created_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • pipeline_version : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • run_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • schema_data : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • tags : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • task_hash : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]