FormatSQL converts an AST statement back into a compact SQL string using the GoSQLX formatter. It is the inverse of ParseSQL and completes the parse-transform-format round-trip. The output uses compact style with minimal whitespace. Use this after applying transforms to obtain the final SQL to exec
(stmt ast.Statement)
| 225 | // sql := transform.FormatSQL(stmt) |
| 226 | // // "SELECT id, name FROM users WHERE active = true LIMIT 10" |
| 227 | func FormatSQL(stmt ast.Statement) string { |
| 228 | return formatter.FormatStatement(stmt, ast.CompactStyle()) |
| 229 | } |
| 230 | |
| 231 | // FormatSQLWithDialect converts an AST statement back into a compact SQL string |
| 232 | // using dialect-specific syntax for row-limiting clauses (TOP for SQL Server, |