On gLinux with SQLite, if autocommit is not explicitly set to False, rollback does not work as expected when a DDL query is accidentally passed in place of a DQL query—even if rollback=True is set in the code (source).
This was discussed in PR #150.
Steps to Reproduce
-
Pass a DDL query (e.g., ALTER TABLE) where a DQL query is expected.
Example:
-
After execution, the change persists—indicating rollback did not occur
As shown above, the column remains renamed to post_content instead of reverting back to the original name: content.
Behavior with autocommit=False
If we explicitly set autocommit=False, the rollback does occur as expected.
Reference:
sqlite.py#L36
Why It Was Removed
However, we had to remove the autocommit=False line because it results in errors when running in Colab:
Notes
- This issue only affects DDL passed as DQL
- DML passed as DQL does not exhibit this rollback issue