When executing an UPDATE statement with a RETURNING clause in sqlit against SQLite, the following error is produced:
cannot commit transaction - SQL statements in progress
Minimal reproduction:
UPDATE jobs
SET status = status
WHERE id = 1
RETURNING id;
No explicit BEGIN/COMMIT is issued.
Expected behavior:
The statement should execute successfully and return the requested row(s).
Observed behavior:
sqlit reports:
cannot commit transaction - SQL statements in progress
Background:
SQLite requires that all prepared statements be fully stepped and finalized before a transaction can commit. This error suggests that sqlit may be implicitly wrapping statements in a transaction and attempting to commit before the RETURNING result set has been fully consumed or finalized.
Question:
Does sqlit fully step through and finalize statements that produce result sets (such as UPDATE ... RETURNING) before committing implicit transactions?
If not, this may explain the observed error.