Skip to main content

Constants for the fields of the /restore/backup request.

Option fields

options

Constants for options.

pub const BACKUP_ID: &str = “backup_id”;

ID of the snapshot to restore. Leave empty to restore the most recent snapshot in the backup.

pub const CANCEL: &str = “cancel”;

Cancel active subscriptions.

pub const CASCADE_FOREIGN_KEYS: &str = “cascade_foreign_keys”;

Whether to drop live foreign-key-referencing tables that are not themselves part of the backup, when the table they reference is being replaced. Only applies when restore_policy is replace.

pub const CHECKSUM: &str = “checksum”;

Whether or not to verify checksums for backup files when restoring.

pub const CLEAN: &str = “clean”;

Before restoring, drop every existing object of each object type being restored, whether or not that object is in the backup, including objects that are not persisted; object types not being restored are left untouched, and schemas are not dropped. Unlike replace, the clean is scoped by object type, not by name: restoring a single table drops every table in the database first, and the response warns when the objects to restore name specific objects of a type rather than all of them. Use dry_run to list the objects that would be dropped. The restore is refused, before anything is dropped, if an object that would be dropped is still used by an object of a type that is not being restored, or cannot be dropped, such as a table locked by a backup in progress. As graphs, contexts, table monitors and stored procedures all depend on tables, restoring tables requires restoring each of those types of which any objects exist. A data sink generated for a monitor is dropped along with the monitor, and a home directory only along with its user. Objects created by other sessions while the restore runs are not dropped. If the restore fails after the clean, the dropped objects are not put back. System objects, the data source being restored from and its credential, the calling user and admin, with their default schemas, home directories and resource groups, and the calling user’s roles are never dropped, nor are the schemas holding any of these. Requires system administrator permission.

pub const CLEAN_ALL: &str = “clean_all”;

Before restoring, drop every existing object in the database, regardless of which objects are being restored, including users, roles, non-system schemas and objects that are not persisted. The restore is refused, before anything is dropped, if an object cannot be dropped, such as a table locked by a backup in progress, or is still used by an object the clean keeps, such as a resource group a system user is in; it also requires create_schema_if_not_exist to be true. If the restore fails after the clean, the dropped objects are not put back. System objects, the data source being restored from and its credential, the calling user and admin, with their default schemas, home directories and resource groups, and the calling user’s roles are never dropped, nor are the schemas holding any of these. Requires system administrator permission.

pub const CREATE_SCHEMA_IF_NOT_EXIST: &str = “create_schema_if_not_exist”;

Behavior to apply when the schema containing any database object to restore does not already exist.

pub const DDL_ONLY: &str = “ddl_only”;

Behavior to apply when restoring tables.

pub const DRY_RUN: &str = “dry_run”;

Whether or not to perform a dry run of the restoration operation. With a restore_policy of clean or clean_all, a dry run lists the objects the clean would drop in the clean_dropped_objects entry of the response info map and drops nothing, and fails as the restore would if the clean is refused.

pub const FALSE: &str = “false”;

Restore only permissions on restored objects.

pub const NONE: &str = “none”;

If an object to be restored already exists with the same name, abort and return error.

pub const PAUSE: &str = “pause”;

Pause subscriptions that were active when the backup was made.

pub const REINGEST: &str = “reingest”;

Behavior to apply when restoring table data.

pub const RENAME: &str = “rename”;

If an object to be restored already exists with the same name, move that existing one to the schema specified by renamed_objects_schema. This policy does not apply to non-schema objects.

pub const RENAMED_OBJECTS_SCHEMA: &str = “renamed_objects_schema”;

If the restore_policy is rename, use this schema for relocated existing objects instead of the default generated one.

pub const REPLACE: &str = “replace”;

If an object to be restored already exists with the same name, replace it with the backup version. Only objects in the backup are dropped; existing objects that are not in the backup are kept, so the result is a merge of the backup into the database. To drop those as well, use clean.

pub const RESTORE_ALL_PERMISSIONS: &str = “restore_all_permissions”;

Whether or not all permissions of restored principals should be restored or scoped to the restored objects. When restore_policy is clean or clean_all, the default is true: the clean drops each principal in scope along with all of its permissions, including those on objects it does not drop.

pub const RESTORE_POLICY: &str = “restore_policy”;

Behavior to apply when any database object to restore already exists.

pub const RESTORE_SUBSCRIPTIONS: &str = “restore_subscriptions”;

Behavior to apply when restoring datasource subscriptions on tables.

pub const RESUME: &str = “resume”;

Resume subscriptions that were active when the backup was made.

pub const TARGET_SCHEMA_MAP: &str = “target_schema_map”;

Restore schema-based objects to alternate schema. Value is a comma delimitted list of key:value pairs mapping the original (source) schema name as it exists in the backup to a target (destination) schema namespace: “src: dst [, src: dst [, …]]”. Note that schema names are case sensitive and must adhere to the database schema naming criteria.

pub const TRUE: &str = “true”;

Restore all permissions.

restore_objects_map

Constants for restore_objects_map.

pub const ALL: &str = “all”;

All object types and data contained in the given schema(s).

pub const CATALOG: &str = “catalog”;

Data Lake catalog that is external to the database.

pub const CONTEXT: &str = “context”;

Context(s).

pub const CREDENTIAL: &str = “credential”;

Credential(s).

pub const DATASINK: &str = “datasink”;

Data sink(s).

pub const DATASOURCE: &str = “datasource”;

Data source(s).

pub const DIRECTORY: &str = “directory”;

KiFS File directory(ies).

pub const FUNCTION_ENVIRONMENT: &str = “function_environment”;

Python UDF function environment(s).

pub const GRAPH: &str = “graph”;

Graph definition(s). Source table(s), if applicable, are required in order to restore graph objects.

pub const MONITOR: &str = “monitor”;

Table monitor(s) / SQL stream(s).

pub const RESOURCE_GROUP: &str = “resource_group”;

Resource group(s).

pub const ROLE: &str = “role”;

Role(s), role members (roles or users, recursively), and associated permissions.

pub const STORED_PROCEDURE: &str = “stored_procedure”;

SQL procedure(s).

pub const TABLE: &str = “table”;

Table(s) and SQL view(s). Tables with subscriptions will by default be restored in the state they were in at the time of the snapshot. See restore_subscriptions for options to override the default behavior.

pub const USER: &str = “user”;

User(s) (internal and external) and associated permissions.

pub const USER_DEFINED_FUNCTION: &str = “user_defined_function”;

UDF(s).