←back to thread

115 points graderjs | 1 comments | | HN request time: 0.216s | source
Show context
codenesium ◴[] No.25004913[source]
Is sqlite not diffable?
replies(3): >>25005043 #>>25005217 #>>25005391 #
jitl ◴[] No.25005043[source]
SQLite database files themselves are binary, which typically isn't diff-able with standard tools, so (eg) git wouldn't show you anything useful unless you configure a special tool for diffing sqlite files.

And in fact, there is a sqlitediff.exe tool for diffing sqlite databases: https://sqlite.org/sqldiff.html

But, it would still be a bummer to store them in git because git won't efficiently track changes between sqlite databases, it'll just add the whole binary blob on every commit. oof.

replies(1): >>25005799 #
framecowbird ◴[] No.25005799[source]
This might be a silly question, but is there a reason why git can't also diff binary files? If I have a huge binary file and I change a few bytes in the middle, what's stopping Git just checking that in as a diff? I don't see what's so special about text...

[edit] just did some research and it looks like Git will store the delta of a binary file in its packfiles, just like a text file. The question is just how delta-able sqlite binary files are.

replies(3): >>25005829 #>>25006385 #>>25006508 #
GordonS ◴[] No.25006385[source]
Diffing is about more than just efficient storage though, it's also about showing a history of human-readable changes (which obv you don't get with a binary format).
replies(1): >>25012651 #
1. graderjs ◴[] No.25012651[source]
That's a good point, thank you