Skip to content

Commit 7beb6fa

Browse files
authored
doc: improve sqlite.backup() progress/fulfillment documentation
PR-URL: #59598 Refs: #56253 Reviewed-By: Edy Silva <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]>
1 parent 8eeb8fc commit 7beb6fa

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
@@ -772,9 +772,11 @@ changes:
772772
* `target` {string} Name of the target database. This can be `'main'` (the default primary database) or any other
773773
database that have been added with [`ATTACH DATABASE`][] **Default:** `'main'`.
774774
* `rate` {number} Number of pages to be transmitted in each batch of the backup. **Default:** `100`.
775-
* `progress` {Function} Callback function that will be called with the number of pages copied and the total number of
776-
pages.
777-
* Returns: {Promise} A promise that resolves when the backup is completed and rejects if an error occurs.
775+
* `progress` {Function} An optional callback function that will be called after each backup step. The argument passed
776+
to this callback is an {Object} with `remainingPages` and `totalPages` properties, describing the current progress
777+
of the backup operation.
778+
* Returns: {Promise} A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an
779+
error occurs.
778780

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

0 commit comments

Comments
 (0)