When I have an insert command with transform like this:
cat items.json | jq '.data' | sqlite-utils insert listings.db listings - --convert '
d = enchant.Dict("en_US")
row["is_dictionary_word"] = d.check(row["name"])
' --import=enchant --ignore
I noticed as the number of rows increases the operation becomes quite slow, likely due to the creation of the d = enchant.Dict("en_US") object for each row. Is there a way to share that instance d between transform function calls, like a shared context?
When I have an insert command with transform like this:
I noticed as the number of rows increases the operation becomes quite slow, likely due to the creation of the
d = enchant.Dict("en_US")object for each row. Is there a way to share that instancedbetween transform function calls, like a shared context?