All Products
Search
Document Center

DataWorks:Add a data source

Last Updated:Nov 28, 2024

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

To ensure that resource groups for DataService Studio can access data sources, you must configure network connectivity between the resource groups and data sources and configure IP address whitelists for the data sources. Otherwise, tasks that are related to DataService Studio cannot be run as expected.

Procedure

  1. Go to the Data Sources page.

    1. Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose More > Management Center. On the page that appears, select the desired workspace from the drop-down list and click Go to Management Center.

    2. In the left-side navigation pane of the SettingCenter page, choose Data Sources > Data Sources.

  2. On the Data Source page, add a data source based on your business requirements. The following table describes the supported types of data sources and the configuration methods.

    Data source type

    Create an API by using the codeless UI

    Create an API by using the code editor

    References

    Description

    Hologres

    Supported

    Supported

    Add a Hologres data source

    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

    Add a ClickHouse data source

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

    ApsaraDB RDS

    Supported

    Supported

    ApsaraDB RDS data sources that run the MySQL, PostgreSQL, or SQL Server engine are supported.

    None.

    PolarDB-X 1.0

    Supported

    Supported

    Add a PolarDB-X 1.0 data source

    You can add this type of data source only in connection string mode.

    MySQL

    Supported

    Supported

    Add a MySQL data source

    None.

    PostgreSQL

    Supported

    Supported

    Add a PostgreSQL data source

    None.

    SQL Server

    Supported

    Supported

    Add an SQL Server data source

    None.

    Oracle

    Supported

    Supported

    Add an Oracle data source

    You can add this type of data source only in connection string mode.

    AnalyticDB for MySQL 2.0

    Supported

    Supported

    Add an AnalyticDB for MySQL 2.0 data source

    None.

    AnalyticDB for MySQL 3.0

    Supported

    Supported

    Add an AnalyticDB for MySQL 3.0 data source

    None.

    AnalyticDB for PostgreSQL

    Supported

    Supported

    Add an AnalyticDB for PostgreSQL data source

    None.

    Tablestore

    Supported

    Supported

    Add a Tablestore data source

    MongoDB

    Supported

    Not supported

    Add a 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

    Add a StarRocks data source

    None.

    Doris

    Supported

    Supported

    Add a Doris data source

    None.

    PolarDB

    Supported

    Supported

    Add a PolarDB data source

    ApsaraDB for Oceanbase

    Supported

    Supported

    Add a ApsaraDB for OceanBase data source

    Sap Hana

    Supported

    Supported

    Add a SAP HANA data source

    Db2

    Supported

    Supported

    Add a Db2 data source

    DM

    Supported

    Supported

    Add a DM data source

    Amazon Redshift

    Supported

    Supported

    Add an Amazon Redshift data source

  3. In the dialog box in which you add the data source, set the Resource Group connectivity parameter to Data Service and test network connectivity for the resource group for DataService Studio that you want to use. The following example shows how to add a MySQL data source.

    测试连通性

    Note

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

  4. After the data source passes the network connectivity test, return to DataService Studio to create an API based on the data source.