Apache Superset connection
Apache Superset is an open-source business intelligence (BI) tool for data exploration and visualization. Built with Python, Apache Superset uses components such as Flask, Pandas, and SQLAlchemy. You can use Apache Superset to create visual, interactive, and collaborative documents. This topic describes how to connect Apache Superset to an AnalyticDB for PostgreSQL instance to visualize and analyze data.
Prerequisites
-
You have an AnalyticDB for PostgreSQL data source.
-
You have installed Apache Superset. For details, see the Apache Superset official website.
Procedure
-
Log on to Superset. From the top menu bar, select to open the Databases page.

-
In the upper-right corner of the page, click the
icon to open the Add Database page. Configure the following parameters.Parameter
Description
Database
A custom name for your database connection.
SQLAlchemy URI
The connection string for the AnalyticDB for PostgreSQL database. The SQLAlchemy URI format is as follows:
postgresql+psycopg2://<AccessKey ID>:<AccessKey Secret>@<host>:<port>/<Database>The following list describes the parameters:
-
AccessKey IDandAccessKey Secret: The AccessKey ID and AccessKey Secret of your Alibaba Cloud account. For information about how to obtain them, see Create an AccessKey. -
host: The internal endpoint of your AnalyticDB for PostgreSQL instance. You can find the endpoint on the Database Connection page in the AnalyticDB for PostgreSQL console. -
port: The port of your AnalyticDB for PostgreSQL instance. The default value is 5432. -
Database: The name of the database in your AnalyticDB for PostgreSQL instance.
For more information about connection details, see SQLAlchemy.
-
-
Click Test Connection.
-
If the connection test is successful, click save at the bottom of the page.
After you save the configuration, you can connect to AnalyticDB for PostgreSQL to visualize and analyze data. For detailed instructions, see the Apache Superset documentation.