Module ast_formatter

Module ast_formatter 

Source
Expand description

AST-based SQL Formatter

This module provides proper SQL formatting by traversing the parsed AST, which is more reliable than regex-based formatting and handles complex features like CTEs, subqueries, and expressions correctly.

Structs§

FormatConfig
Configuration for SQL formatting

Functions§

format_expression
Format a single SQL expression into a string This is useful for extracting and displaying parts of a query
format_select_statement
Format a SELECT statement into pretty SQL
format_select_with_config
Format a SELECT statement with custom configuration
format_sql_ast
Parse and format SQL query using the AST
format_sql_ast_with_config
Parse and format SQL with custom configuration