Rows are changed one at a time in a loop over a cursor or query
What it finds
A loop over a cursor that changes rows one at a time, as in WHILE @@FETCH_STATUS = 0 ... UPDATE ... FETCH NEXT or FOR r IN (SELECT ...) LOOP UPDATE ..., sends one statement per row; a single set-based UPDATE ... FROM or MERGE does the same work at once.
From the rule's source, cursor_loop.rs.
Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/sql:cursor-loop" = "warning"To keep one finding, suppress it with a reason: tx0 suppress ID --reason "..." writes the comment for it.
tx0 explain tx0/sql:cursor-loop shows the same in the terminal. Found a false positive? Report it.