backstage-plugin-toolbox
backstage-plugin-toolbox copied to clipboard
SQL formatter doesn't like ~ in statements
I'm trying to use the SQL Beautifier with a query, but it throws an error if there's a tilde in the query. I'm using version 1.20.3.
Example:
SELECT bar, foo FROM foo_bar WHERE customer_prefix_name ~ '^.*\\d{9}.*$' GROUP BY bar
Error:
Parse error: Unexpected "~ '^.*\\d{" at line 1 column 57
Expected output:
SELECT
bar,
foo
FROM
foo_bar
WHERE
~ customer_prefix_name '^.*\\d{9}.*$'
GROUP BY
bar
Hi, thanks for the report! The tool is using sql-formatter library (https://github.com/sql-formatter-org/sql-formatter) to do the formatting. Maybe this should be reported there or check if there's any open issues about this?