News for hackers. Stuff that matters.
Re:Tracking SQLite Database Changes in Git by z29LiTp5qUC30n on Thursday November 02, 2023 @08:13AM (#38112412)
does no one know about _A tables anymore? This has been a solved thing since the 1970s
Re:Tracking SQLite Database Changes in Git by jsd1982 on Thursday November 02, 2023 @08:22AM (#38112503)
Can you elaborate? I've been coding since the 90s and have never heard the term _A table before.
Re:Tracking SQLite Database Changes in Git by z29LiTp5qUC30n on Thursday November 02, 2023 @09:27AM (#38113212)
sometimes called audit or journal tables.

Every time something is updated or deleted, the entire previous record is inserted into its corresponding _A table with who did it and when (and optionally for what transaction number)

so delete from foo results in an insert into foo_A before the delete occurs. so update to bar results in an insert into bar_A before the update occurs and rolling back a delete results in picking the old values out of the _A table and rolling back an update results in picking the old values out of the _A table and inserting the current values into the _A table before the updating the main table.

Re:Tracking SQLite Database Changes in Git by maxisaurus on Thursday November 02, 2023 @10:11AM (#38113771)
I guess there's plenty of technical solutions to track changes, like scd or snapshots or audit tables - what I find interesting about git approach it's that it's much more user-friendly vs. SQL archeology to understand what changed?