On Thu, Nov 25, 2010 at 6:08 PM, Nick Shaw <nick.s...@citysync.co.uk> wrote:

> Hi all,
>
>
>
> So... Assuming the above is how sqlite is meant to work, what would be
> the best way to ascertain if a successfully opened file is ok to use?
> Currently once the file has been opened by sqlite3_open(), and provided
> the file existed prior to that call, I then run the query "SELECT
> COUNT(rowid) from sqlite_master" and if it fails, I assume the DB is
> corrupt or not an sqlite file.  This seems to work, however it seems a
> bit long winded and wondered if there was a better way of checking this
> kind of thing?
>
>
When I implemented an encryption scheme with an VFS, I noticed that sqlite
doesn't read anything until specially requested, so I ended up with reading
encoding pragma for this task. At least if I provided wrong password, sqlite
just by trying reading this pragma returned an error about something like
"encrypted or bad"

Max Vlasov
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to