How to do the versioning with a history table in Peewee?

188 views Asked by At

I have one ETL tool to read data from various files and stores it in MySQL using Peewee ORM. Now I want to keep store all the fields that will update in a different table. Do we have any plug & play type solution in Peewee? Please help me out.

1

There are 1 answers

0
coleifer On BEST ANSWER

This may help get you started: https://github.com/coleifer/peewee/blob/master/playhouse/sqlite_changelog.py

The idea is to use triggers and json functions to populate a changelog table. You could modify it to work with postgres or mysql.