4 ms·
I'm continually going through this thought process: 1. I should make blog engine using flat files. That way I can diff the plain text. 2. But flat files are h
by earthboundkid 2y ago
I'm continually going through this thought process:
1. I should make blog engine using flat files. That way I can diff the plain text.
2. But flat files are hard to read/write structured data from, so I should use SQLite instead.
3. But SQLite is hard to diff. GOTO 1.
- crazygringo 2y agoIn every project of mine with databases, I use a tool to export the schema (without data) as a text SQL file on every commit (as a pre-commit hook), to record any changes. There's no reason you can't do the same but including the content too. That way you're always committing a text friendly version of the database rather than the database binary encoding. And your diffs will work great.
- sureglymop 2y agoBut with sqlite would it be that hard? You could use sqldiff or, even something like this: diff <(sqlite3 db 'select text from posts where id = 1') <(sqlite3 db 'select text from posts where id = 2')
- ajayvk 2y agoThere is a `version files` command to list the files for a version, including the SHA. I plan to add an export command also to make diff easier