Skip to content

Instantly share code, notes, and snippets.

@chandu-io
Created April 14, 2022 16:00
Show Gist options
  • Save chandu-io/b853c827071c6f0948bda443bca2e45f to your computer and use it in GitHub Desktop.
Save chandu-io/b853c827071c6f0948bda443bca2e45f to your computer and use it in GitHub Desktop.
jatin
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