no-mistakes-postgres-sql 0.109.129

PostgreSQL SQL parsing, statement facts, and identifier extraction for no-mistakes
Documentation
use super::super::idents::ident_key;
use super::{SqlFunctionCallFact, SqlFunctionClause};
use sqlparser::ast::{ObjectName, Spanned};

pub(super) fn record(
    name: &ObjectName,
    clause: Option<SqlFunctionClause>,
    in_cte: bool,
    out: &mut Vec<SqlFunctionCallFact>,
) {
    let parts: Option<Vec<_>> = name
        .0
        .iter()
        .map(|part| part.as_ident().map(ident_key))
        .collect();
    if let Some(name_parts) = parts {
        let start = name.span().start;
        out.push(SqlFunctionCallFact {
            in_cte,
            ..SqlFunctionCallFact::new(
                name_parts,
                start.line.max(1) as usize,
                start.column.max(1) as usize,
                clause,
            )
        });
    }
}