Public
Edited
Dec 24, 2022
4 forks
Importers
20 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
db = DuckDBClient.of([FileAttachment('iris.json'), FileAttachment('penguins.csv'), FileAttachment('weather.parquet')])
Insert cell
Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
db
SHOW TABLES
Insert cell
db.describe()
Insert cell
Insert cell
Insert cell
Insert cell
db.describe(`${table}`)
Insert cell
Insert cell
Insert cell
viewof tableSummary = SummaryTable(data, {label: table})
Insert cell
Insert cell
Insert cell
Inputs.table(searchResults)
Insert cell
data = db.sql([`SELECT * FROM ${table}`])
Insert cell
Insert cell
viewof jsQueryEditor = Wrangler(data)
Insert cell
Insert cell
db
SELECT * FROM penguins
Insert cell
Insert cell
Insert cell
tablesDiagram = diagram(db)
Insert cell
Insert cell
Insert cell
mermaidTablesDiagram = mermaidDiagram(db)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
schemas = (await db.query('select * from information_schema.schemata')).toArray().map(Object.fromEntries)
Insert cell
Insert cell
Insert cell
dataTables = (await db.query('select * from information_schema.tables')).toArray().map(Object.fromEntries)
Insert cell
Insert cell
Insert cell
allTableColumns = (await db.query('select * from information_schema.columns')).toArray().map(Object.fromEntries)
Insert cell
Insert cell
Insert cell
Insert cell
databaseList = (await db.query('PRAGMA database_list')).toArray().map(Object.fromEntries)
Insert cell
Insert cell
Insert cell
tableList = (await db.query('PRAGMA show_tables')).toArray().map(Object.fromEntries)
Insert cell
Insert cell
viewof selectedTable = Inputs.select(tableList.map(table => table.name), {label: md`#### Table`})
Insert cell
Insert cell
tableInfo = (await db.query(`PRAGMA table_info('${selectedTable}')`)).toArray().map(Object.fromEntries)
Insert cell
Insert cell
Insert cell
showTable = (await db.query(`PRAGMA show('${selectedTable}')`)).toArray().map(Object.fromEntries)
Insert cell
Insert cell
Insert cell
databaseSize = (await db.query('PRAGMA database_size')).toArray().map(Object.fromEntries)
Insert cell
Insert cell
Insert cell
databaseConfig = (await db.query('SELECT * FROM duckdb_settings()')).toArray().map(Object.fromEntries)
Insert cell
Insert cell
libraryVersion
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