TableSpec#
- class lsst.daf.butler.ddl.TableSpec(fields: Iterable[FieldSpec], *, unique: Iterable[tuple[str, ...]] = (), indexes: Iterable[IndexSpec] = (), foreignKeys: Iterable[ForeignKeySpec] = (), exclusion: Iterable[tuple[str | type[TimespanDatabaseRepresentation], ...]] = (), recycleIds: bool = True, doc: str | None = None)#
Bases:
objectA data class used to define a table or table-like query interface.
Parameters#
- fields
Iterable[FieldSpec] Specifications for the columns in this table.
- unique
Iterable[tuple[str] ], optional Non-primary-key unique constraints for the table.
- indexes
Iterable[IndexSpec], optional Indexes for the table.
- foreignKeys
Iterable[ForeignKeySpec], optional Foreign key constraints for the table.
- exclusion
Iterable[tuple[strortype] ] Special constraints that prohibit overlaps between timespans over rows where other columns are equal. These take the same form as unique constraints, but each tuple may contain a single
TimespanDatabaseRepresentationsubclass representing a timespan column.- recycleIds
bool, optional If
True, allow databases that might normally recycle autoincrement IDs to do so (usually better for performance) on any autoincrement field in this table.- doc
str, optional Documentation for the table.
Attributes Summary
Documentation for the table.
Exclusion constraints for the table.
Specifications for the columns in this table.
Foreign key constraints for the table.
Indexes for the table.
If
True, allow databases that might normally recycle autoincrement IDs to do so (usually better for performance) on any autoincrement field in this table.Non-primary-key unique constraints for the table.
Methods Summary
fromConfig(config, *args, **kwargs)Attributes Documentation
- doc: str | None = None#
Documentation for the table.
- exclusion: set[tuple[str | type[TimespanDatabaseRepresentation], ...]] = <dataclasses._MISSING_TYPE object>#
Exclusion constraints for the table.
Exclusion constraints behave mostly like unique constraints, but may contain a database-native Timespan column that is restricted to not overlap across rows (for identical combinations of any non-Timespan columns in the constraint).
- fields: NamedValueSet[FieldSpec] = <dataclasses._MISSING_TYPE object>#
Specifications for the columns in this table.
- foreignKeys: list[ForeignKeySpec] = <dataclasses._MISSING_TYPE object>#
Foreign key constraints for the table.
- recycleIds: bool = True#
If
True, allow databases that might normally recycle autoincrement IDs to do so (usually better for performance) on any autoincrement field in this table.
- unique: set[tuple[str, ...]] = <dataclasses._MISSING_TYPE object>#
Non-primary-key unique constraints for the table.
Methods Documentation
- fields