Column#

class lsst.dax.apdb.schema_model.Column(name: str, id: str, datatype: ~felis.datamodel.DataType | ~lsst.dax.apdb.schema_model.ExtraDataTypes, length: int | None = None, nullable: bool = True, value: ~typing.Any = None, autoincrement: bool | None = None, description: str | None = None, annotations: ~collections.abc.Mapping[str, ~typing.Any] = <factory>, table: ~lsst.dax.apdb.schema_model.Table | None = None)#

Bases: object

Column representation in schema.

Attributes Summary

annotations

Additional annotations for this column.

autoincrement

Unspecified value results in None.

datatype

Column type, one of the enums defined in DataType.

description

Column description.

id

Felis ID for this column.

length

Optional length for string/binary columns

name

Column name.

nullable

True for nullable columns.

table

Table which defines this column, usually not None.

value

Default value for column, can be None.

Methods Summary

clone()

Make a clone of self.

from_felis(dm_column)

Convert Felis column definition into instance of this class.

size()

Return size in bytes of this column.

Attributes Documentation

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

Additional annotations for this column.

autoincrement: bool | None = None#

Unspecified value results in None.

datatype: DataType | ExtraDataTypes = <dataclasses._MISSING_TYPE object>#

Column type, one of the enums defined in DataType.

description: str | None = None#

Column description.

id: str = <dataclasses._MISSING_TYPE object>#

Felis ID for this column.

length: int | None = None#

Optional length for string/binary columns

name: str = <dataclasses._MISSING_TYPE object>#

Column name.

nullable: bool = True#

True for nullable columns.

table: Table | None = None#

Table which defines this column, usually not None.

value: Any = None#

Default value for column, can be None.

Methods Documentation

clone() Column#

Make a clone of self.

classmethod from_felis(dm_column: Column) Column#

Convert Felis column definition into instance of this class.

Parameters#

dm_columnfelis.datamodel.Column

Felis column definition.

Returns#

columnColumn

Converted column definition.

size() int#

Return size in bytes of this column.

Returns#

sizeint

Size in bytes for this column, typically represents in-memory size of the corresponding data type. May or may not be the same as storage size or wire-level protocol size.