Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

Add multiple normalization rules to ForFormat() to handle SQL syntax
variations between formatted output and original queries:

  • AS keyword: normalize optional AS in aliases (e.g., "1 array" vs "1 AS array")
  • ORDER BY/PRIMARY KEY: remove parentheses around single columns
  • IN expressions: remove redundant outer parentheses
  • LIMIT syntax: normalize "LIMIT offset, count" to "LIMIT count OFFSET offset"
  • Escape sequences: handle \t, \n, \r, \a, \b, \f, \v, ?, ", \xNN escapes
  • Dot spacing: normalize "system . one" to "system.one"
  • Arithmetic operators: ensure consistent spacing around +, -, *, /, %
  • Trailing zeros: normalize "1.0" to "1"

Add multiple normalization rules to ForFormat() to handle SQL syntax
variations between formatted output and original queries:

- AS keyword: normalize optional AS in aliases (e.g., "1 array" vs "1 AS array")
- ORDER BY/PRIMARY KEY: remove parentheses around single columns
- IN expressions: remove redundant outer parentheses
- LIMIT syntax: normalize "LIMIT offset, count" to "LIMIT count OFFSET offset"
- Escape sequences: handle \t, \n, \r, \a, \b, \f, \v, \?, \", \xNN escapes
- Dot spacing: normalize "system . one" to "system.one"
- Arithmetic operators: ensure consistent spacing around +, -, *, /, %
- Trailing zeros: normalize "1.0" to "1"
@kyleconroy kyleconroy merged commit 8567118 into main Dec 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants