Closed rolandwalker closed 2 years ago
support for adding extensions is a great idea, especially now that q 3.1.0 will allow direct querying sqlite database file as well.
However, solving this would require a more generic mechanism that will support multiple extensions. I've opened a new PR (#282) for adding new user functions. I'll consider adding external extension support to it.
I would suggest using the action='append'
of the OptionParser
. In that way the user can do something along these lines (implying avg()
is defined in one of the extensions
cat file.txt | q -x /path/to/extension1 -x /path/to/extension2 "select avg(column) from -"
I was confused by the various exit codes, and picked one that was unused.
Example using https://github.com/nalgeon/sqlean/blob/main/docs/stats.md :
Example using https://github.com/nalgeon/sqlean/blob/main/docs/re.md :