Skip to main content

no_mistakes_postgres_sql/function_calls/
fact.rs

1use super::SqlFunctionClause;
2
3/// One function expression, excluding column and alias identifiers.
4#[derive(Debug, Clone, PartialEq, Eq)]
5#[non_exhaustive]
6pub struct SqlFunctionCallFact {
7    pub name_parts: Vec<String>,
8    pub line: usize,
9    pub column: usize,
10    /// None for calls outside the supported clauses, including FROM and GROUP BY.
11    pub clause: Option<SqlFunctionClause>,
12    #[doc(hidden)]
13    pub in_cte: bool,
14}
15
16impl SqlFunctionCallFact {
17    /// Construct a call fact outside a CTE.
18    pub fn new(
19        name_parts: Vec<String>,
20        line: usize,
21        column: usize,
22        clause: Option<SqlFunctionClause>,
23    ) -> Self {
24        Self {
25            name_parts,
26            line,
27            column,
28            clause,
29            in_cte: false,
30        }
31    }
32}