aquametalabs / aquameta

Web development platform built entirely in PostgreSQL
GNU General Public License v3.0
1.1k stars 52 forks source link

bundle: support tracked relations #252

Open erichanson opened 1 year ago

erichanson commented 1 year ago

Right now, every row a bundle tracks has to be explicitly tracked via tracked_row_add(). However, if you just want to track all rows in a particular table, a reasonable scenario, there's no way to do that with a single rule. Add support for tracked relations.

function bundle.tracked_relation_add(meta.relation_id) tracks an entire table (or view for that matter, as long as it has a unique pk), and inserts into a bundle.tracked_relation table. The bundle.tracked_row view would need to look at bundle.tracked_relation and dynamically add new rows. bundle.stage_row would need to automatically add new rows, I think?