Public
Edited
Jun 19, 2023
Paused
1 fork
Importers
16 stars
Insert cell
Insert cell
Insert cell
Insert cell
// Table name "data" with penguins as source
db = extendDB(await DuckDBClient.of({
data: penguins
}))
Insert cell
Insert cell
Insert cell
Insert cell
islands
Insert cell
db
SELECT *
FROM data
WHERE island IN (${ islands })
Insert cell
Insert cell
Insert cell
Insert cell
db
SELECT *
FROM data
WHERE ${
islands2.length
? sql`island IN (${ islands2 })`
: sql`FALSE`
}
Insert cell
Insert cell
Insert cell
queryDreamyPenguins = (condition = true) => sql`
SELECT * FROM data
WHERE island = 'Dream' AND (${ condition })
`
Insert cell
Insert cell
db
SELECT *
FROM (${
queryDreamyPenguins( sql`flipper_length_mm > ${ flipperLength }` )
})
Insert cell
Insert cell
Insert cell
import { pizzeriaDB as originalPizzeriaDB } from "@observablehq/pizza-paradise-data"
Insert cell
pizzeriaDB = extendDB(originalPizzeriaDB)
Insert cell
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT ${
sql(
pizzaColumns.length
? pizzaColumns.map(pizzeriaDB.escape).join(",")
: "*"
)
}
FROM ${ sql( pizzeriaDB.escape(pizzaTable) ) }
Insert cell
Insert cell
Insert cell
pizzeriaDB[extended]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more