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

Unexpected whitespace in casting types #61

Closed
pnezis opened this issue Nov 7, 2024 · 3 comments
Closed

Unexpected whitespace in casting types #61

pnezis opened this issue Nov 7, 2024 · 3 comments

Comments

@pnezis
Copy link

pnezis commented Nov 7, 2024

For the following input:

SELECT birth_date::date FROM users

the following output is produced:

SELECT
  birth_date :: date
FROM
  users

Notice the unexpected whitespace around the casting operator. Expected formatted query:

SELECT
  birth_date::date
FROM
  users
@dkuku
Copy link
Contributor

dkuku commented Nov 7, 2024

do you know if it was working ok on previous version (0.3.0)?

@pnezis
Copy link
Author

pnezis commented Nov 7, 2024

do you know if it was working ok on previous version (0.3.0)?

From a quick test it did not work ok.

Another example that may be more tricky to handle is if the casting is after a closing parenthesis:

SELECT (x - y)::integer FROM table;

@dkuku
Copy link
Contributor

dkuku commented Nov 7, 2024

I made a pr #63

@pnezis pnezis closed this as completed Nov 7, 2024
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