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
Go to the Data Sources page.
Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose . On the page that appears, select the desired workspace from the drop-down list and click Go to Management Center.
In the left-side navigation pane of the SettingCenter page, click Data Sources.
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
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
This data source supports only serverless resource groups (recommended) or exclusive resource groups for DataService Studio.
RDS
Supported
Supported
RDS includes RDS for MySQL, RDS for PostgreSQL, and RDS for SQL Server. When you configure these data sources, set Configuration Mode to Alibaba Cloud Instance Mode.
PolarDB-X (formerly DRDS)
Supported
Supported
You can add this type of data source only in connection string mode.
MySQL
Supported
Supported
None.
PostgreSQL
Supported
Supported
None.
SQL Server
Supported
Supported
None.
Oracle
Supported
Supported
You can add this type of data source only in connection string mode.
AnalyticDB for MySQL 2.0
Supported
Supported
None.
AnalyticDB for MySQL 3.0
Supported
Supported
None.
AnalyticDB for PostgreSQL
Supported
Supported
None.
Tablestore
Supported
Supported
You can add this type of data source only in connection string mode.
This type of data source supports only serverless resource groups (recommended) and exclusive resource groups for DataService Studio.
This type of data source can be used only in the China (Shanghai) and China (Hong Kong) regions.
MongoDB
Supported
Not supported
None.
MaxCompute
Acceleration solution 1: Acceleration service
Acceleration solution 2: MCQA
Acceleration solution 1: Acceleration service
Acceleration solution 2: MCQA
Data source configuration method: Attach a MaxCompute computing resource
Solution 1:
Only single-table queries are supported.
You can use a serverless resource group (recommended), an exclusive resource group for DataService Studio, or the shared resource group for DataService Studio.
Solution 2:
Single-table queries and multi-table join queries are supported.
You can use only a serverless resource group (recommended) or an exclusive resource group for DataService Studio.
This type of data source can be used only in the China (Beijing), China (Hangzhou), China (Shanghai), and China (Shenzhen) regions.
StarRocks
Supported
Supported
None.
Doris
Supported
Supported
None.
PolarDB
Supported
Supported
This type of data source supports only serverless resource groups (recommended) and exclusive resource groups for DataService Studio.
This type of data source can be used only in the China (Beijing), China (Hangzhou), China (Shanghai), and China (Shenzhen) regions.
ApsaraDB for Oceanbase
Supported
Supported
Sap Hana
Supported
Supported
Db2
Supported
Supported
DM
Supported
Supported
Amazon Redshift
Supported
Supported
On the data source configuration page, test the connectivity of the resource group.
ImportantIf the network connectivity test fails, check your configurations. For more information, see Configure network connectivity.
After the connectivity test is successful, return to the DataService Studio interface to create an API.