TransformError() on strict=True if SQLite does not suppor strict

Refs https://github.com/simonw/sqlite-utils/pull/788#issuecomment-4948479356
This commit is contained in:
Simon Willison 2026-07-11 16:35:27 -07:00
commit b73e0e1021
5 changed files with 18 additions and 2 deletions

View file

@ -2634,6 +2634,8 @@ class Table(Queryable):
:param strict: Set to ``True`` to make the table strict or ``False`` to make it
non-strict. Defaults to ``None``, which preserves the existing strict mode.
"""
if strict is True and not self.db.supports_strict:
raise TransformError("SQLite does not support STRICT tables")
types = types or {}
rename = rename or {}
drop = drop or set()