mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 01:44:31 +02:00
Add more STRICT table support (#604)
* Add more STRICT table support per https://github.com/simonw/sqlite-utils/issues/344#issuecomment-982014776. * Make `table.transform()` preserve STRICT mode. * Fix mypy failures in PR #604 * Link to SQLITE strict page in a few places
This commit is contained in:
parent
88bd372205
commit
1500c19bd0
9 changed files with 182 additions and 5 deletions
|
|
@ -530,3 +530,12 @@ def test_transform_preserves_rowids(fresh_db, table_type):
|
|||
tuple(row) for row in fresh_db.execute("select rowid, id, name from places")
|
||||
)
|
||||
assert previous_rows == next_rows
|
||||
|
||||
|
||||
@pytest.mark.parametrize("strict", (False, True))
|
||||
def test_transform_strict(fresh_db, strict):
|
||||
dogs = fresh_db.table("dogs", strict=strict)
|
||||
dogs.insert({"id": 1, "name": "Cleo"})
|
||||
assert dogs.strict == strict or not fresh_db.supports_strict
|
||||
dogs.transform(not_null={"name"})
|
||||
assert dogs.strict == strict or not fresh_db.supports_strict
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue