SQL notebooks deserve better tooling. We built a DuckDB kernel with interactive Perspective viewers and a database explorer that works in both JupyterLab and VS Code.
DuckDB already has a fantastic UI — a powerful web-based interface served by MotherDuck that runs as a standalone HTTP server inside the DuckDB process. It’s feature-rich and well-designed. But it’s built as a standalone experience, not as something that plugs into the Jupyter ecosystem. It doesn’t run inside JupyterLab or VS Code, it’s hard to integrate into your own products, and it’s not open source.
We wanted something different: a lightweight, open source kernel that follows the Jupyter standard — so it works everywhere notebooks work. In JupyterLab, in VS Code, in JupyterHub, and in custom products that embed Jupyter. That’s why we built duckdb-kernel.
What is duckdb-kernel?
It’s a native Jupyter kernel written in Go that runs DuckDB queries and returns results as Apache Arrow IPC streams. No Python wrapper, no magic commands — just SQL.
FROM testThe kernel shows up in JupyterLab’s launcher alongside your Python kernels — ready to go.
Press enter or click to view image in full size
Interactive Results with Perspective
Query results aren’t rendered as static HTML tables. Instead, they’re streamed as Arrow IPC to Perspective, a high-performance data visualization engine built on WebAssembly.
Press enter or click to view image in full size
That’s 5 million rows, 237 MB — queried in 238 ms and rendered interactively less 5 seconds. You can:
- Sort and filter millions of rows without re-running queries
- Group By to create instant rollups and pivots
- Chart results — bar, line, scatter, heatmap, treemap — all from the same output
- Stream large datasets chunk by chunk via Arrow IPC
The same viewer works in VS Code, with the full chart type selector:
Press enter or click to view image in full size
The Database Explorer
This is the feature I’m most excited about. Both extensions include a sidebar panel for browsing your database:
In JupyterLab — a rich sidebar with typed column icons, inline refresh and info buttons:
Press enter or click to view image in full size
In VS Code — the same data in a familiar tree view:
Both show:
- Session — DuckDB version, session ID, memory usage
- Catalog — databases → schemas → tables/views with column types
- Extensions — loaded, installed, and available extensions
- Secrets — configured secrets (for S3, Azure, etc.)
- Settings — all DuckDB configuration settings
- System Functions — every built-in function
- Memory — allocation breakdown by component (see that 295 MB for IN_MEMORY_TABLE?)
- Result Files — Arrow spool files from your query history
Detail Panels
Click on any table to see full metadata. The Summarize tab gives you instant data profiling — approx_unique, avg, min, max, count — without writing a single query:
Press enter or click to view image in full size
Multi-Kernel Support
Each notebook runs its own DuckDB instance. When you switch between notebook tabs, the explorer automatically switches to the correct kernel.
Architecture
Here’s how the pieces fit together:
The kernel exposes an HTTP server on localhost that serves:
/arrow/stream— chunked Arrow IPC for result rendering/introspect— JSON metadata for the explorer (wraps DuckDB system functions likeduckdb_tables(),duckdb_schemas(), etc.)/static/perspective/— Perspective JS/WASM files
Getting Started
One-Click Install from VS Code
The VS Code extension includes an Install / Update DuckDB Kernel command. It downloads the latest release from GitHub — binary, kernel.json, and Perspective static files — and configures everything. No terminal needed.
JupyterLab:
pip install hugr-perspective-viewerKernel only (if you already have it set up):
curl -fsSL https://raw.githubusercontent.com/hugr-lab/duckdb-kernel/main/install.sh | bashWhat’s Next
- Query autocompletion powered by the catalog metadata
- Notebook-level
.duckdbfile attachment - Query history with result caching
Why We Built This
duckdb-kernel is part of Hugr — an open source Data Mesh platform. Hugr uses DuckDB as its query engine, and we needed a first-class notebook experience for data engineers and analysts working with the platform: interactive exploration of federated data sources, instant profiling of tables across multiple databases, and a viewer that handles millions of rows without breaking a sweat.
Instead of building yet another proprietary UI, we made it a standard Jupyter kernel — so it works everywhere notebooks work. Whether you’re exploring a local Parquet file or querying a federated data mesh through Hugr, the experience is the same.
Learn more about Hugr: hugr-lab.github.io
Built with Go, DuckDB, Apache Arrow, Perspective, TypeScript, and a healthy dislike of plain-text SQL output.