Skip to content

Repository

mongorunway.application.ports.repository ¤

__all__: typing.Sequence[str] = ('MigrationModelRepository') module-attribute ¤

MigrationModelRepository ¤

Bases: abc.ABC

Source code in mongorunway\application\ports\repository.py
class MigrationModelRepository(abc.ABC):
    __slots__: typing.Sequence[str] = ()

    @abc.abstractmethod
    def __len__(self) -> int:
        ...

    @abc.abstractmethod
    def __contains__(self, item: typing.Any, /) -> bool:
        ...

    @abc.abstractmethod
    def has_migration(self, item: typing.Any, /) -> bool:
        ...

    @abc.abstractmethod
    def has_migration_with_version(self, migration_version: int, /) -> bool:
        ...

    @abc.abstractmethod
    def has_migrations(self) -> bool:
        ...

    @abc.abstractmethod
    def acquire_migration_model_by_version(
        self,
        migration_version: int,
    ) -> typing.Optional[domain_migration.MigrationReadModel]:
        ...

    @abc.abstractmethod
    def acquire_migration_model_by_flag(
        self, is_applied: bool
    ) -> typing.Optional[domain_migration.MigrationReadModel]:
        ...

    @abc.abstractmethod
    def acquire_all_migration_models(
        self,
        *,
        ascending_id: bool = True,
    ) -> typing.Iterator[domain_migration.MigrationReadModel]:
        ...

    @abc.abstractmethod
    def acquire_migration_models_by_flag(
        self, *, is_applied: bool
    ) -> typing.Iterator[domain_migration.MigrationReadModel]:
        ...

    @abc.abstractmethod
    def append_migration(self, migration: domain_migration.Migration, /) -> int:
        ...

    @abc.abstractmethod
    def remove_migration(self, migration_version: int, /) -> int:
        ...

    @abc.abstractmethod
    def set_applied_flag(self, migration: domain_migration.Migration, is_applied: bool) -> int:
        ...

__slots__: typing.Sequence[str] = () instance-attribute class-attribute ¤

__contains__(item) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def __contains__(self, item: typing.Any, /) -> bool:
    ...

__len__() abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def __len__(self) -> int:
    ...

acquire_all_migration_models(*, ascending_id=True) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def acquire_all_migration_models(
    self,
    *,
    ascending_id: bool = True,
) -> typing.Iterator[domain_migration.MigrationReadModel]:
    ...

acquire_migration_model_by_flag(is_applied) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def acquire_migration_model_by_flag(
    self, is_applied: bool
) -> typing.Optional[domain_migration.MigrationReadModel]:
    ...

acquire_migration_model_by_version(migration_version) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def acquire_migration_model_by_version(
    self,
    migration_version: int,
) -> typing.Optional[domain_migration.MigrationReadModel]:
    ...

acquire_migration_models_by_flag(*, is_applied) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def acquire_migration_models_by_flag(
    self, *, is_applied: bool
) -> typing.Iterator[domain_migration.MigrationReadModel]:
    ...

append_migration(migration) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def append_migration(self, migration: domain_migration.Migration, /) -> int:
    ...

has_migration(item) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def has_migration(self, item: typing.Any, /) -> bool:
    ...

has_migration_with_version(migration_version) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def has_migration_with_version(self, migration_version: int, /) -> bool:
    ...

has_migrations() abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def has_migrations(self) -> bool:
    ...

remove_migration(migration_version) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def remove_migration(self, migration_version: int, /) -> int:
    ...

set_applied_flag(migration, is_applied) abstractmethod ¤

Source code in mongorunway\application\ports\repository.py
@abc.abstractmethod
def set_applied_flag(self, migration: domain_migration.Migration, is_applied: bool) -> int:
    ...