Table#

class lsst.dax.apdb.schema_model.Table(name: str, id: str, columns: list[~lsst.dax.apdb.schema_model.Column], primary_key: list[~lsst.dax.apdb.schema_model.Column], constraints: list[~lsst.dax.apdb.schema_model.Constraint], indexes: list[~lsst.dax.apdb.schema_model.Index], description: str | None = None, annotations: ~collections.abc.Mapping[str, ~typing.Any] = <factory>)#

Bases: object

Description of a single table schema.

Attributes Summary

annotations

Additional annotations for this table.

columns

List of Column instances.

constraints

List of Constraint instances, can be empty.

description

Table description.

id

Felis ID for this table.

indexes

List of Index instances, can be empty.

name

Table name.

primary_key

List of Column that constitute a primary key, may be empty.

Methods Summary

from_felis(dm_table, columns)

Convert Felis table definition into instance of this class.

Attributes Documentation

annotations: Mapping[str, Any] = <dataclasses._MISSING_TYPE object>#

Additional annotations for this table.

columns: list[Column] = <dataclasses._MISSING_TYPE object>#

List of Column instances.

constraints: list[Constraint] = <dataclasses._MISSING_TYPE object>#

List of Constraint instances, can be empty.

description: str | None = None#

Table description.

id: str = <dataclasses._MISSING_TYPE object>#

Felis ID for this table.

indexes: list[Index] = <dataclasses._MISSING_TYPE object>#

List of Index instances, can be empty.

name: str = <dataclasses._MISSING_TYPE object>#

Table name.

primary_key: list[Column] = <dataclasses._MISSING_TYPE object>#

List of Column that constitute a primary key, may be empty.

Methods Documentation

classmethod from_felis(dm_table: Table, columns: Mapping[str, Column]) Table#

Convert Felis table definition into instance of this class.

Parameters#

dm_tablefelis.datamodel.Table

Felis table definition.

columnsMapping [str, Column]

Mapping of column ID to Column instance.

Returns#

tableTable

Converted table definition.