Expand description
Type annotation and coercion for SQL expressions Type Annotation for SQL Expressions
This module provides type inference and annotation for SQL AST nodes. It walks the expression tree and assigns data types to expressions based on:
- Literal values (strings, numbers, booleans)
- Column references (from schema)
- Function return types
- Operator result types (with coercion rules)
Based on SQLGlot’s optimizer/annotate_types.py
Structs§
- Type
Annotator - Type annotation configuration and state
Enums§
- Type
Coercion Class - Type coercion class for determining result types in binary operations. Higher-priority classes win during coercion.
Functions§
- annotate_
types - Convenience function to annotate types in an expression tree