Source: /cirosantilli/sql-trigger

= SQL TRIGGER
{c}
{tag=Database trigger}
{wiki}

<SQL>'s implementation of <database triggers>.

This feature is really cool, as it allows you to keep caches up to date!

In particular, everything that happens in a trigger happens as if it were in a transaction. This way, you can do less explicit transactions when you use triggers. It is a bit like the advantages of <SQL CASCADE>.

<DBMS>:
* <PostgreSQL>:
  * https://stackoverflow.com/questions/24870416/counter-cache-column-in-postgresql
* <SQLite>
  * https://stackoverflow.com/questions/35255304/sqlite-create-trigger-for-insert-or-update

<ORM>:
* <Sequelize>: <SQL TRIGGER in Sequelize>