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
use sqlparser::ast::{Expr, InTarget};

pub(super) fn is_list_or_subquery(target: &InTarget) -> bool {
    matches!(target, InTarget::List(_) | InTarget::Subquery(_))
}

pub(super) fn is_subquery_value(expr: &Expr) -> bool {
    matches!(
        expr,
        Expr::Subquery(_)
            | Expr::Exists { .. }
            | Expr::In {
                target: InTarget::Subquery(_),
                ..
            }
    )
}