type_bridge.migration.snapshots¶
snapshots
¶
Migration snapshot bindings and time-state package management.
SnapshotError
¶
Bases: ValueError
Raised when an existing migration snapshot is missing or stale.
generate_snapshot
¶
Generate a schema snapshot package in migrations/snapshots/vNNNN/.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
migrations_dir
|
Path
|
Directory containing migrations (e.g. Path("migrations")) |
required |
version
|
str
|
Snapshot version string, e.g. "v0001" |
required |
migration_name
|
str
|
The suffix name of the migration, e.g. "0001_initial" |
required |
schema_text
|
str
|
The canonical TypeQL schema text |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the created snapshot directory |
Source code in type_bridge/migration/snapshots.py
get_snapshot_metadata
¶
Read metadata from a snapshot.json file.
Source code in type_bridge/migration/snapshots.py
get_snapshot_class_map
¶
Return a mapping from TypeDB type label to class for a snapshot version.
For example, maps 'user' to migrations.snapshots.v0001.entities.User class.