Join us for a live demo and deep-dive of Instant SQL on May 14Register Now

Skip to main content

Superset & Preset

Apache Superset is a powerful, open-source data exploration and visualization platform designed to be intuitive and interactive. It allows data professionals to quickly integrate and analyze data from various sources, creating insightful dashboards and charts for better decision making.

Preset is a cloud-native, user-friendly platform built on Apache Superset. It offers enhanced capabilities and managed services to leverage the power of Superset without needing to handle installation and maintenance.

In this guide, we'll cover how you can use MotherDuck with either Superset or Preset.

Superset

Setup

The easy way to get started locally with Superset is to use their docker-compose configurations.

Adding a database connection to MotherDuck

To make it work with DuckDB & MotherDuck, you will have to install an extra Python package, the DuckDB SQLAlchemy driver duckdb-engine.

You can follow the steps here to install additional packages before launching the docker-compose. Once done, you can now add the database connection.

  1. Head over to "Settings" and click on "Database Connections"
Database Connections
  1. Click on "+ Database"
Add Database
  1. In the Dropdown, pick "DuckDB"
Select DuckDB
note

If DuckDB isn't listed, there's probably an error in the installation of the duckdb-engine. Review the installation steps to install this extra python package.

  1. Enter the SQLAlchemy URI to MotherDuck that follows this pattern:
duckdb:///md:<my_database>?motherduck_token=<my_token>
SQLAlchemy URI
info

Database name is optional, so you can have one connection to MotherDuck and query multiple databases.

Finally, you can test your token/connection is valid by clicking "Test connection" and click "Connect".

Now your MotherDuck database is available in Superset and you can start making some dashboards!

Preset

Setup

You can register a Preset account for free (up to 5 users). Upon your account creation, you will need to create a workspace and be prompted to connect to your data source.

Adding your first database connection to MotherDuck

When you first setup Preset, you will be offered to create a connection to a databse. Preset has a direct integration with MotherDuck, making the connection process simpler.

  1. In the Database Connection Dropdown in "Connect your first database", you can now select "MotherDuck" directly
MotherDuck Integration
  1. Enter your MotherDuck credentials and database information
MotherDuck Credentials
  1. Click "Connect" to verify your connection is valid.
note

The Database Name needs to be prefixed with md: to connect to MotherDuck. The Access Token is the token you created in the MotherDuck dashboard.

Now your MotherDuck database is available in Preset and you can start creating dashboards immediately!

info

You can connect to multiple databases using a single MotherDuck connection.

Adding additional database connections

When adding more database connections to Preset, you can choose the option of "Get MotherDuck token". This will generate a new token from the MotherDuck account you are currently logged into.

  1. Add a database connection by going to "Settings", then "Database Connections"
Settings Preset
  1. In the Database Connections page, click on "+ Database" in the top right corner
Add Database
  1. In the dropdown, select "MotherDuck" (see above)

  2. Enter your MotherDuck credentials and database information

    1. Here you have the option to generate a new token via the Get MotherDuck token button or use a token you previously created.
MotherDuck Credentials
caution

Given that usually BI tools such as Preset and Superset are connected to service accounts, we do not recommend the "Get MotherDuck token" option for production systems but only for testing. For production systems the recommended approach is to generate an access token for the dedicated service account using the MotherDuck REST API and connect this account to Preset instead.