Runs upstream type inference over the AST. With a schema, column
references resolve to their declared types; without one, only types that
can be inferred from literals, casts and function signatures are filled.
Arguments
- sql
A single character string with one or more SQL statements (separated by
;).- dialect
Dialect used for parsing.
- schema
Optional schema specification (see
as_polyglot_schema()); improves resolution of unqualified or ambiguous columns.
Value
A polyglot_ast object whose nodes carry an inferred_type field
where a type could be determined. Pass it to sql_generate() to render,
or inspect $statements directly.