Connecting DataConnect a database

Connect a Database

The steps below apply to PostgreSQL and MySQL. BigQuery and Snowflake have additional OAuth steps described in their individual guides.

1

Open the connection wizard

Go to Settings → Connections → New Connection and pick your database type.
2

Enter connection details

Fill in the following fields:
Hostyour-db.example.com
Port5432 (PostgreSQL) / 3306 (MySQL)
Databaseyour_database_name
Usernamedashport_readonly
Password••••••••
3

Allowlist Dashport IPs

Add the following IPs to your database firewall or VPC security group: 52.14.210.5, 18.221.4.33, 3.143.171.87.
4

Test and save

Click "Test Connection". Dashport will verify credentials and run a lightweight schema discovery query. Save on success.
Warning
We strongly recommend creating a read-only database user for Dashport. Dashport never writes to your database — it only reads.

Select a Table or Write Custom SQL

Once your database is connected, Dashport gives you two ways to define the data for each widget:

Select a Table

Browse and choose any table or view in your database. Dashport handles aggregations, filters, and grouping through the widget editor's point-and-click UI. Great for quick exploration.

Write a Custom SQL Query

Write your own SELECT statement and Dashport treats the result as the data source. Your query is the report — all joins, aggregations, and filters are already baked in.

BI Power User Workflow

In business intelligence, a custom SQL query is your report. If you already know the exact data you need, write the query, connect it, and go straight to Superdashboard — no need to use Dashport Chat at all. This is the fastest path from database to chart.

Custom SQL
Superdashboard
— skip Chat, your data is already report-ready

Example Custom SQL Query

custom-query-example.sqlsql
-- Monthly revenue by product category — report-ready, no further transformation needed
SELECT
  DATE_TRUNC('month', o.order_date)  AS month,
  p.category                          AS category,
  SUM(oi.quantity * oi.unit_price)    AS revenue,
  COUNT(DISTINCT o.id)                AS order_count,
  ROUND(AVG(oi.unit_price), 2)        AS avg_order_value
FROM orders o
JOIN order_items oi ON oi.order_id = o.id
JOIN products    p  ON p.id = oi.product_id
WHERE o.order_date >= NOW() - INTERVAL '12 months'
  AND o.status = 'completed'
GROUP BY 1, 2
ORDER BY 1 DESC, 3 DESC;
Tip
Once you paste this query into the connection wizard, Dashport runs it, previews the result columns, and lets you name the connection. You can then open Superdashboard, pick this connection as your data source, and start building charts immediately — no Chat required.

Creating a read-only user (PostgreSQL)

postgres-readonly-user.sqlsql
-- Create a dedicated read-only role
CREATE ROLE dashport_readonly WITH LOGIN PASSWORD 'replace_with_strong_password';

-- Grant connection access to your database
GRANT CONNECT ON DATABASE your_database TO dashport_readonly;

-- Grant usage on the target schema
GRANT USAGE ON SCHEMA public TO dashport_readonly;

-- Grant SELECT on all existing tables
GRANT SELECT ON ALL TABLES IN SCHEMA public TO dashport_readonly;

-- Grant SELECT on future tables automatically
ALTER DEFAULT PRIVILEGES IN SCHEMA public
  GRANT SELECT ON TABLES TO dashport_readonly;