There are purpose-built databases for this purpose such as Dolt (https://www.dolthub.com/), itself purportedly derived from noms (https://github.com/attic-labs/noms). Because it's baked into the database, you can do complex things like diffs and merges, but it requires that you run everything on that RDBMS vs. something standard. Generic diffing from two arbitrary data states of any database is pretty challenging, even if you have all the transaction history.