On Sun, Oct 10, 2010 at 11:04 PM, Roger Binns <rog...@rogerbinns.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 10/10/2010 11:53 AM, Max Vlasov wrote: > > Also if you're not content with this option, you can always open the file > > (just as a general file) prior to sqlite with a "deny write" option. I'm > > aware of such feature in Windows/Win32, I'm sure a similar option should > > exist in Linux. In this case any attempt to write will lead to OS-level > > error that finally will be passes as some sqlite error to your code. > > > Going back to Joshua's original question, by default a SQLite database is > not read-only even if you think it is. The major reason is that even if > you > wanted to use it read-only, the previous program may have had it open for > writing, and may have crashed in the middle of a transaction. > Roger, you're right about recovering and related, but I don't think it's a reason enough to consider SQLITE_OPEN_READONLY useless (I know you didn't say this, just for others to have in mind). At least it saves from destructive operations from the SQL side, reporting "attempt to write a readonly database" error on every operation including INSERT, DELETE and persistent PRAGMAs Max Vlasov _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users