-
Notifications
You must be signed in to change notification settings - Fork 391
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
[FORMATTING] Field named "password" converted to uppercase when "keywordCase" is "upper" #709
Comments
Thanks for reporting. The PostgreSQL keywords list currently contains too many non-reserved keywords, like |
Related to #156 |
Fixed and released in 15.2.0 |
@nene this is now causing the following, is this expected? CREATE TABLE animals (
id integer PRIMARY key generated always AS identity
); Config (attempt to match style of official PostgreSQL docs): {
language: 'postgresql',
keywordCase: 'upper',
identifierCase: 'lower',
dataTypeCase: 'lower',
functionCase: 'lower',
} This is an unusual formatting of Before this change, the formatting resulted in the common style in the ecosystem: CREATE TABLE animals (
id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY
); |
Yep, that's an unfortunate side-effect of this change. Basically there are two choices in SQL Formatter:
For most people, who want the keywords to be uppercased, the first one is more of a problem than the latter. The latter becomes a larger issue when you use the I could implement some patches to detect sequences like |
Makes sense, definitely! If you think it's ok to add some sequences, I will help testing the sequences (and proposing any other sequences) |
If you're interested in making a pull request, it's pretty much just a matter of adding these sequences to the reservedPhrases array. |
ah ok that looks not so scary, opening a PR now |
Input data
Which SQL and options did you provide as input?
Expected Output
Actual Output
Usage
And the config is this
What SQL language(s) does this apply to?
PostgreSQL
Which SQL Formatter version are you using?
15.1.3
The text was updated successfully, but these errors were encountered: