Use REAL for floating point columns if table is strict, closes #644

Refs #645
This commit is contained in:
Simon Willison 2024-11-23 14:27:21 -08:00
commit 4dc2e2e9c8
4 changed files with 17 additions and 3 deletions

View file

@ -2416,11 +2416,13 @@ def test_create_table_strict(strict):
db = Database("test.db")
result = runner.invoke(
cli.cli,
["create-table", "test.db", "items", "id", "integer"]
["create-table", "test.db", "items", "id", "integer", "w", "float"]
+ (["--strict"] if strict else []),
)
assert result.exit_code == 0
assert db["items"].strict == strict or not db.supports_strict
# Should have a floating point column
assert db["items"].columns_dict == {"id": int, "w": float}
@pytest.mark.parametrize("method", ("insert", "upsert"))