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)
}
}

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

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).

Link copied to clipboard

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.

Link copied to clipboard

If true, creates a backup of the database before attempting destructive recovery. Only applies when allowDestructiveRecovery is true. Default is true.

Link copied to clipboard

Android context used to access the database. Defaults to the global ContextProvider.context.

Link copied to clipboard

Name of the database file. Each storage type has its own default:

Link copied to clipboard

Database schema version number. Used for database migrations.

Link copied to clipboard

Optional initial passphrase for the database. If null, a secure passphrase will be generated automatically.

Link copied to clipboard

Logger instance for diagnostic output. Defaults to the global Logger instance.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Provider for the database encryption passphrase. Defaults to KeyStorePassphraseProvider which uses Android KeyStore for secure storage.