Skip to content

Commit b4f202c

Browse files
Renegade334targos
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 0fa22cb commit b4f202c

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

0 commit comments

Comments
 (0)