no-mistakes-postgres-engine 0.109.130

PostgreSQL embedded SQL extraction, schema catalog, and replay-safety analysis for no-mistakes
Documentation
use super::{view_definition::ViewProjections, SchemaCatalog};
use std::collections::{BTreeMap, BTreeSet};
use std::sync::{Arc, OnceLock};

#[derive(Debug, Default)]
pub(super) struct ProjectionCache {
    pub(super) trigger_body_kinds: OnceLock<Result<Vec<super::CatalogTriggerBodyKind>, String>>,
    pub(super) trigger_writes: OnceLock<Result<Vec<super::CatalogTriggerWrites>, String>>,
    pub(super) discriminant_functions: OnceLock<BTreeMap<String, super::discriminant::Guard>>,
    pub(super) count_owners: OnceLock<super::count_owners::CatalogCountOwnerAnalysis>,
    pub(super) scalar_function_names: OnceLock<Arc<BTreeSet<Vec<String>>>>,
    pub(super) view_projections: OnceLock<ViewProjections>,
}

impl SchemaCatalog {
    pub(super) fn projections(&self) -> &ProjectionCache {
        self.projections.get_or_init(Default::default)
    }
}