> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dune.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DBeaver

> Connect Dune to DBeaver for direct SQL access

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

## Add a Database Connection

<Steps>
  <Step title="Create new connection">
    In DBeaver, click the <b>New Database Connection</b> button. It usually looks like a plug with a plus on it.
  </Step>

  <Step title="Select Trino database">
    You'll be taken to the "Connect to a database" screen. Find and select <b>Trino</b> from the list of accepted databases, then click on it.

    <Frame>
      <img src="https://mintcdn.com/dune/bE2iCQxUVMqVPGif/images/trino-presto-connector/dbeaver-1.png?fit=max&auto=format&n=bE2iCQxUVMqVPGif&q=85&s=e57842195baf7a75e1cf59f11934f107" alt="DBeaver step 2: Select Trino from database list" width="2150" height="1328" data-path="images/trino-presto-connector/dbeaver-1.png" />
    </Frame>
  </Step>

  <Step title="Configure connection details">
    You'll be taken to a screen where you can fill in your connection details. Make sure to click <b>Connect by host</b>, then fill in the connection parameters using the values from the [Connection Parameters](/api-reference/connectors/trino/overview#connection-parameters) section.

    <Frame>
      <img src="https://mintcdn.com/dune/bE2iCQxUVMqVPGif/images/trino-presto-connector/dbeaver-2.png?fit=max&auto=format&n=bE2iCQxUVMqVPGif&q=85&s=a1468abe99eb7b965a7bde680ce6dc4e" alt="DBeaver step 3: Enter connection details" width="1368" height="1188" data-path="images/trino-presto-connector/dbeaver-2.png" />
    </Frame>
  </Step>

  <Step title="Finish connection setup">
    Once you have all the details filled out properly, click <b>Finish</b> to create the connection.
  </Step>
</Steps>

## Run a Test Query

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

<Steps>
  <Step title="Open SQL editor">
    Right-click on your Dune database connection and navigate to the <b>SQL Editor</b> section. This will open up a new SQL editor.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Run the script">
    Click the <b>Run</b> button to execute your script. If everything went well, you will see the results displayed in the results panel.

    <Frame>
      <img src="https://mintcdn.com/dune/bE2iCQxUVMqVPGif/images/trino-presto-connector/dbeaver-3.png?fit=max&auto=format&n=bE2iCQxUVMqVPGif&q=85&s=1184ebe7cff94bdd08465c60eae4d927" alt="DBeaver step 5: Run SQL script and view results" width="2144" height="1334" data-path="images/trino-presto-connector/dbeaver-3.png" />
    </Frame>
  </Step>
</Steps>

You can use this query to test your connection. It fetches the daily transaction count from the last year on Base.

```sql theme={null}
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
```
