MCPcopy Index your code
hub / github.com/duckdb/duckdb-ui

github.com/duckdb/duckdb-ui @v1.4.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.4 ↗ · + Follow
683 symbols 1,167 edges 136 files 19 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DuckDB UI Extension

A DuckDB extension providing a browser-based user interface.

This repository contains both the extension, implemented in C++, and some packages used by the user interface, implemented in TypeScript.

While most of the user interface code is not yet publicly available, more of it will added here over time.

Extension

The primary structure of this repository is based on the DuckDB extension template.

To build the extension:

make

This will create the following binaries:

./build/release/duckdb                              # DuckDB shell with UI extension
./build/release/test/unittest                       # Test runner
./build/release/extension/ui/ui.duckdb_extension    # Loadable extension binary
  • duckdb is the binary for the duckdb shell with the extension code automatically loaded.
  • unittest is the test runner of duckdb. Again, the extension is already linked into the binary.
  • ui.duckdb_extension is the loadable binary as it would be distributed.

To run the extension code, simply start the shell with ./build/release/duckdb.

To start the UI from the command line:

./build/release/duckdb -ui

To start the UI from SQL:

call start_ui();

For more usage details, see the documentation.

User Interface Packages

Some packages used by the browser-based user interface can be found in the ts directory.

See the README in that directory for details.

Architectural Overview

The extension starts an HTTP server that both serves the UI assets (HTML, JavaScript, etc.) and handles requests to run SQL and perform other DuckDB operations.

The server proxies requests for UI assets and fetches them from a remote server. By default, this is https://ui.duckdb.org, but it can be overridden.

The server also exposes a number of HTTP endpoints for performing DuckDB operations. These include running SQL, interrupting runs, tokenizing SQL text, and receiving events (such as catalog updates). For details, see the HttpServer::Run method in http_server.cpp.

The UI uses the TypeScript package duckdb-ui-client for communicating with the server. See the DuckDBUIClient and DuckDBUIClientConnection classes exposed by this package for details.

Extension points exported contracts — how you extend this code

ParsedField (Interface)
(no doc)
ts/pkgs/duckdb-data-types/src/parseLogicalTypeString.ts
DuckDBTypeToStringOptions (Interface)
(no doc)
ts/pkgs/duckdb-data-types/src/DuckDBType.ts
DuckDBUIRunOptions (Interface)
(no doc)
ts/pkgs/duckdb-ui-client/src/client/types/DuckDBUIRunOptions.ts
MaterializedRunResult (Interface)
(no doc)
ts/pkgs/duckdb-ui-client/src/client/types/MaterializedRunResult.ts
ColumnNamesAndTypes (Interface)
(no doc)
ts/pkgs/duckdb-ui-client/src/serialization/types/ColumnNamesAndTypes.ts

Core symbols most depended-on inside this repo

toString
called by 263
ts/pkgs/duckdb-data-types/src/DuckDBType.ts
toJson
called by 96
ts/pkgs/duckdb-data-types/src/DuckDBType.ts
create
called by 92
ts/pkgs/duckdb-data-types/src/DuckDBType.ts
toSql
called by 66
ts/pkgs/duckdb-data-values/src/DuckDBMapValue.ts
parseLogicalTypeString
called by 59
ts/pkgs/duckdb-data-types/src/parseLogicalTypeString.ts
readProperty
called by 34
ts/pkgs/duckdb-ui-client/src/serialization/classes/BinaryDeserializer.ts
getDataVector
called by 30
ts/pkgs/duckdb-ui-client/src/conversion/functions/vectorGetters.ts
STRUCT
called by 28
ts/pkgs/duckdb-data-types/src/DuckDBType.ts

Shape

Method 336
Function 156
Class 155
Interface 35
Enum 1

Languages

TypeScript86%
C++14%

Modules by API surface

ts/pkgs/duckdb-data-types/src/DuckDBType.ts209 symbols
src/http_server.cpp26 symbols
ts/pkgs/duckdb-data-values/src/conversion/dateTimeStringConversion.ts20 symbols
ts/pkgs/duckdb-ui-client/src/serialization/classes/BinaryDeserializer.ts18 symbols
ts/pkgs/duckdb-data-values/src/DuckDBBitValue.ts16 symbols
ts/pkgs/duckdb-ui-client/src/http/classes/DuckDBUIHttpRequestQueue.ts14 symbols
ts/pkgs/duckdb-data-reader/src/DuckDBDataReader.ts14 symbols
ts/pkgs/duckdb-ui-client/src/conversion/functions/dataViewReaders.ts13 symbols
ts/pkgs/duckdb-ui-client/src/client/classes/DuckDBUIClient.ts13 symbols
src/ui_extension.cpp13 symbols
ts/pkgs/duckdb-ui-client/src/serialization/functions/basicReaders.ts12 symbols
ts/pkgs/duckdb-ui-client/src/serialization/classes/BinaryStreamReader.ts10 symbols

For agents

$ claude mcp add duckdb-ui \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact