Triggers

From MemCP
Revision as of 13:03, 21 August 2026 by Carli (talk | contribs) (Created page with "MemCP supports persistent BEFORE and AFTER triggers for INSERT, UPDATE, and DELETE. Trigger bodies can read <code>OLD</code> and <code>NEW<</code>, assign permitted <code>NEW</code> values, run conditional BEGIN/END bodies, and execute supported DML including <code>INSERT … SELECT</code>. Multiple triggers execute by registered priority. AFTER work may be configured as asynchronous, in which case its completion and failure are not identical to the originating statemen...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

MemCP supports persistent BEFORE and AFTER triggers for INSERT, UPDATE, and DELETE. Trigger bodies can read OLD and NEW<, assign permitted NEW values, run conditional BEGIN/END bodies, and execute supported DML including INSERT … SELECT.

Multiple triggers execute by registered priority. AFTER work may be configured as asynchronous, in which case its completion and failure are not identical to the originating statement's synchronous path. Trigger changes participate in transaction/savepoint recovery.

MemCP also uses hidden system triggers to enforce constraints and maintain computed columns, group caches, prejoins, and invalidation dependencies. User DROP/CASCADE behavior must not delete unrelated data; lifecycle callbacks are not general garbage collectors.

Test trigger persistence across restart, multi-row statements, NULL/default handling, errors, ordering, cross-table writes, and rollback. Recursive trigger graphs should be treated with particular care.