Re: [sqlite] progressbar

2012-05-05 Thread Patrik Nilsson
Thank you for your suggestion. I will consider it. Patrik On 05/05/2012 10:31 PM, Roger Binns wrote: > On 05/05/12 12:52, Patrik Nilsson wrote: >> I use Sqlite as a document-file. Saving is when user requests to or >> when program quits. > > Even less reason to couple the user interface to datab

Re: [sqlite] progressbar

2012-05-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/05/12 12:52, Patrik Nilsson wrote: > I use Sqlite as a document-file. Saving is when user requests to or > when program quits. Even less reason to couple the user interface to database operations. Are you really sure your users want to microman

Re: [sqlite] progressbar

2012-05-05 Thread Patrik Nilsson
On 05/05/2012 08:25 PM, Roger Binns wrote: > Something else you can consider is changing how your program works so that > the user interface isn't slaved to database operations. You can let the > UI queue up work to be done, and then have a background worker thread > actually do the work in the q

Re: [sqlite] progressbar

2012-05-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/05/12 10:18, Patrik Nilsson wrote: > Is it possible to get the total number of virtual machine instructions > an operation is requiring? You know how many there are in the program via explain, but you will not know how many will be executed. F

Re: [sqlite] progressbar

2012-05-05 Thread Patrik Nilsson
It will not relate to the number of bytes/pages to move. An example: If I "explain vacuum"... 0|Trace|0|0|0||00| 1|Vacuum|0|0|0||00| 2|Halt|0|0|0||00| I count these rows to two (excluding halt). When running a lengthy operation the best resolution I can get is 50 percent. Unfortunately, this wi

Re: [sqlite] progressbar

2012-05-05 Thread Simon Slavin
On 5 May 2012, at 6:18pm, Patrik Nilsson wrote: > Is it possible to get the total number of virtual machine instructions a > "begin... commit"-statement will need? I.e. progress of saving data to > the database. Using 'EXPLAIN ...' for each of your instructions, and adding up the number of row

[sqlite] progressbar

2012-05-05 Thread Patrik Nilsson
Hi All, Is it possible to get the total number of virtual machine instructions an operation is requiring? When backing up you have "sqlite3_backup_remaining" to do this job. By invoking the callback to every N is equal to 1 and saving the first value you have a progressbar with percentage. I wan