Skip to content

Structure

SQLCreateTrigger

An expression representing a CREATE TRIGGER query. Used to create new triggers for actions on a table.
struct SQLCreateTrigger

Overview

CREATE CONSTRAINT TRIGGER "trigger"
    DEFINER=foo
    AFTER UPDATE OF "column1", "column2" ON "table"
    FROM "other_table" NOT DEFERRABLE
    FOR EACH ROW
    WHEN ("column3"="four")
    FOLLOWS "other_trigger"
BEGIN
    ...
END;

When used with the PostgreSQL driver, SQLCreateTrigger performs strong validation of its properties with respect to PostgreSQL’s syntax restrictions. In general, the dialect specifies in granular detail exactly which features it supports; properties specifying features not supported by the dialect are generally ignored, except with respect to the trigger body/procedure and the definer (if specified), which are validated by assertion (a runtime error results from invalid use in debug builds, whereas invalid syntax is silently emitted in release builds so that the database will report the issue).

See SQLCreateTriggerBuilder.

Topics

Initializers

Instance Properties

Instance Methods

Enumerations

  • enum EachSpecifier
    Specifies whether a trigger executes for each row affected by an event or once for each triggering statement.
  • enum EventSpecifier
    Specifies an event which causes a trigger to execute.
  • enum OrderSpecifier
    Specifies ordering for a trigger relative to another trigger.
  • enum TimingSpecifier
    Specifies the deferability of a contraint trigger vis a vis the associated constraint.
  • enum WhenSpecifier
    Specifies how a trigger executes relative to the event that triggers it.

Relationships

Conforms To

See Also

Query Expressions

  • struct SQLAlterEnum
    An expression representing an ALTER TYPE query. Used to add new cases to enumeration types.
  • struct SQLAlterTable
    An expression representing an ALTER TABLE query. Used to modify the structure of existing tables.
  • struct SQLCreateEnum
    An expression representing a CREATE TYPE query. Used to create enumeration types.
  • struct SQLCreateIndex
    An expression representing a CREATE INDEX query. Used to add indexes over columns to an existing table.
  • struct SQLCreateTable
    An expression representing a CREATE TABLE query. Used to create new tables.
  • struct SQLDelete
    An expression representing a CREATE TRIGGER query. Used to remove rows from a table.
  • struct SQLDropEnum
    An expression representing a DROP TYPE query. Used to delete enumeration types.
  • struct SQLDropIndex
    An expression representing a DROP INDEX query. Used to delete indexes from tables.
  • struct SQLDropTable
    An expression representing a DROP TABLE query. Used to delete entire tables.
  • struct SQLDropTrigger
    An expression representing a DROP TRIGGER query. Used to delete triggers.
  • struct SQLInsert
    An expression representing an INSERT query. Used to add new rows to a table.
  • struct SQLSelect
    An expression representing a SELECT query. Used to retrieve rows and expression results from a database.
  • struct SQLUnion
    An expression representing two or more SELECT queries joined by UNION clauses. Used to merge the results of multiple queries into a single result set.
  • struct SQLUpdate
    An expression representing an UPDATE query. Used to modify existing rows in a single table.