Entity
class Entity(connection_type: ConnMetaModel)
Bases: ABC
Categories: spi
Abstract base for an entity within a connection.
Every concrete entity carries a back-reference to the
ConnMetaModel that produced it so that fqn can format the
entity's fully qualified name using the meta-model's hierarchy.
Parameters
Methods
method
fqndef fqn() -> str
Return the fully qualified name of this entity.
The format follows the meta-model's hierarchy (e.g. SQL uses
database.schema.table, storage uses prefix/path).
method
field_namesdef field_names() -> list[str]
Return the names of all fields/columns/properties here.
method
to_dictdef to_dict() -> dict
Serialize the entity to a dict, omitting falsy values.
method
from_dictdef from_dict(data: dict, connection_type: 'ConnMetaModel') -> 'Entity'
Rebuild an entity from to_dict output.
connection_type is supplied explicitly because it is a
runtime reference, not part of the serialized dict.
Parameters:
parameter
datadictparameter
connection_type'ConnMetaModel'