bamboost.index.versioning
Attributes
- MigrationExecutor=
collections.abc.Callable[[pathlib.Path, pathlib.Path, bool | None], None] - _MIGRATIONS:
dict[tuple[Version, bamboost.index.versioning.Version], bamboost.index.versioning.MigrationExecutor]={}
Functions
(from_version, to_version, *, source_db=None, destination_db=None, update=False) -> NoneMigrate the index database between two schema versions.
Arguments:
- from_version:
VersionThe source version.
- to_version:
VersionThe destination version.
- source_db:
pathlib.Path | None=NoneOptional path to the source database file. If not provided, it will be determined from the config.
- destination_db:
pathlib.Path | None=NoneOptional path to the destination database file. If not provided, it will be determined from the config.
- update:
bool=FalseIf True, existing records in the destination will be updated with values from the source. Otherwise, existing records will be left unchanged.
(from_version, to_version) -> Callable[[MigrationExecutor], MigrationExecutor](from_version, to_version) -> MigrationExecutor(source_db, destination_db, *, update=False) -> NoneMigrate database content from version 0.10 to 0.11.
If update=True, existing records in the destination are updated
with values from the source.
Arguments:
- source_db:
pathlib.Path - destination_db:
pathlib.Path - update:
bool=False
Classes
Version
(self, version, database_file_name)Arguments:
- version:
str - database_file_name:
str
Attributes:
- V0_10=
('0.10', 'bamboost-next.sqlite') - V0_11=
('0.11', 'bamboost.0.11.sqlite') - version=
bamboost.index.versioning.Version(version) - database_file_name=
bamboost.index.versioning.Version(database_file_name)
(self) -> str(cls) -> 'Version'Return the latest version.
Arguments:
- cls
(cls, version_str) -> 'Version'Get enum member by version string.
Arguments:
- cls
- version_str:
str
MigrationError
Base class for migration-related errors.
MigrationNotAvailableError
(self, from_version, to_version) -> NoneRaised when no migration routine is registered for a version pair.
SourceDatabaseNotFoundError
(self, source_path) -> NoneRaised when the source database file cannot be located.
Arguments:
- source_path:
pathlib.Path
Attributes:
- source_path=
bamboost.index.versioning.SourceDatabaseNotFoundError(source_path)
Bamboost