On Thu, Jul 8, 2010 at 12:23 PM, Jay A. Kreibich <j...@kreibi.ch> wrote:

> > First Proposed Change:
> >
> > (1) and (2) are the same.
> >
> > (3) PRAGMA journal_mode=MODE;  -- set the mode to MODE for all attached
> > databases.  Databases created by subsequent ATTACH use MODE.  Existing
> > databases added by ATTACH use MODE if and only if doing so does not
> require
> > them to change in or out of WAL mode.
>
> > (4) PRAGMA journal_mode;  -- report the most recent setting by (3).  Or
> if
> > (3) has never been used, work the same as "PRAGMA main.journal_mode;"
>
> >
>  Contexts are generally bad.  This is even more true if there might
>  ever be a way to change the compile time default journal mode to
>  anything other than "delete."  Then there is no way to get the default.
>

Agreed.

Since sending the prior email, internal discussion has moved us in the
direction of eliminating the "default journal mode" all together.  This
makes both the code and documentation smaller, which implies that it will
also make things easier to understand.

So probably we'll end up with something like this:

PRAGMA name.journal_mode=MODE; -- set the mode of database "name" to MODE.
PRAGMA name.journal_mode;  -- report the mode of database "name".
PRAGMA journal_mode; -- an alias for "PRAGMA main.journal_mode"
PRAGMA journal_mode=MODE;  -- set the mode of all currently ATTACHed
databases.

When new databases are ATTACH-ed, they come up in either DELETE or WAL mode
(depending on how they were last closed) and must be changed to whatever the
application desires using a new PRAGMA journal_mode call.  No more trying to
guess what the application wants and apply that as a default.

This is ever-so-slightly incompatible with prior SQLite versions, but on the
other hand, we never have promised to maintain PRAGMA compatibility, and if
we are going to change something, it seems like 3.6->3.7 is a good time to
change it.


-- 
---------------------
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to