Cory Nelson wrote:
> On Sun, Oct 10, 2010 at 8:51 PM, Darren Duncan <dar...@darrenduncan.net> 
> wrote:
>> I think that it should be possible to configure SQLite to be strictly 
>> read-only
>> in every respect, such that if with such configuration SQLite is told to 
>> open a
>> database that would need updating from a journal or WAL, it would fail with 
>> some
>> appropriate error rather than fixing the database.  This in contrast to the
>> approach of apply the journal or WAL and then don't change anything further; 
>> the
>> latter is also important to support but users should have a choice between 
>> the
>> two options. -- Darren Duncan
> 
> +1

Oh!  Oh!  I just thought of a third option ...

SQLite can be configured to be strictly read-only in every respect but that if 
the database would need updating from a journal or WAL, SQLite would go ahead 
and do this but only in mapped memory whether plain RAM or a shadow file in a 
temp directory.  This option means absolutely no changes to the actual SQLite 
database files but users would then still be able to read from the database.

There should be a number of applications for that scenario, and as far as I 
know 
SQLite already practices some memory mapping so much of the necessary code may 
already exist.

Or a stripped down version of this is that SQLite can apply the journal/WAL to 
a 
copy of the database file it first makes in a temp directory, and then use that 
readonly as usual.

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

Reply via email to