Closed asg017 closed 1 year ago
Another use-case: I want to make a sqlite-utils
plugin that'll help me insert data into Datasette.
sqlite-utils insert-datasette \
--token $DATASETTE_API_KEY \
https://latest.datasette.io/fixtures/my-table \
'select ...'
This could also be a datasette plugin (ex datasette upload-data ...
, but you can also think of sqlite-utils
plugins that upload to S3, a postgres table, other DBMS's, etc.)
I really like this. I'm also interested in:
sqlite-utils convert
https://sqlite-utils.datasette.io/en/stable/cli.html#sqlite-utils-convert-recipesThe upload-data-to-Datasette problem is planned to be solved by a future version of https://github.com/simonw/dclient
Would this possibly make a bunch of x-to-sqlite
tools obsolete? Or nudge some to become plugins?
Would this possibly make a bunch of
x-to-sqlite
tools obsolete? Or nudge some to become plugins?
Yeah, it could do! That's not a terrible idea to be honest, those things have really been proliferating.
Alternatively, they could each register themselves as plugins in addition - so if you install e.g. pocket-to-sqlite
you could then optionally also run it as sqlite-utils pocket-to-sqlite ...
The benefit there is for people who install sqlite-utils
from Homebrew, where it gets its own virtual environment. They could run:
brew install sqlite-utils
sqlite-utils install pocket-to-sqlite
sqlite-utils pocket-to-sqlite ...
I'm going to start by adding the register_command
hook using the exact same pattern as Datasette and LLM.
Here's documentation for the new plugins mechanism, including a very short tutorial on writing a new plugin (inspired by https://llm.datasette.io/en/stable/plugins/tutorial-model-plugin.html):
Cool. I might try to add a geojson plugin that handles both input and output. That would help me out a lot.
Splitting off an issue for prepare_connection()
since Alex got the PR in seconds before I shipped 3.34!
Now that we have two plugin hooks I'm closing this issue (we can open other issues for further hooks).
I'd like there to be a plugin system for sqlite-utils, similar to the datasette/llm plugins. I'd like to make plugins that would do things like:
sqlite-utils memory
--csv
--tsv
--nl
etc.A few real-world use-cases of plugins I'd like to see in sqlite-utils:
sqlite-http
,sqlite-lines
,sqlite-regex
, etc.)sqlite-vss
vector tablessqlite-arrow