aquametalabs / aquameta

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

bundle: add write blocking triggers on bundle.rowset* #286

Open erichanson opened 9 months ago

erichanson commented 9 months ago

Now that head_commit_row and head_commit_field are becoming materialized views for great speed, the internal tables rowset, rowset_row and rowset_row_field, and maybe blob as well, could (should?) have write-blocking triggers for insert, update and delete. They should never be modified directly. They should never change except in functions bundle_csv_import(), commit() and commit_delete(). These functions should temporarily disable the write triggers, make whatever changes, and then re-enable them, then refresh the materialized views.

erichanson commented 9 months ago

Or maybe use permissions? Once we get the requirement of being superuser out of checkout(), this could at least be possible.