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

Warn about missing WHERE inside DELETE or UPDATE #4058

Merged

Conversation

aperfilyev
Copy link
Collaborator

No description provided.


DELETE FROM example WHERE id = 1;

DELETE FROM example;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how I feel about this being linted. I have this for almost every table to prune it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for me, I think in general its a reasonable type of query to run

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if theres a way to have it default off i think id b cool with that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is similar to https://www.jetbrains.com/help/phpstorm/sql-delete-or-update-statement-without-where-clauses.html and it's enabled by default

Anyway, I'm going to turn it off

@aperfilyev
Copy link
Collaborator Author

image

@AlecKazakova AlecKazakova merged commit 0b20ad5 into cashapp:master May 29, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants