DataGrip 2024.1 Help

Code Inspection: Delete or update statement without where clauses

Reports usages of DELETE or UPDATE statements without WHERE clauses.

Without WHERE clauses, DELETE drops all the data from the table, and UPDATE overwrites values for all the table rows.

Example (MySQL):

CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN); update t1 set a = 'Smith'; delete from t1;

Suppress an inspection in the editor

  1. Place the caret at the highlighted line and press Alt+Enter or click the Intention action icon.

  2. Click the arrow next to the inspection you want to suppress and select the necessary suppress action.

Last modified: 11 February 2024