Skip to content

Commit 0e10a8e

Browse files
Renegade334richardlau
authored andcommitted
doc: improve sqlite.backup() progress/fulfillment documentation
PR-URL: #59598 Refs: #56253 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
1 parent fc3f82d commit 0e10a8e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/api/sqlite.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,11 @@ added: v22.16.0
716716
* `target` {string} Name of the target database. This can be `'main'` (the default primary database) or any other
717717
database that have been added with [`ATTACH DATABASE`][] **Default:** `'main'`.
718718
* `rate` {number} Number of pages to be transmitted in each batch of the backup. **Default:** `100`.
719-
* `progress` {Function} Callback function that will be called with the number of pages copied and the total number of
720-
pages.
721-
* Returns: {Promise} A promise that resolves when the backup is completed and rejects if an error occurs.
719+
* `progress` {Function} An optional callback function that will be called after each backup step. The argument passed
720+
to this callback is an {Object} with `remainingPages` and `totalPages` properties, describing the current progress
721+
of the backup operation.
722+
* Returns: {Promise} A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an
723+
error occurs.
722724

723725
This method makes a database backup. This method abstracts the [`sqlite3_backup_init()`][], [`sqlite3_backup_step()`][]
724726
and [`sqlite3_backup_finish()`][] functions.

0 commit comments

Comments
 (0)