Observable has native support for connecting to PostgreSQL from private notebooks and querying SQLite files from public notebooks. Unfortunately, querying large amounts of data from public notebooks has not been supported.
That's changed now thanks to the Splitgraph Observable Client, which lets you query all the public data on the Splitgraph Data Delivery Network (DDN) from any notebook.
To use the Splitgraph Observable Client in your own notebook, simply import it
from the @splitgraph/ddn
notebook. Call the splitgraph
function to send SQL
queries to the DDN over its HTTP API:
import { splitgraph } from "@splitgraph/ddn"
all_cases = await splitgraph`
SELECT
date,
confirmed,
recovered,
dead,
source
FROM "splitgraph/oxcovid19".epidemiology
WHERE countrycode = 'GBR' AND gid = '{"GBR"}' AND source = 'GBR_PHE'
ORDER BY date DESC`
This Planning a family vacation notebook showcases the Observable Splitgraph API: