backup abstract method

Stream<double> backup(
  1. Database toDatabase, {
  2. int nPage = 5,
})

Create a backup of the current database (this) into another database (toDatabase) on memory or disk.

The returned stream returns a rough estimate on the progress of the backup, as a fraction between 0 and 1. No progress is reported if either this or toDatabase is an in-memory database.

To simply await the backup operation as a future, call Stream.drain on the returned stream.

nPage is the number of pages backed-up in each backup step. A larger value increase speed of backup, but will cause other connections to wait longer to aquire locks on the source and destination databases. A value of -1 can be used to backup the entire database in a single step. See https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupstep for details.

See https://www.sqlite.org/c3ref/backup_finish.html

Implementation

Stream<double> backup(Database toDatabase, {int nPage = 5});