mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-15 04:54:23 +02:00
Fixed bug with null columns, closes #95
This commit is contained in:
parent
3db9881970
commit
b436bdb594
3 changed files with 15 additions and 3 deletions
|
|
@ -813,3 +813,9 @@ def test_insert_all_empty_list(fresh_db):
|
|||
assert 1 == fresh_db["t"].count
|
||||
fresh_db["t"].insert_all([], replace=True)
|
||||
assert 1 == fresh_db["t"].count
|
||||
|
||||
|
||||
def test_create_with_a_null_column(fresh_db):
|
||||
record = {"name": "Name", "description": None}
|
||||
fresh_db["t"].insert(record)
|
||||
assert [record] == list(fresh_db["t"].rows)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ from sqlite_utils.utils import suggest_column_types
|
|||
([{"a": 1}, {"a": 1.1}], {"a": float}),
|
||||
([{"a": b"b"}], {"a": bytes}),
|
||||
([{"a": b"b"}, {"a": None}], {"a": bytes}),
|
||||
([{"a": "a", "b": None}], {"a": str, "b": str}),
|
||||
],
|
||||
)
|
||||
def test_suggest_column_types(records, types):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue