如何区分2个SQLite文件? [英] How can I diff 2 SQLite files?

查看:135
本文介绍了如何区分2个SQLite文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mac上使用SQLite-manager(以XUL形式)。

Using SQLite-manager (in its XUL form) on a Mac.

如何从团队中其他人提交的SQLite文件中区分出来,并合并他的更改?

How can I diff a SQLite file from one submitted by someone else on the team, and incorporate his changes?

谢谢。

推荐答案

我相信你可以使用以下方法,组合:

I believe you could use the following, in combination:

$ diff sqlite-file-1.sql sqlite-file-2.sql > sqlite-patch.diff
$ patch -p0 sqlite-file-1.sql sqlite-patch.diff

我希望这对你有用。否则,我强烈建议查阅手册页:

I hope that works for you. Otherwise, I highly suggest consulting the man-pages:

$ man diff
$ man patch

编辑:好的,这是完整的演练。

Alright, here's the whole walk-through.

首先,转储数据库:

$ sqlite test1.sql .dump > test1.sql.txt
$ sqlite test2.sql .dump > test2.sql.txt

接下来,生成一个diff文件:

Next, generate a diff file:

$ diff -u test1.sql.txt test2.sql.txt > patch-0.1.diff

最后,要应用补丁:

$ patch -p0 test1.sql.txt patch-0.1.diff

这篇关于如何区分2个SQLite文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆