Created
April 14, 2022 16:00
-
-
Save chandu-io/b853c827071c6f0948bda443bca2e45f to your computer and use it in GitHub Desktop.
jatin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Diff Table | |
| id | version | patch | | |
---------------------------- | |
| 1 | 001 | {...} | | |
| 1 | 002 | {...} | | |
| 1 | 003 | {...} | | |
| 2 | 001 | {...} | | |
| 2 | 002 | {...} | | |
Json Blob Table | |
| id | latest_version | json-blob | | |
---------------------------- | |
| 1 | 003 | {...} | | |
| 2 | 002 | {...} | | |
select * from diff_table where id = '1' | |
| 1 | 001 | {...} | | |
| 1 | 002 | {...} | | |
| 1 | 003 | {...} | | |
const jsonObj = Diff.applyPatches([...rows.map(r = > r.patch)]) | |
Map<string, Map<string, string>> => id -> version -> patch | |
https://www.npmjs.com/package/diff | |
https://www.npmjs.com/package/react-diff-view | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment