UniqueConstraint

class lsst.dax.apdb.schema_model.UniqueConstraint(name: str | None, id: str, deferrable: bool = False, initially: str | None = None, description: str | None = None, annotations: ~collections.abc.Mapping[str, ~typing.Any] = <factory>, columns: list[lsst.dax.apdb.schema_model.Column] = <factory>)

Bases: Constraint

Description of unique constraint.

Attributes Summary

deferrable

If True then this constraint will be declared as deferrable.

description

Constraint description.

initially

Value for INITIALLY clause, only used of deferrable is True.

Methods Summary

from_felis(dm_constr, columns)

Convert Felis constraint definition into instance of this class.

Attributes Documentation

deferrable: bool = False

If True then this constraint will be declared as deferrable.

description: str | None = None

Constraint description.

initially: str | None = None

Value for INITIALLY clause, only used of deferrable is True.

Methods Documentation

classmethod from_felis(dm_constr: Constraint, columns: Mapping[str, Column]) Constraint

Convert Felis constraint definition into instance of this class.

Parameters:
dm_constfelis.datamodel.Constraint

Felis constraint definition.

columnsMapping [str, Column]

Mapping of column ID to Column instance.

Returns:
constraintConstraint

Converted constraint definition.