- migrateDatabase#
Explicitly migrate an IndexedDB-emulation wallet to the native SQLite schema. The operation is idempotent when the wallet is already native.
Request:
The request arguments must be a MigrateDatabaseRequest object.
Response:
On success, the result is a MigrateDatabaseResponse object.
Side effects:
Converts the wallet database to the native SQLite schema. The migration can be long-running; progress is reported via notifications when
progressTokenis set.Expected errors:
The caller can handle the following errors inline:
WALLET_DB_BACKEND_UNSUPPORTED,WALLET_DB_UNAVAILABLE,WALLET_CORE_REQUEST_CANCELLED.Details:
When the wallet already uses the native SQLite schema, the request succeeds with
migratedset to false. The optionalprogressTokencorrelates progress notifications and allows cancellation via cancelProgressToken. If the migration itself fails, the request fails withWALLET_DB_UNAVAILABLEand the existing (IndexedDB) database remains active; a cancelled migration fails withWALLET_CORE_REQUEST_CANCELLED.
interface MigrateDatabaseRequest {
// Enables progress correlation and cancellation through
// cancelProgressToken.
progressToken?: string;
}
interface MigrateDatabaseResponse {
// Whether this request changed the active database backend.
migrated: boolean;
// Database backend active after the request.
databaseBackend: WalletDatabaseBackend;
}
type WalletDatabaseBackend = "indexeddb" | "sqlite";