versioned_collection.collection.tracking_collections.replica module

class versioned_collection.collection.tracking_collections.replica.ReplicaCollection(*args: Any, **kwargs: Any)[source]

Bases: _BaseTrackerCollection

A snapshot of the latest tracked version of the target collection.

When the target collection is initialised for versioning, or when changes to a previous version of the target collection are tried to be made, i.e., when branching explicitly or implicitly from a previous checked-out version, this collection will replicate the state of the target collection.

The main purpose of a ReplicaCollection is to allow the user to efficiently perform queries to a tracked collection without any performance overhead, allowing to compute the deltas between the latest tracked version and the modified version of the target collection when a new version of it is registered.

build()[source]

Build this collection on the database.

Upon the creation of this collection a snapshot of the target collection is created as well, i.e., this collection will be a replica of the target collection at the moment of initialisation.

create_snapshot() None[source]