This PR introduces some improvements to the progress handler functionality:
All settings are optional, passed through keyword arguments.
Add tick parameter.
Add mode: normal, once, at least once.
Add global Extralite.on_progress method for setting global progress handler behaviour.
The tick parameter is used to control the granularity of the progress
handler. This is the value passed to sqlite3_progress_handler. The
period parameter is used to control how often the progress handler proc
is called. So, a period of 1000 and a tick of 10 will cause the internal
progress handler callback to be called every 10 SQLite VM instructions,
but the proc will be called only every 1000 (cumulative) VM
instructions.
The different modes:
normal: the progress handler proc is called only on SQLite progress.
once: the progress handler proc is called only when preparing to run a
query.
at least once: the progress handler proc is when preparing to run a
query, and on SQLite progress.
This PR introduces some improvements to the progress handler functionality:
Extralite.on_progress
method for setting global progress handler behaviour.The tick parameter is used to control the granularity of the progress handler. This is the value passed to sqlite3_progress_handler. The period parameter is used to control how often the progress handler proc is called. So, a period of 1000 and a tick of 10 will cause the internal progress handler callback to be called every 10 SQLite VM instructions, but the proc will be called only every 1000 (cumulative) VM instructions.
The different modes:
Some examples: