Recognize referential actions as keywords in ON UPDATE/DELETE#849
Recognize referential actions as keywords in ON UPDATE/DELETE#849nene merged 2 commits intosql-formatter-org:masterfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
|
Thanks. |
|
Released in 15.5.2 |
|
Thanks for the review, merge and release! I can confirm that CREATE TABLE orders (
id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
customer_id integer REFERENCES customers (id) ON DELETE CASCADE
); |
|
Hey, I added you as a member of the sql-formatter-org "team". |
|
Oh wow, that's an honor, thank you! I will look to make more time to contribute here in the next months! |
|
That's great to hear ❤️ You should now have push access to the repository. Feel free to push directly any trivial changes. For larger changes and things you're not certain of, a pull request would be nice. Or you can also do a pull request that you then immediately merge by yourself, as a sort of "I'm letting you know I'm doing this". Use your own best judgement. If you're missing some permissions, ping me. |
|
Yes, I think I'll probably do PRs for everything anyway, just as a way of communication to everyone 👍 Thanks! |
Hi @nene, hope you're good! 👋
Currently,
sql-formatter@15.5.1does not recognize the PostgreSQLCASCADE,NO ACTIONorRESTRICTreferential actions as keywords.This means that if identifiers are configured to be lowercased, the referential actions will be lower cased, eg.
ON DELETE cascade:This PR adjusts the
reservedPhrasesfor PostgreSQL to add theCASCADE,NO ACTIONandRESTRICTkeywords as suffixes forON UPDATEandON DELETE.