Closed simonw closed 4 days ago
Needed this feature in sqlite-utils
core first:
OK, the prototype works. With a CSV file dogs.csv
like this:
name,description
Cleo,Excellent dog
Buffy,Vampire slayer dog
This works:
sqlite-utils ask-files dogs.csv 'count the dogs'
select count(*) from t
[
{
"count(*)": 2
}
]
And:
sqlite-utils ask-files dogs.csv 'count the dogs with slay in their description'
select count(*) from t where description like '%slay%'
[
{
"count(*)": 1
}
]
Idea from Datasette Discord. Can use the same mechanism as
sqlite-utils memory
for turning CSV/TSV/JSON into temporary in-memory tables, the answer a question.