The following teaches git how to convert an SQLite database into text that can be usefully diffed:

# .gitconfig / .git/config
[diff "sqlite3"]
    binary = true
    textconv = echo .dump | sqlite3

All that’s left is teaching git how to recognize SQLite files. I’m not aware of any way to teach it about magic bytes or the file command1 so I’ve resorted to pattern matching:

# .gitattributes
*.db diff=sqlite3

(originally)

  1. Please write in if you do!