Why
In khepri_mnesia_migration, we use the ability to switch Mnesia tables to read-only to prevent further updates at the end of a copy from Mnesia to Khepri.
It would be nice to have a similar mechanism to be able to implement the opposite direction: a copy from Khepri to Mnesia.
How
- It could be a store-wide flag to switch the entire store to read-only.
- We could have per-path-pattern flags to provide a more fine-grained solution.
- Another option is to accept a stored procedure to programmatically decide if an update (or any operation in fact) is allowed or not.