Skip to main content

Module scope

Module scope 

Source
Expand description

Scope Analysis Module

This module provides scope analysis for SQL queries, enabling detection of correlated subqueries, column references, and scope relationships.

Ported from sqlglot’s optimizer/scope.py

Structs§

ColumnRef
A column reference found in a scope
Scope
Represents a scope in a SQL query
SourceInfo
Information about a source (table or subquery) in a scope

Enums§

ScopeType
Type of scope in a SQL query

Functions§

build_scope
Build scope tree from an expression
find_all_in_scope
Find all expressions matching the predicate within this scope.
find_in_scope
Find the first expression matching the predicate within this scope.
traverse_scope
Traverse an expression by its “scopes”.
walk_in_scope
Walk within a scope, yielding expressions without crossing scope boundaries.