Open asg017 opened 1 year ago
I just created #612, which is very similar to this issue and recommends automatically handling JSON deserialization. I only kept it separate because I was mostly contemplating library usage and this issue seems to be focused on CLI usage.
sqlite-utils
should detect and have specially handling for column with aJSON
column. For example:Automatic Nesting
According to "Nested JSON Values", sqlite-utils will only expand JSON if the
--json-cols
flag is passed. It looks like it'll try tojson.load
all text column to test if its JSON, which can get expensive on non-json columns.Instead,
sqlite-utils
should be default (ie without the--json-cols
flags) do themaybe_json()
operation on columns with a declaredJSON
type. So the above table would expand the"friends"
column as expected, withoutthe--json-cols
flag:I'm sure there's other ways
sqlite-utils
can specially handle JSON columns, so keeping this open while I think of more