I wouldn't initially need to support schema changes, just data
changes. And actually only data additions (INSERTs) as the first use
case. So diffing the .dumps would probably suffice. But later, I'd
want to handle UPDATE and DELETE.

I'm sure I can write a small utility in Perl but just wanted to check
if it had been done before. If not, I'll give it a shot and post my
results back here.

L

On 6 March 2012 21:28, Simon Slavin <slav...@bigfraud.org> wrote:
>
> On 6 Mar 2012, at 1:19pm, Larry Knibb <larry.kn...@gmail.com> wrote:
>
>> Is there already an established mechanism for diffing two SQLite
>> databases and creating a SQL patch file?
>>
>> So not a GUI diff tool (like
>> http://download.cnet.com/SQLite-Diff/3000-10254_4-205921.html) for
>> looking at the diffs, but something to generate the SQL to upgrade an
>> old database to a new one.
>
> Interesting idea.  You could use the .dump command of the shell tool to 
> create SQL dumps of each database, then diff those.  I think that might be a 
> useful start.
>
> But actually, it wouldn't be too difficult to write a program to do what you 
> want, as long as you can make certain assumptions.  For instance, that the 
> schema aren't going to change.  You could deal with indexes being created or 
> destroyed, but it would be tricky to deal with table columns being changed.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to