Contents

exportDbToFile#

Export the database to a file. The target directory must already exist.

Request:

The request arguments must be an ExportDbToFileRequest object.

Response:

On success, the result is an ExportDbToFileResponse object.

Side effects:

Writes the database dump to a new file on the host filesystem.

Expected errors:

The caller can handle the following errors inline: WALLET_DB_BACKEND_UNSUPPORTED.

Details:

The request fails with WALLET_DB_BACKEND_UNSUPPORTED if the active database backend cannot export the database to a file.

interface ExportDbToFileRequest {
  // Directory that the DB should be exported into.
  directory: string;

  // Stem of the exported DB filename.  The final name will be
  // ${directory}/${stem}.${extension}, where the extension depends
  // on the used DB backend.
  stem: string;

  // Force the format of the export.  Supported values on
  // filesystem-capable hosts are "json" and "sqlite3"; if omitted,
  // the host's default is "sqlite3".
  forceFormat?: string;
}
interface ExportDbToFileResponse {
  // Full path to the backup.
  path: string;
}