On 1 Oct 2009, at 4:10pm, Shaun Seckman (Firaxis) wrote:

> I've been looking into using triggers to create a replay table.   
> This seems to be pretty restrictive in that it requires a trigger to  
> be created for each table and cannot track when tables are dropped  
> or created (documentation says that triggers will not be applied to  
> tables like sqlite_master)
>
> Is there a way around this?

Not really.  It might be best to do it in your software: whenever you  
execute a command on copy A of the database you log (or 'journal') the  
command in another table.  When you synchronise you play back this  
journal against copy B of the database.  It'll work fine as long as  
copy B of the database is not modified by users.  But if you ever  
execute independent commands on copy B of the database then you will  
have a nasty synchronisation problem which cannot be solved in this way.

> Are there any limitations to this?  Will this track any and all SQL  
> actions done to the database or just table data changes?  I'll hunt  
> down the post now :)

It can handle things that change your schema (which columns and  
indexes are in each table, even the creation of a new table) and other  
things too.  If you do the logging in your own code this will work  
fine.  If you use TRIGGERs then you will not see anything except  
INSERT/DELETE/UPDATE.

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

Reply via email to