Skip to content

metadata

mlte/store/artifact/underlying/rdbs/metadata.py

Definition of the metadata (DB schema) for the artifact store.

DBBase

Bases: DeclarativeBase

Base class for DB table classes.

Source code in mlte/store/artifact/underlying/rdbs/metadata.py
41
42
43
44
class DBBase(DeclarativeBase):
    """Base class for DB table classes."""

    pass

init_artifact_types(session)

Initializes the table with the configured artifact types.

Source code in mlte/store/artifact/underlying/rdbs/metadata.py
138
139
140
141
142
143
144
145
def init_artifact_types(session: Session):
    """Initializes the table with the configured artifact types."""
    if session.scalars(select(DBArtifactType)).first() is None:
        types = [e.value for e in ArtifactType]
        for type in types:
            type_obj = DBArtifactType(name=type)
            session.add(type_obj)
        session.commit()