From 63847496f14c813a5d80efd5b7de0f1294ffe1e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 16:07:11 +0200 Subject: Adding upstream version 3.45.1. Signed-off-by: Daniel Baumann --- www/c3ref/progress_handler.html | 165 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 www/c3ref/progress_handler.html (limited to 'www/c3ref/progress_handler.html') diff --git a/www/c3ref/progress_handler.html b/www/c3ref/progress_handler.html new file mode 100644 index 0000000..4c0233a --- /dev/null +++ b/www/c3ref/progress_handler.html @@ -0,0 +1,165 @@ + + + + + +Query Progress Callbacks + + + +
+ + + +
+
+Small. Fast. Reliable.
Choose any three. +
+ + +
+
+ + + +
+
+
+ + +
+

SQLite C Interface

+

Query Progress Callbacks

+
+
+void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
+
+

+The sqlite3_progress_handler(D,N,X,P) interface causes the callback +function X to be invoked periodically during long running calls to +sqlite3_step() and sqlite3_prepare() and similar for +database connection D. An example use for this +interface is to keep a GUI updated during a large query.

+ +

The parameter P is passed through as the only parameter to the +callback function X. The parameter N is the approximate number of +virtual machine instructions that are evaluated between successive +invocations of the callback X. If N is less than one then the progress +handler is disabled.

+ +

Only a single progress handler may be defined at one time per +database connection; setting a new progress handler cancels the +old one. Setting parameter X to NULL disables the progress handler. +The progress handler is also disabled by setting N to a value less +than 1.

+ +

If the progress callback returns non-zero, the operation is +interrupted. This feature can be used to implement a +"Cancel" button on a GUI progress dialog box.

+ +

The progress handler callback must not do anything that will modify +the database connection that invoked the progress handler. +Note that sqlite3_prepare_v2() and sqlite3_step() both modify their +database connections for the meaning of "modify" in this paragraph.

+ +

The progress handler callback would originally only be invoked from the +bytecode engine. It still might be invoked during sqlite3_prepare() +and similar because those routines might force a reparse of the schema +which involves running the bytecode engine. However, beginning with +SQLite version 3.41.0, the progress handler callback might also be +invoked directly from sqlite3_prepare() while analyzing and generating +code for complex queries. +

See also lists of + Objects, + Constants, and + Functions.

+ -- cgit v1.2.3