exportDatabaseCopy

suspend fun exportDatabaseCopy(database: Database, destinationPath: String)(source)

Export a copy of the database to the specified path.

This creates a fully vacuumed and optimized copy of the database using SQLite's VACUUM INTO command. The copy will be encrypted with the same key as the source database.

Platform Support

This method is only useful on platforms using SQLCipher (iOS, Android, JVM, native). On WASM platforms, this function will return an error.

Arguments

  • database - The database instance to export

  • destination_path - The file path where the database copy should be created