Skip to main content

no_mistakes_postgres_sql/statement_facts/
triggers.rs

1use std::path::PathBuf;
2
3/// One `CREATE TRIGGER`.
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub struct SqlTriggerFact {
6    pub table: String,
7    pub function: String,
8    pub period: SqlTriggerPeriod,
9    pub for_each_row: bool,
10    pub events: Vec<SqlTriggerEvent>,
11    pub line: usize,
12    pub column: usize,
13    pub name: String,
14    pub removed: bool,
15    pub source_path: PathBuf,
16}
17
18#[derive(Debug, Clone, Copy, PartialEq, Eq)]
19pub enum SqlTriggerPeriod {
20    Before,
21    After,
22    InsteadOf,
23    Other,
24}
25
26#[derive(Debug, Clone, PartialEq, Eq)]
27pub enum SqlTriggerEvent {
28    Insert,
29    Update { columns: Vec<String> },
30    Delete,
31    Truncate,
32}