Archetype: sql_schema_notify_trigger_drop.mustache

Table of Contents

Drop counterpart of the notify trigger. sql profile; output projects/ores.sql/drop/{component}/{component}_{entity_plural}_notify_trigger_drop.sql. PostgreSQL `NOTIFY` trigger: fires a channel notification on every `INSERT`, `UPDATE`, or `DELETE` so the application layer can push real-time updates over NATS.

See the Template variable reference for the complete list of available variables and their semantics.

Template

The full template source. Edit here and re-tangle with compass build --direct tangle_codegen_templates to regenerate library/templates/sql_schema_notify_trigger_drop.mustache.

{{! GENERATED FILE — tangled from projects/ores.codegen/library/templates/sql_schema.org. Edit the org source. }}
{{! Template to generate SQL drop script for a domain entity notify trigger }}
{{{sql_license}}}
{{#domain_entity}}

drop trigger if exists {{product}}_{{component}}_{{entity_plural}}_notify_trg on "{{product}}_{{component}}_{{entity_plural}}_tbl";
drop function if exists {{product}}_{{component}}_{{entity_plural}}_notify_fn;
{{/domain_entity}}

See also

Emacs 29.1 (Org mode 9.6.6)