no-mistakes-postgres-sql 0.109.130

PostgreSQL SQL parsing, statement facts, and identifier extraction for no-mistakes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Pins retained when compaction discards the original FROM scope.
use crate::SqlPinSource;

pub(super) fn independent(source: &SqlPinSource) -> bool {
    match source {
        SqlPinSource::Value => true,
        SqlPinSource::Array {
            items,
            scalar_columns,
            indexed_columns,
            ..
        } => {
            // Cast evidence stays on the pin for catalog validation; no row evidence may remain.
            [items.len(), scalar_columns.len(), indexed_columns.len()] == [0; 3]
        }
        _ => false,
    }
}