doc: improve `sqlite.backup()` progress/fulfillment documentation · nodejs/node@b4f202c

Original file line numberDiff line numberDiff line change

@@ -756,9 +756,11 @@ changes:

756756

* `target` {string} Name of the target database. This can be `'main'` (the default primary database) or any other

757757

database that have been added with [`ATTACH DATABASE`][] **Default:** `'main'`.

758758

* `rate` {number} Number of pages to be transmitted in each batch of the backup. **Default:** `100`.

759-

* `progress` {Function} Callback function that will be called with the number of pages copied and the total number of

760-

pages.

761-

* Returns: {Promise} A promise that resolves when the backup is completed and rejects if an error occurs.

759+

* `progress` {Function} An optional callback function that will be called after each backup step. The argument passed

760+

to this callback is an {Object} with `remainingPages` and `totalPages` properties, describing the current progress

761+

of the backup operation.

762+

* Returns: {Promise} A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an

763+

error occurs.

762764
763765

This method makes a database backup. This method abstracts the [`sqlite3_backup_init()`][], [`sqlite3_backup_step()`][]

764766

and [`sqlite3_backup_finish()`][] functions.