Can we stream changes in data across all tracked tables for visualising purposes #183
Replies: 3 comments 3 replies
-
That's an interesting idea. Currently, it's not possible but I think we can add NOTIFY calls into a trigger. You can try it on your own: run |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response @palkan , this NOTIFY thing in postgres is interesting, its kind of webhooks(you know how rails devs usually don't use much of the goodies the DBMS engines provide, this is one of them, i just got to know this now). I suppose where it will end up will be maintaining a kind of a duplicate table, or at-least a table which contains serialized string of changes in our desired format with timestamps, and than we will use that table to stream changelogs etc. I was thinking of something with the mixup of paper_trail and logidze to solve our problem as well as maintain distributed per-record changelogs. |
Beta Was this translation helpful? Give feedback.
-
What about single table changelogs streaming? |
Beta Was this translation helpful? Give feedback.
-
I know this might not sound like a good use case, but we do have a valid use case and requirement where we stream change-logs from our paper_trail's table in an HTML view/table (of-course we serialise the records things).
While I convinced my team to switch to logidze and avoid some over heads and 1 giant table with all changes, this 1 thing has us wondering if we can actually make this transition or not.
So wanted to seek help regarding this, is there a way to stream change-logs from across the DB(all tracked tables) so we can visualize them as they happen. Or so we can just see what things changed in specified time window for some audit purposes.
Thanks for the nice gem 👍
Beta Was this translation helpful? Give feedback.
All reactions