datasette icon indicating copy to clipboard operation
datasette copied to clipboard

Datasette feature for publishing snapshots of query results

Open simonw opened this issue 2 years ago • 5 comments

https://twitter.com/simonw/status/1514392335718645760

Maybe @datasetteproj should grow a feature that lets you cache the results of a query and give that snapshot a stable permalink

A plugin that publishes the JSON output of a query to an S3 bucket would be pretty neat... especially if it could also be configured to re-publish the results on a schedule

A lot of people said they would find this useful.

Probably going to build this as a plugin.

simonw avatar Apr 14 '22 01:04 simonw

Current workaround for fast publishing to S3:

datasette fixtures.db --get /fixtures/facetable.json | \
  s3-credentials put-object my-bucket facetable.json -

simonw avatar Apr 14 '22 01:04 simonw

What would be an awesome feature as a plugin would be to be able to save a query (and possibly even results) to a github gist. Being able to share results that way would be super fantastic. Possibly even in Jupyter Notebook format (since github and github gists nicely render those)!

I know there's the handy datasette-saved-queries plugin, but a button that could export stuff out and then even possibly import stuff back in (I'm sort of thinking the way that Google Colab allows you to save to github, and then pull the notebook back in is a really great workflow image https://github.com/cincinnatilibrary/collection-analysis/blob/master/reports/colab_datasette_example.ipynb )

rayvoelker avatar Apr 14 '22 17:04 rayvoelker

I wonder if this overlaps with what I outlined in #1605. You could run something like this:

datasette freeze -d exports/
aws s3 cp exports/ s3://my-export-bucket/$(date)

And maybe that does what you need. Of course, that plugin isn't built yet. But that's the idea.

eyeseast avatar Apr 14 '22 19:04 eyeseast

feels related to #1402

fgregg avatar Apr 20 '22 00:04 fgregg

This feature is pretty important and would be nice if it would be all within Datasette (no separate CLI/deploy required). My workflow now is to basically just copy the result and paste into a Google Sheet, which works, but then it's not discoverable to other journalists browsing the Datasette instance. I started building a plugin similar to datasette-saved-queries but one that maintains its own DB (required if you're working with all immutable DBs), but got bogged down in details.

brandonrobertz avatar Jul 04 '22 05:07 brandonrobertz