SQLiteStorageConfig
Configuration class for SQLiteStorage and its subclasses. Contains all the configuration parameters needed to initialize SQLite-based storage.
This shared configuration class is used by:
SQLOathStorage
SQLPushStorage
Any custom SQLiteStorage implementations
Example usage:
val storage = SQLOathStorage {
context = applicationContext
databaseName = "custom_mfa.db"
allowDestructiveRecovery = true
onDatabaseError = { exception, canRecover ->
logger.error("Database error", exception)
}
}Properties
If true, allows the SDK to delete corrupted databases and start fresh. WARNING: This will cause data loss. Only enable if you have external backup strategies. Default is false (safe by default).
If true, automatically attempts to restore from the most recent backup when database initialization fails. If false, backup restoration must be triggered manually. Default is true.
If true, creates a backup of the database before attempting destructive recovery. Only applies when allowDestructiveRecovery is true. Default is true.
Name of the database file. Each storage type has its own default:
Database schema version number. Used for database migrations.
Optional initial passphrase for the database. If null, a secure passphrase will be generated automatically.
Maximum number of backup files to retain. Older backups beyond this limit are automatically deleted. Set to 0 to disable backup creation entirely. Default is 3.
Optional callback invoked when a database error occurs during initialization. Receives the exception and a boolean indicating whether recovery will be attempted. Useful for logging, telemetry, and custom error handling.
Provider for the database encryption passphrase. Defaults to KeyStorePassphraseProvider which uses Android KeyStore for secure storage.