Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL formatter doesn't like ~ in statements #98

Open
zjpersc opened this issue May 17, 2024 · 1 comment
Open

SQL formatter doesn't like ~ in statements #98

zjpersc opened this issue May 17, 2024 · 1 comment

Comments

@zjpersc
Copy link

zjpersc commented May 17, 2024

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
@drodil
Copy link
Owner

drodil commented May 17, 2024

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?

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

No branches or pull requests

2 participants