no-mistakes-postgres-sql 0.109.129

PostgreSQL SQL parsing, statement facts, and identifier extraction for no-mistakes
Documentation
use std::path::PathBuf;

/// One `CREATE TRIGGER`.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SqlTriggerFact {
    pub table: String,
    pub function: String,
    pub period: SqlTriggerPeriod,
    pub for_each_row: bool,
    pub events: Vec<SqlTriggerEvent>,
    pub line: usize,
    pub column: usize,
    pub name: String,
    pub removed: bool,
    pub source_path: PathBuf,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SqlTriggerPeriod {
    Before,
    After,
    InsteadOf,
    Other,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SqlTriggerEvent {
    Insert,
    Update { columns: Vec<String> },
    Delete,
    Truncate,
}