no-mistakes-postgres-engine 0.109.130

PostgreSQL embedded SQL extraction, schema catalog, and replay-safety analysis for no-mistakes
Documentation
use super::SchemaCatalog;

#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CatalogRowSecurity {
    pub enabled: bool,
    pub forced: bool,
    pub policies: std::collections::BTreeMap<String, PolicyCommand>,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum PolicyCommand {
    All,
    Select,
    Insert,
    Update,
    Delete,
}
impl SchemaCatalog {
    /// Row security evidence for the resolved base relation, when the catalog recorded it.
    pub fn relation_row_security(&self, name: &str) -> Option<&CatalogRowSecurity> {
        let table = self.relation(name)?;
        self.row_security
            .get(&super::names::normalize_table_name(&table.name))
    }
}