Snapshot#
Note
You can back up your data by creating snapshots with
create_snapshot() and
create_snapshot().
- featherstore.snapshot.restore_table(store_name, source, *, errors='raise')[source]#
Restores a table into the currently connected database.
The table is restored under the name stored in the snapshot.
store_nameselects only the destination store.- Parameters:
store_name (str) – The name of the store to restore the table into.
source (str) – Path to the snapshot file.
.tar.xzis appended unlesssourcealready ends with that suffix.errors (str, optional) – Whether to raise an error if a table with the same name already exists. Can be
'raise'or'ignore';'ignore'overwrites the existing table. Default is'raise'.
- Returns:
The table name from the snapshot archive.
- Return type:
- Raises:
NotConnectedError – If FeatherStore is not connected to a database.
StoreNotFoundError – If the target store does not exist.
ForbiddenStoreNameError – If
store_nameis reserved or not a valid path name.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.ForbiddenTableNameError – If the archived table name is reserved or not a valid path name.
TypeError – If
store_nameorsourceis not a str.ValueError – If
errorsis not'raise'or'ignore'.
- featherstore.snapshot.restore_store(source, *, errors='raise')[source]#
Restores a store into the currently connected database.
The store is restored under the name stored in the snapshot.
- Parameters:
- Returns:
The store name from the snapshot archive.
- Return type:
- 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.ForbiddenStoreNameError – If the archived store name is reserved or not a valid path name.
TypeError – If
sourceis not a str.ValueError – If
errorsis not'raise'or'ignore'.