pondersource / prejournal

An experimental bookkeeping tool that sits between source documents and journals
https://prejournal.org
MIT License
2 stars 2 forks source link

Try out idempotent pull #141

Closed michielbdejong closed 1 year ago

michielbdejong commented 1 year ago

The reset script from https://github.com/pondersource-books/time does not survive being run twice, it would lead to duplicate data.

It would be nice to have a script that just pulls the latest data from timeld-org and timesheet-dev3-evoludata-com and repairs / complements whatever is already in the database.

michielbdejong commented 1 year ago

See if I can get that working today so I can still include it in https://github.com/federatedbookkeeping/timesheets/issues/52

michielbdejong commented 1 year ago

Should be easy enough, for WikiSuite we can deduplicate on the first column, "URI" with values like https://timesheet.dev3.evoludata.com/api/trackers/2/items/75, and for Timeld we can deduplicate on "@id" with values like ttT3H46tvCQEux7tE7TnoL/1 Store those in the statement, and then do an UPDATE instead of an INSERT if an entry is already present.