Document how to use a `--convert` function that runs initialization code first
See original GitHub issueWhen 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?
Issue Analytics
- State:
- Created a year ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Code First Migrations - EF6 - Microsoft Learn
Generating & Running Migrations · Run the Update-Database command in Package Manager Console · Code First Migrations will compare the migrations ...
Read more >Object initializer - JavaScript - MDN Web Docs - Mozilla
An object initializer is a comma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in...
Read more >Understanding init in Go | DigitalOcean
Introduction. In Go, the predefined init() function sets off a piece of code to run before any other part of your package.
Read more >Initialization — The Swift Programming Language (Swift 5.7)
Both initializers convert their single argument into the corresponding Celsius value and store this value in a property called temperatureInCelsius . Parameter ...
Read more >The Go init Function | TutorialEdge.net
In this tutorial we'll be looking at the Go init function, how to use it and some of the things to consider when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So now this should solve your problem:
I found a fix that makes that
global
workaround unnecessary: