On 13 Oct 2019, at 10:23pm, Adam Levy <theadaml...@gmail.com> wrote:

> My application requires a way to build a "pending state" in the database 
> while allowing users to query data from both the "official state" and the 
> "pending state". I am achieving this using sessions and snapshots.

You are depending on finicky behaviour of SQLite.  You will have to learn a lot 
about it to use it correctly.  It may change or disappear sometime in the far 
future.  It is impossible to reproduce in any other SQL implementation.

Instead of seizing on a slight resemblance between your needs and an obscure 
internal feature of SQLite, implement your feature properly.  Maintain two 
databases: official and pending, and a list of SQL commands required to turn 
'pending' into 'official' (as a text file, or a table in one of those two 
databases, or a table in another database).

This is crash-proof and can be backed up.  It gives a solution which is far 
more easy to audit, and can be easily understood by anyone who might have to 
take over programming your application.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to