Skip to content

fix: auto-commit delete_where()#731

Open
cloudyun888 wants to merge 1 commit intosimonw:mainfrom
cloudyun888:fix/delete-where-autocommit-159
Open

fix: auto-commit delete_where()#731
cloudyun888 wants to merge 1 commit intosimonw:mainfrom
cloudyun888:fix/delete-where-autocommit-159

Conversation

@cloudyun888
Copy link
Copy Markdown

@cloudyun888 cloudyun888 commented Apr 22, 2026

Summary

  • wrap Table.delete_where() in the same connection context manager used by delete() and update()
  • make deletes visible to a new connection immediately instead of leaving them uncommitted
  • add a file-backed regression test that reproduces the missing auto-commit behavior

Testing

  • .venv/bin/python -m pytest tests/test_delete.py -q
  • .venv/bin/python -m py_compile sqlite_utils/db.py tests/test_delete.py
  • manual repro: delete rows from a file-backed database, reopen it, verify row count stays at 0

Fixes #159


📚 Documentation preview 📚: https://sqlite-utils--731.org.readthedocs.build/en/731/

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.

.delete_where() does not auto-commit (unlike .insert() or .upsert())

2 participants