Skip to content

Instantly share code, notes, and snippets.

@andreievg
Created June 11, 2025 08:09
Show Gist options
  • Save andreievg/7036c79f5ee430a2c129067e52ab9e24 to your computer and use it in GitHub Desktop.
Save andreievg/7036c79f5ee430a2c129067e52ab9e24 to your computer and use it in GitHub Desktop.
4D database diff
// FOR SMALL DATABASES ONLY
// mkdir /Users/andreievg/Documents/playground/4ddatabasediff/
// cd /Users/andreievg/Documents/playground/4ddatabasediff/
// git init
// github (opens github desktop)
// run this method (put breakpoint at the end to know it's finished)
// commit
// do some operations
// see diff
$tBasefolder:="/Users/andreievg/Documents/playground/4ddatabasediff/"
For each ($tableName; OB Keys(ds))
$records:=ds[$tableName].all()
File($tBasefolder+$tableName+".json").setText(JSON Stringify($records.toCollection(); *); "UTF-8"; Document with LF)
End for each
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment