Snapshot#
Note
You can back-up your data by creating snapshots using Table.create_snapshot()
and Store.create_snapshot()
- featherstore.snapshot.restore_table(store_name, source, *, errors='raise')[source]#
Restores a table in to the currently selected db.
- Parameters:
store_name (str) – The name of the store to restore the table into.
source (str) – Path to the snapshot file.
errors (str) – Whether or not to raise an error if a table with the same name already exist. Can be either raise or ignore, ignore overwrites existing table, by default raise.
- Returns:
The name of the table restored.
- Return type:
str
- Raises:
NotConnectedError – If FeatherStore is not connected to a database.
StoreNotFoundError – If the target store does not exist.
SnapshotNotFoundError – If the snapshot file does not exist.
InvalidSnapshotError – If the file is not a snapshot of a table.
TableAlreadyExistsError – If
errors='raise'and the table already exists.TypeError – If
storeorsourceis not a str.ValueError – If
errorsis not'raise'or'ignore'.
- featherstore.snapshot.restore_store(source, *, errors='raise')[source]#
Restores a store in to the currently selected db.
- Parameters:
source (str) – Path to the snapshot file.
errors (str) – Whether or not to raise an error if a store with the same name already exist. Can be either raise or ignore, ignore overwrites existing store, by default raise.
- Returns:
The name of the store restored.
- Return type:
str
- Raises:
NotConnectedError – If FeatherStore is not connected to a database.
SnapshotNotFoundError – If the snapshot file does not exist.
InvalidSnapshotError – If the file is not a snapshot of a store.
StoreAlreadyExistsError – If
errors='raise'and the store already exists.TypeError – If
sourceis not a str.ValueError – If
errorsis not'raise'or'ignore'.