Skip to content

Persist strict=False overrides in Table.create() - #949

Open
monster437 wants to merge 1 commit into
simonw:mainfrom
monster437:fix/948-persist-strict-false
Open

monster437 wants to merge 1 commit into
simonw:mainfrom
monster437:fix/948-persist-strict-false

Conversation

@monster437

@monster437 monster437 commented Nov 15, 2026 •

Copy link
Copy Markdown

When a Table is created with strict=True, then replaced using
strict=False, a subsequent create(..., replace=True) call that omits
strict unexpectedly restores STRICT mode. create() only saves truthy
strict values to _defaults, leaving the earlier True in place.

Save non-None values so explicit False overrides persist. Add a
parameterized regression test that checks both override directions and
verifies that a later replacement inherits the updated setting.

Fixes #948

Validation on Windows, Python 3.12.13, SQLite 3.50.4:

  • New regression test against the unchanged base: 1 failed, 1 passed;
    against the fix: 2 passed.
  • Full test suite: 1498 passed, 17 skipped. Skips cover optional dependencies,
    compiled extensions, and platform-specific behavior.
  • Black, Flake8, mypy, Pyright, and Cog checks passed.
  • ty check sqlite_utils reports a pre-existing redundant-cast warning at
    sqlite_utils/db.py:4792. The unchanged base commit reports the same warning.

The implementation and regression test were prepared with AI assistance and
validated locally.


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

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.

Explicit strict=False cannot clear a previously stored strict default

1 participant