feat(ffi): expose sqlglot_generate_pretty with dialect-aware formatting - #24
Conversation
- fix generate_pretty to honor the target dialect (previously ignored) - add Generator::generate_pretty method; deprecate Generator::pretty - add sqlglot_generate_pretty FFI export; update C/C++ examples and docs - bump 0.10.17
|
Thank you for this contribution, @gauravs! This is a clean, well-tested improvement. Making Merged and released in v0.10.21, now live on crates.io. One small adjustment on merge: since Thanks again for helping improve sqlglot-rust! |
Adds pretty-printing to the FFI and fixes
generate_prettyto actually respect the target dialect.Previously
generate_pretty(ast, dialect)ignored itsdialectargument, so formatted output always used source/ANSI quoting instead of the target's.Changes
Before / after
Parsing MySQL and pretty-printing as T-SQL: