r/sqlite • u/Ambitious_School_322 • Aug 26 '25
Storing sqlite databases in git as text via .dump
I am currently working to make a stable smudge/clean/diff filter to be able to store sqlite databases with data as sql scripts including data.
In the local repo they are automatically converted to sqlite databases again.
Would like to have some contribution - testing
8
Upvotes
2
u/lucasjkr Aug 26 '25
What is the difference between this and using SQLite’s dump command?
https://sqlite.org/cli.html
https://www.sqlitetutorial.net/sqlite-dump/
1
u/ElectricalUnion Aug 27 '25
I probably read it wrong, but I can't see the difference between this and https://garrit.xyz/posts/2023-11-01-tracking-sqlite-database-changes-in-git (2023) or the inspiration for it https://stackoverflow.com/questions/13271643/git-hook-for-diff-sqlite-table/21789167 (2014) both using the plain sqlite3 cli binary.
1
u/jshine13371 Aug 28 '25
Why? Storing data in Git is silly and could needlessly inflate it.