Create data source skill

Updated at:

You can use natural language instructions to direct code agents like Qoder and CodeX to create a Dataphin data source and run a connectivity test. This topic describes the feature, provides examples, and explains the results. The appendix lists the required input parameters.

Overview

The create data source skill allows you to use natural language instructions to register a data source in Dataphin. This data source can then be used for tasks such as creating tables, synchronizing data, and data development. Dataphin supports various data source types, such as MySQL, MaxCompute, and Hive, each with its own set of connection parameters. For projects that require development and production environment separation, you can create and link separate development and production data sources.

Use cases:

  • Create separate data sources for your development environment and production environment.

  • Customize connection parameters by data source type to create data sources such as MySQL, MaxCompute, and Hive.

  • Run a connectivity test immediately after creating a data source to verify its availability.

Note

Limitations: Each data source type requires a unique set of connection parameters. For projects with development and production environment separation, you must first create the production data source to get its ID. You can then create the development data source and link it to the production data source. A development data source cannot be created independently. A successfully created data source is not guaranteed to be available until it passes a connectivity test. The result of a command-line connectivity test is definitive. The connectivity status in the console may require a manual refresh by running the test again. This does not affect the data source's actual usability.

Examples

You can describe your requirements to the agent using natural language. Here are some example commands:

  • Create a MySQL data source for me.

  • Create a data source for both development and production, and link the development data source to the production one.

  • Create a MaxCompute data source, and then run a connectivity test.

Interaction flow:

  1. After you issue the creation command, the agent confirms the target tenant, data source type, data source name, and connection parameters. The required connection parameters vary by data source type.

  2. For projects that use development and production environment separation, the agent first creates the production data source to obtain its ID, and then creates and links the development data source.

  3. Creating a data source is a write operation. The agent informs you of the new data source's name, type, target tenant, and connection parameters (passwords are not displayed). The agent also indicates whether a rollback is possible. The operation proceeds only after you provide confirmation.

  4. After the data source is created, the agent typically runs a connectivity test using the returned data source ID to confirm its availability.

Execution results

After the operation is complete, the agent returns the following results:

  • Return value: After a successful creation, the agent returns the ID of the new data source. For projects with development and production environment separation, it returns the IDs for both the production and development data sources.

  • Completion status: A successful command response indicates that the request was accepted. A successfully created data source is not guaranteed to be available until it passes a connectivity test.

  • Verification: You can view the new data source in the Dataphin data source list and check its connectivity status.

Note

A successful response from the command line only indicates that the request was accepted. The Dataphin console shows the final status.

Appendix: Input parameters

The following table lists the required parameters for creating a data source. This list is for reference only. In practice, the agent automatically identifies the required information from your command and prompts you if any information is missing. You do not need to provide system-generated parameters.

Parameter

Required

Description

Example

tenant ID

Yes

The 19-digit ID of the target Dataphin tenant.

1234567890123456789

data source type

Yes

The data source type enum (uppercase). Different types require different connection parameters.

MYSQL, MAX_COMPUTE

data source name

Yes

The name of the data source. It must be unique within the tenant.

mysql_order_db

data source description

No

An optional description of the data source's purpose.

Order database data source

connection parameter

Yes

The connection information for the target database, such as the connection string, username, and password. The required parameters vary by data source type.

jdbc:mysql://host:port/db

production data source ID

Conditionally required

When creating a development data source for a project with development and production environment separation, provide the 19-digit ID of the existing production data source as a string.

7456935852434808960