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: object

A data class used to define a table or table-like query interface.

Parameters:
fieldsIterable [ FieldSpec ]

Specifications for the columns in this table.

uniqueIterable [ tuple [ str ] ], optional

Non-primary-key unique constraints for the table.

indexesIterable [ IndexSpec ], optional

Indexes for the table.

foreignKeysIterable [ ForeignKeySpec ], optional

Foreign key constraints for the table.

exclusionIterable [ tuple [ str or type ] ]

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 TimespanDatabaseRepresentation subclass representing a timespan column.

recycleIdsbool, 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.

docstr, optional

Documentation for the table.

Attributes Summary

doc

Documentation for the table.

recycleIds

If True, allow databases that might normally recycle autoincrement IDs to do so (usually better for performance) on any autoincrement field in this table.

Methods Summary

fromConfig(config, *args, **kwargs)

Attributes Documentation

doc: str | None = None

Documentation 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.

Methods Documentation

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