pub fn declare_trigger(
catalog: &Catalog,
trigger_spec: &Value,
now: u64,
) -> Result<Catalog, HaysonSchemaError>Expand description
db.declareTrigger() — adds a declarative AFTER trigger to triggers[]. trigger_spec.table
and trigger_spec.effect.table must already be declared tables of catalog (checked by
parse_trigger_entry before anything else runs, ADR-s21j/0029): a spec naming an undeclared
table is refused here, before Database::declare_trigger ever reaches disk. Nothing is written
when it refuses — the catalog handed back on success is the only side effect, write_catalog is
left to the caller (mirrors declare_index).