issues: 1178546862
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | pull_request | body | repo | type | active_lock_reason | performed_via_github_app | reactions | draft | state_reason |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1178546862 | I_kwDOCGYnMM5GPzKu | 420 | Document how to use a `--convert` function that runs initialization code first | 770231 | closed | 0 | 12 | 2022-03-23T19:07:36Z | 2022-08-28T11:34:37Z | 2022-03-25T20:07:33Z | NONE | 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? | 140912432 | issue | {"url": "https://api.github.com/repos/simonw/sqlite-utils/issues/420/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | completed |