You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest using this to allow "pretty-printing" SQL statements, including newlines.
Currently, long queries printed by sqlparser are hardly human-readable, since they are displayed as a single long line of text. We could allow displaying them with newlines between keywords and expressions when they are printed with {:#}
this is also a potential more feasible alternative to #1634
If the idea is that {:#} printing of AST nodes would result in printing a "pretty" version of the sql statements (potentially with newlines, etc) sounds like a great idea to me
lovasoa
added a commit
to lovasoa/sqlparser-rs
that referenced
this issue
May 9, 2025
In rust, the Display trait allows specifying an "alternate" display style for every type:
https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.alternate
I suggest using this to allow "pretty-printing" SQL statements, including newlines.
Currently, long queries printed by sqlparser are hardly human-readable, since they are displayed as a single long line of text. We could allow displaying them with newlines between keywords and expressions when they are printed with
{:#}
this is also a potential more feasible alternative to #1634
I could implement this myself.
What do you think, @alamb , @iffyio ?
The text was updated successfully, but these errors were encountered: