Esc
Documentation
On this page

In this tutorial, you start DSUI on your machine, load the DuckDB adapter, and run a SQL query in the workspace. You need Node.js 18 or later and network access to GitHub, because DSUI builds the adapter from source the first time it starts.

  1. Create a project directory#

    bash
    mkdir dsui-quickstart
    cd dsui-quickstart
  2. Add a configuration file#

    Create dsui.yaml in the directory:

    yaml
    adapters:
      duckdb:
        source: git
        repository: "git+https://github.com/northgraindata/dsui"
        path: packages/adapter-duckdb
    
    services:
      - id: local-duckdb
        adapter: duckdb
        name: Local DuckDB
        connection:
          method: memory

    The adapters block tells DSUI where to get the adapter. The key, duckdb, must match the ID the adapter declares. The services block creates one service that uses it, with an in-memory DuckDB database.

  3. Start DSUI#

    bash
    npx @northgraindata/dsui

    DSUI reads dsui.yaml from the current directory. The first start takes longer because DSUI downloads and builds the adapter. When the server is ready, the terminal prints ready and the address http://localhost:4192.

  4. Run a query#

    Open http://localhost:4192 in your browser, select Local DuckDB, and open Query. Run this statement:

    sql
    select 42 as answer;

    The result is one row with the value 42.

The DSUI workspace with a connected service

Stop DSUI with Ctrl+C. An in-memory database is created again on every connection, so it doesn’t keep data between runs. DSUI keeps its own state, such as saved connections, in ~/.local/share/dsui. Set DSUI_DATA_DIR to store it somewhere else.

Docker alternative#

Use Docker when you want an isolated, repeatable deployment or already run the rest of your stack in Compose. The Docker tutorial walks through the same setup with a file-backed database.

Next steps#