Add a data source

Updated at:
Copy as MD

Before you use DataService Studio to create an API, you must add your database or data warehouse to DataWorks as a data source. Then, you can use the data source to create an API. During API development, DataService Studio accesses the data source to obtain the schema of a data table based on which you want to create an API to help you configure the request parameters and response parameters of the API. This topic describes how to add a data source.

Prerequisites

You must configure network connectivity and whitelists to ensure that data can be accessed between data sources and service resource groups. If you do not complete these configurations, DataService Studio tasks cannot run as expected. For more information, see Network connectivity solutions.

Procedure

    1. Log on to the DataWorks console. In the target region, click More > Management Center in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Management Center.

    2. On the Workspace Management page, click Data Sources in the left-side navigation pane to open the data source page.

  1. On the Data Source page, add a data source as needed. The following table describes the supported types of data sources and the configuration methods.

    Data source type

    Create an API using the codeless UI

    Data Generation API for the Code Editor

    Configuration Method

    Description

    Hologres

    Supported

    Supported

    Attach a Hologres computing resource

    Hologres is compatible with PostgreSQL. PostgreSQL does not support the DATETIME data type. If your Hologres instance contains data of the DATETIME type, Hologres converts the data from the DATETIME type to the TIMESTAMP type of PostgreSQL. This way, DataService Studio can query the data.

    ClickHouse

    Supported

    Supported

    Attach a ClickHouse computing resource

    This data source supports only serverless resource groups (recommended) or exclusive resource groups for DataService Studio.

    RDS

    Supported

    Supported

    When you configure a data source for RDS MySQL, RDS PostgreSQL, or RDS SQL Server, you must set the Configuration Mode to ApsaraDB for RDS.

    PolarDB-X (formerly DRDS)

    Supported

    Supported

    DRDS (PolarDB-X 1.0) data source

    Select Connection String mode to add a data source.

    MySQL

    Supported

    Supported

    MySQL data source

    None.

    PostgreSQL

    Supported

    Supported

    PostgreSQL data source

    None.

    SQL Server

    Supported

    Supported

    SQL Server data source

    None.

    Oracle

    Supported

    Supported

    Oracle data source

    Please select the Connection String mode to add a data source.

    AnalyticDB for MySQL 2.0

    Supported

    Supported

    AnalyticDB for MySQL 2.0 data source

    None.

    AnalyticDB for MySQL 3.0

    Supported

    Supported

    Attach an AnalyticDB for MySQL 3.0 computing resource

    None.

    AnalyticDB for PostgreSQL

    Supported

    Supported

    Attach an AnalyticDB for PostgreSQL computing resource

    None.

    Tablestore

    Supported

    Supported

    Tablestore Stream data source

    MongoDB

    Supported

    Not supported

    MongoDB data source

    None.

    MaxCompute

    • Acceleration solution 1: Acceleration service

    • Acceleration solution 2: MCQA

    • Acceleration solution 1: Acceleration service

    • Acceleration solution 2: MCQA

    StarRocks

    Supported

    Supported

    StarRocks data source

    None.

    Doris

    Supported

    Supported

    Doris data source

    None.

    SelectDB

    Supported

    Supported

    SelectDB data source

    None

    PolarDB

    Supported

    Supported

    PolarDB data source

    ApsaraDB for Oceanbase

    Supported

    Supported

    ApsaraDB for OceanBase data source

    Sap Hana

    Supported

    Supported

    SAP HANA data source

    Db2

    Supported

    Supported

    Db2 data source

    DM

    Supported

    Supported

    DM data source

    Amazon Redshift

    Supported

    Supported

    Amazon Redshift data source

  2. On the data source configuration page, test the connectivity of the resource group.

    Important

    If the network connectivity test fails, check your configurations. For more information, see Configure network connectivity.

  3. After the connectivity test is successful, return to the DataService Studio interface to create an API.