ForeignKeySpec#

class lsst.daf.butler.ddl.ForeignKeySpec(table: str, source: tuple[str, ...], target: tuple[str, ...], onDelete: str | None = None, addIndex: bool = True)#

Bases: object

Definition of a foreign key constraint in a logical Registry table.

Attributes Summary

addIndex

If True, create an index on the columns of this foreign key in the source table.

onDelete

SQL clause indicating how to handle deletes to the target table.

source

Tuple of source table column names.

table

Name of the target table.

target

Tuple of target table column names.

Methods Summary

fromConfig(config, *args, **kwargs)

Attributes Documentation

addIndex: bool = True#

If True, create an index on the columns of this foreign key in the source table.

onDelete: str | None = None#

SQL clause indicating how to handle deletes to the target table.

If not None (which indicates that a constraint violation exception should be raised), should be either “SET NULL” or “CASCADE”.

source: tuple[str, ...] = <dataclasses._MISSING_TYPE object>#

Tuple of source table column names.

table: str = <dataclasses._MISSING_TYPE object>#

Name of the target table.

target: tuple[str, ...] = <dataclasses._MISSING_TYPE object>#

Tuple of target table column names.

Methods Documentation

classmethod fromConfig(config: Config, *args: Any, **kwargs: Any) Any#