Access Dune’s blockchain data from your favorite BI tools and clients using the DuneSQL Trino/Presto connector. Connect Dune with popular tools like Hex, Metabase, DBeaver, and any Trino, Presto, or Starburst-compatible application for seamless data analysis.
Dune Trino Presto connector architecture diagram showing integration flow

Trino/Presto client → Dune connector → Dune Query Engine

The DuneSQL Trino Connector is currently only available to Plus, Premium and Enterprise customers.

Compatible Tools

Dune’s Trino connector supports any tool that works with Trino, Presto, or Starburst connectors. Popular Dune integrations include:
Any of the supported client applications listed in the Trino ecosystem are supported. Please visit their documentation to learn about their specific connection instructions, though the configuration should generally follow the same pattern using the connection parameters below.

Connection Parameters

Use these values in your Trino, Presto, or Starburst client configuration:
ParameterValueDescription
Hostdune-api-trino.dune.comDune’s Trino/Presto endpoint
Port443Standard HTTPS port
UsernameduneFixed username for all connections
Password<your-dune-api-key>Your Dune API key
Catalogdelta_prodMain data catalog
SSL/TLStrueAlways use encrypted connections
HTTP schemehttpsRequired for secure connections
If you need an API key, see our guide on Authentication. Remember to keep your API keys secret and rotate them immediately if they are ever exposed.

Hex Setup for Dune

Follow these steps to connect Dune as a data source in your Hex workspace.

Add the Data Connection

1

Open Data sources

Under Workspace settings, select Data sources.
Hex step 1: Open Data sources
2

Add connection and choose Trino

Click the green + Connection button, then select Trino from the list of available connections.
Hex step 2: Add connection and choose Trino
3

Enter connection details

Fill in the form fields using the values from the Connection Parameters section.
Hex step 3: Enter connection details

Run a Test Query

Once your data source is configured, you can query it directly from any Hex project.
1

Open or create a project

Open an existing project or create a new one.
2

Add a SQL cell

Add a new SQL cell to your notebook.
3

Select data source

In the data source dropdown at the top of the cell, select your newly created Dune SQL connection.
4

Paste and run SQL

Paste the example query below into the cell and run it.
Hex step: Paste and run SQL
You can use this query to test your connection. It fetches the daily transaction count from the last year on Base.
SELECT
  date_trunc('day', block_time) AS time,
  count(*) AS count
FROM base.transactions
WHERE block_time > now() - interval '12' month
GROUP BY 1
ORDER BY 1 DESC

Metabase Setup for Dune

Follow these steps to connect Dune as a data source in Metabase.

Add the Database Connection

1

Open Admin settings

From the Metabase home page, click the Settings gear icon in the top-right corner. Select Admin settings from the dropdown menu.
Metabase step 1: Open Admin settings
2

Go to Databases

In the Admin panel, navigate to the Databases tab.
Metabase step 2: Go to Databases
3

Add database

Click the blue Add database button to open the configuration modal.
Metabase step 3: Add database
4

Choose driver

In the modal, select Starburst (Trino) as the Database type.
5

Enter connection details

Fill in the form fields using the values from the Connection Parameters section. For best performance in Metabase, we recommend disabling Rerun queries for simple explorations and Periodically refingerprint tables in the advanced settings.
Schema discovery queries such as SHOW TABLES or SHOW SCHEMAS may not be available in Metabase with this connector because Dune’s catalog spans millions of tables. Many BI tools are not yet optimized to enumerate catalogs at this scale. An update with improved schema discovery is planned for the future.

Run a Test Query

After configuring and saving the connection, you can run a query to verify that everything is working.
1

Create a new SQL query

Click the + New button and select SQL query.
2

Select database

In the editor, choose your newly created Dune SQL data source from the Select a database dropdown.
3

Paste example SQL

Paste the example query below into the editor.
4

Run the query

Run the query to verify the connection.
You can use this query to test your connection. It fetches the daily transaction count from the last year on Base.
SELECT
  date_trunc('day', block_time) AS time,
  count(*) AS count
FROM base.transactions
WHERE block_time > now() - interval '12' month
GROUP BY 1
ORDER BY 1 DESC

DBeaver Setup for Dune

Follow these steps to connect Dune as a data source in DBeaver.

Add a Database Connection

1

Create new connection

In DBeaver, click the New Database Connection button. It usually looks like a plug with a plus on it.
2

Select Trino database

You’ll be taken to the “Connect to a database” screen. Find and select Trino from the list of accepted databases, then click on it.
DBeaver step 2: Select Trino from database list
3

Configure connection details

You’ll be taken to a screen where you can fill in your connection details. Make sure to click Connect by host, then fill in the connection parameters using the values from the Connection Parameters section.
DBeaver step 3: Enter connection details
4

Finish connection setup

Once you have all the details filled out properly, click Finish to create the connection.

Run a Test Query

After configuring your connection, you can run a query to verify that everything is working.
1

Open SQL editor

Right-click on your Dune database connection and navigate to the SQL Editor section. This will open up a new SQL editor.
2

Write your SQL query

In the SQL editor, you can write all of your Dune-compatible SQL. Paste the example query below into the editor.
3

Run the script

Click the Run button to execute your script. If everything went well, you will see the results displayed in the results panel.
DBeaver step 5: Run SQL script and view results
You can use this query to test your connection. It fetches the daily transaction count from the last year on Base.
SELECT
  date_trunc('day', block_time) AS time,
  count(*) AS count
FROM base.transactions
WHERE block_time > now() - interval '12' month
GROUP BY 1
ORDER BY 1 DESC

Using Trino SDKs directly in your code

Connect to Dune using Trino SDKs in your preferred language.
# Install: brew install trino
trino --server https://dune-api-trino.dune.com:443 \
  --user dune --password \
  --catalog delta_prod \
  --schema runtime \
  --execute "SELECT count(*) FROM base.transactions WHERE block_time > now() - interval '1' day"
Besides the code samples shown above, Trino supports a variety of other official and unofficial SDKs. Please check the official Trino SDKs page to see which ones are available and to view their GitHub repositories for updated code samples and documentation.

Supported SQL Operations

Queries executed via the connector align with what you can run on the Dune platform. See the Query Engine overview for more information on supported functions and syntax.

Rate Limits

Rate limits for the connector mirror those of the Dune Analytics API. Please refer to the Rate Limits documentation for details.

Billing & Cost

All queries run via the connector are executed on the Large Query Engine and cost 20 Dune Credits per execution. In addition, fetching results consumes credits proportional to the number of datapoints returned. For a full breakdown, please see our documentation on Billing.

Limitations

The connector currently has limited support for metadata discovery queries such as SHOW TABLES or SHOW SCHEMAS. This may impact the data source browsing and autocomplete experience within some BI tools. For schema and table discovery, see the Data Explorer guide. If you encounter timeouts with large result sets, consider paginating your queries using LIMIT and OFFSET, narrowing your filters, or splitting complex queries into smaller, more manageable parts.