no-mistakes-postgres-sql 0.109.131

PostgreSQL SQL parsing, statement facts, and identifier extraction for no-mistakes
Documentation
use crate::fx::{fx_map, FxHashMap};
use sqlparser::ast::SetExpr;

pub(super) struct BlockingStatuses {
    // Keys point into the borrowed query AST; this map is dropped before bound_body returns.
    pub(super) by_set: FxHashMap<*const SetExpr, bool>,
    pub(super) visits: usize,
}

impl BlockingStatuses {
    pub(super) fn new() -> Self {
        Self {
            by_set: fx_map(),
            visits: 0,
        }
    }

    pub(super) fn complete(&mut self, set: &SetExpr) -> bool {
        self.visits += 1;
        self.by_set[&(set as *const SetExpr)]
    }
}