export-db-to-file.rst (1296B)
1 .. ts:op:: exportDbToFile 2 3 Export the database to a file. The target directory must already 4 exist. 5 6 **Request:** 7 8 The request arguments must be an `ExportDbToFileRequest` object. 9 10 **Response:** 11 12 On success, the result is an `ExportDbToFileResponse` object. 13 14 **Side effects:** 15 16 Writes the database dump to a new file on the host filesystem. 17 18 **Expected errors:** 19 20 The caller can handle the following errors inline: 21 ``WALLET_DB_BACKEND_UNSUPPORTED``. 22 23 **Details:** 24 25 The request fails with ``WALLET_DB_BACKEND_UNSUPPORTED`` if the 26 active database backend cannot export the database to a file. 27 28 .. ts:def:: ExportDbToFileRequest 29 30 interface ExportDbToFileRequest { 31 // Directory that the DB should be exported into. 32 directory: string; 33 34 // Stem of the exported DB filename. The final name will be 35 // ${directory}/${stem}.${extension}, where the extension depends 36 // on the used DB backend. 37 stem: string; 38 39 // Force the format of the export. Supported values on 40 // filesystem-capable hosts are "json" and "sqlite3"; if omitted, 41 // the host's default is "sqlite3". 42 forceFormat?: string; 43 } 44 45 .. ts:def:: ExportDbToFileResponse 46 47 interface ExportDbToFileResponse { 48 // Full path to the backup. 49 path: string; 50 }