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

Update list of operators for all languages #296

Merged
merged 14 commits into from
Jul 8, 2022

Conversation

inferrinizzard
Copy link
Collaborator

@inferrinizzard
Copy link
Collaborator Author

inferrinizzard commented Jul 8, 2022

the :: operator is some languages is odd since it's not used with the same spacing, ie. it's usually foo::bar instead of foo :: bar, may move to identifier pattern if needed

@nene
Copy link
Collaborator

nene commented Jul 8, 2022

:: is a type cast operator in Postgres. We definitely shouldn't make it part of an identifier. Just like with the . operator we can simply format it differently from other operators.

https://www.postgresql.org/docs/current/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS

@nene
Copy link
Collaborator

nene commented Jul 8, 2022

src/languages/postgresql.formatter.ts Show resolved Hide resolved
src/languages/postgresql.formatter.ts Show resolved Hide resolved
src/languages/postgresql.formatter.ts Outdated Show resolved Hide resolved
src/languages/tsql.formatter.ts Outdated Show resolved Hide resolved
@inferrinizzard inferrinizzard merged commit b61662e into master Jul 8, 2022
@nene nene deleted the issue/sql-formatter#291 branch July 10, 2022 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse error when using Postgres JSON syntax
2 participants