mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-10-25 02:37:07 +02:00
fix: treat set/frozenset as JSON-storable types in types_for_column_types
This commit is contained in:
parent
85b1be10c8
commit
264510d3d7
2 changed files with 11 additions and 2 deletions
|
|
@ -150,9 +150,9 @@ def types_for_column_types(
|
|||
t = str
|
||||
elif len(types) == 1:
|
||||
t = next(iter(types))
|
||||
# But if it's a subclass of list / tuple / dict, use str
|
||||
# But if it's a subclass of list / tuple / dict / set, use str
|
||||
# instead as we will be storing it as JSON in the table
|
||||
for superclass in (list, tuple, dict):
|
||||
for superclass in (list, tuple, dict, set, frozenset):
|
||||
if issubclass(t, superclass):
|
||||
t = str
|
||||
elif {int, bool}.issuperset(types):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue