Apache Superset connection

Updated at:
Copy as MD

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

Procedure

  1. Log on to Superset. From the top menu bar, select Sources > > > Databases to open the Databases page.

    1.png

  2. In the upper-right corner of the page, click the icon.png 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 ID and AccessKey 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.

  3. Click Test Connection.

  4. 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.