From 03dc546071a9dafc541c18999396a3cfe99bde0e Mon Sep 17 00:00:00 2001 From: yangxin Date: Mon, 5 Jun 2023 15:23:53 +0800 Subject: [PATCH 01/15] Introduce import mysql --- TOC-tidb-cloud.md | 1 + tidb-cloud/ticloud-import-start-local.md | 24 ++++---- tidb-cloud/ticloud-import-start-mysql.md | 78 ++++++++++++++++++++++++ tidb-cloud/ticloud-import-start-s3.md | 32 +++++----- 4 files changed, 107 insertions(+), 28 deletions(-) create mode 100644 tidb-cloud/ticloud-import-start-mysql.md diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index 8038a878f3265..2ca2b8f773e2d 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -530,6 +530,7 @@ - start - [local](/tidb-cloud/ticloud-import-start-local.md) - [s3](/tidb-cloud/ticloud-import-start-s3.md) + - [mysql](/tidb-cloud/ticloud-import-start-mysql.md) - project - [list](/tidb-cloud/ticloud-project-list.md) - [update](/tidb-cloud/ticloud-update.md) diff --git a/tidb-cloud/ticloud-import-start-local.md b/tidb-cloud/ticloud-import-start-local.md index 1c86739bc41ca..3ee10580b1f6d 100644 --- a/tidb-cloud/ticloud-import-start-local.md +++ b/tidb-cloud/ticloud-import-start-local.md @@ -39,25 +39,25 @@ ticloud import start local --project-id --cluster-id **Note:** +> +> It depends on 'mysql' command-line tool, please make sure you have installed it and add to path. + +## Examples + +Start an import task in interactive mode: + +```shell +ticloud import start mysql +``` + +Start an import task in non-interactive mode(using root user): + + +```shell +ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --password +``` + +Start an import task with a specific user: + +```shell +ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --password --user +``` + +Start an import task skipping create table: + +```shell +ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --password --skip-create-table +``` + +> **Note:** +> +> Mysql 8.0 uses `utf8mb4_0900_ai_ci` as the default collation, which is not supported by TiDB. You can alter the source table collation, or manually create tht target table. + +## Flags + +In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. + +| Flag | Description | Required | Note | +|--------------------------|-------------------------------------------|----------|------------------------------------------------------| +| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | +| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | +| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | +| --source-database string | The database of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-host string | The host of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-password string | The password of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-port int | The port of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-table string | The table of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-user string | The user of the source MySQL | Yes | Only works in non-interactive mode. | +| --target-database string | Target database to import data to | Yes | Only works in non-interactive mode. | +| --target-table string | Target table to import data to | Yes | Only works in non-interactive mode. | +| --target-user string | The user of the target serverless cluster | No | Only works in non-interactive mode. | + +## Inherited flags + +| Flag | Description | Required | Note | +|----------------------|------------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| +| --no-color | Disables color in output | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | +| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | + +## Feedback + +If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an [issue](https://github.com/tidbcloud/tidbcloud-cli/issues/new/choose). Also, we welcome any contributions. diff --git a/tidb-cloud/ticloud-import-start-s3.md b/tidb-cloud/ticloud-import-start-s3.md index 7146b08217c4d..fc3ea7591e74b 100644 --- a/tidb-cloud/ticloud-import-start-s3.md +++ b/tidb-cloud/ticloud-import-start-s3.md @@ -39,25 +39,25 @@ ticloud import start s3 --project-id --cluster-id --aw In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. -| Flag | Description | Required | Note | -|-------------------------|----------------------------------------------------------|----------|-----------------------------------| -| --aws-role-arn string | AWS S3 IAM Role ARN | Yes | Only works in non-interactive mode. | -| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | -| --data-format string | Data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | -| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --source-url string | The S3 path where the source data files are stored | Yes | Only works in non-interactive mode. | +| Flag | Description | Required | Note | +|-------------------------|-------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| +| --aws-role-arn string | AWS S3 IAM Role ARN | Yes | Only works in non-interactive mode. | +| --backslash-escape | Parses backslashes inside fields as escape characters (`true` by default) for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | +| --data-format string | Data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | +| --delimiter string | Specifies the delimiter used for quoting (`"` by default) for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | +| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | +| --separator string | Specifies the field separator of CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --source-url string | The S3 path where the source data files are stored | Yes | Only works in non-interactive mode. | +| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | ## Inherited flags -| Flag | Description | Required | Note | -|-----------------------|------------------------------------------------------------------------------------------------|----------|-------------------------------------------------------------------------------------------------------------------| -| --backslash-escape | Parses backslashes inside fields as escape characters (`true` by default) for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| --delimiter string | Specifies the delimiter used for quoting (`"` by default) for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| --no-color | Disables color in output | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | -| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command | No | Works in both non-interactive and interactive modes. | -| --separator string | Specifies the field separator of CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| Flag | Description | Required | Note | +|----------------------|-----------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| +| --no-color | Disables color in output | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | +| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command | No | Works in both non-interactive and interactive modes. | ## Feedback From a5b738b729097d3407e116a15416a9da12fa48de Mon Sep 17 00:00:00 2001 From: yangxin Date: Mon, 5 Jun 2023 15:36:29 +0800 Subject: [PATCH 02/15] fix lint --- tidb-cloud/ticloud-import-start-mysql.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index c36fa93fadd61..161c1c48c922f 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -5,8 +5,7 @@ summary: The reference of `ticloud import start mysql`. # ticloud import start mysql -Import one table from a MySQL compatible database to a [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#tidb-serverless-beta) cluster, -the target table name is the same as the source table name: +Import one table from a MySQL compatible database to a [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#tidb-serverless-beta) cluster, the target table name is the same as the source table name: ```shell ticloud import start mysql [flags] @@ -26,7 +25,6 @@ ticloud import start mysql Start an import task in non-interactive mode(using root user): - ```shell ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --password ``` From a389643c02c0128eba32bb31015866714c2c4dfc Mon Sep 17 00:00:00 2001 From: yangxin Date: Mon, 5 Jun 2023 17:10:47 +0800 Subject: [PATCH 03/15] polish --- tidb-cloud/ticloud-import-start-mysql.md | 38 +++++++++++++----------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index 161c1c48c922f..c9624cfd25628 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -23,22 +23,22 @@ Start an import task in interactive mode: ticloud import start mysql ``` -Start an import task in non-interactive mode(using root user): +Start an import task in non-interactive mode(using the default user '.root'): ```shell -ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --password +ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password ``` Start an import task with a specific user: ```shell -ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --password --user +ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --target-user ``` Start an import task skipping create table: ```shell -ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --password --skip-create-table +ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --skip-create-table ``` > **Note:** @@ -49,20 +49,22 @@ ticloud import start mysql --project-id --cluster-id - In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. -| Flag | Description | Required | Note | -|--------------------------|-------------------------------------------|----------|------------------------------------------------------| -| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | -| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --source-database string | The database of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-host string | The host of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-password string | The password of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-port int | The port of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-table string | The table of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-user string | The user of the source MySQL | Yes | Only works in non-interactive mode. | -| --target-database string | Target database to import data to | Yes | Only works in non-interactive mode. | -| --target-table string | Target table to import data to | Yes | Only works in non-interactive mode. | -| --target-user string | The user of the target serverless cluster | No | Only works in non-interactive mode. | +| Flag | Description | Required | Note | +|--------------------------|-----------------------------------------------|----------|------------------------------------------------------| +| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | +| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | +| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | +| --skip-create-table | Skip create table | No | Only works in non-interactive mode. | +| --source-database string | The database of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-host string | The host of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-password string | The password of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-port int | The port of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-table string | The table of the source MySQL | Yes | Only works in non-interactive mode. | +| --source-user string | The user of the source MySQL | Yes | Only works in non-interactive mode. | +| --target-database string | Target database to import data to | Yes | Only works in non-interactive mode. | +| --target-password string | The password of the target serverless cluster | Yes | Only works in non-interactive mode. | +| --target-table string | Target table to import data to | Yes | Only works in non-interactive mode. | +| --target-user string | The user of the target serverless cluster | No | Only works in non-interactive mode. | ## Inherited flags From 681aefd93f9eeda9a91cc71b9e7197902ec3afab Mon Sep 17 00:00:00 2001 From: Leon Yang Date: Mon, 5 Jun 2023 17:16:46 +0800 Subject: [PATCH 04/15] Update tidb-cloud/ticloud-import-start-mysql.md Co-authored-by: Xiang Zhang --- tidb-cloud/ticloud-import-start-mysql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index c9624cfd25628..b2976ae19131d 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -43,7 +43,7 @@ ticloud import start mysql --project-id --cluster-id - > **Note:** > -> Mysql 8.0 uses `utf8mb4_0900_ai_ci` as the default collation, which is not supported by TiDB. You can alter the source table collation, or manually create tht target table. +> Mysql 8.0 uses `utf8mb4_0900_ai_ci` as the default collation, which is not supported by TiDB. You can alter the source table collation, or manually create the target table. ## Flags From e87398ea889169019d621b88130441223c4e0281 Mon Sep 17 00:00:00 2001 From: yangxin Date: Mon, 5 Jun 2023 17:29:34 +0800 Subject: [PATCH 05/15] fix unclosed tag --- tidb-cloud/ticloud-import-start-mysql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index b2976ae19131d..9133c952efcbf 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -23,7 +23,7 @@ Start an import task in interactive mode: ticloud import start mysql ``` -Start an import task in non-interactive mode(using the default user '.root'): +Start an import task in non-interactive mode(using the default user `.root`): ```shell ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password From ddd659162ac65f35e039aaf5cf7d438a0add141f Mon Sep 17 00:00:00 2001 From: Leon Yang Date: Tue, 6 Jun 2023 18:35:55 +0800 Subject: [PATCH 06/15] Apply suggestions from code review Co-authored-by: Grace Cai --- tidb-cloud/ticloud-import-start-local.md | 8 +++--- tidb-cloud/ticloud-import-start-mysql.md | 35 ++++++++++++------------ tidb-cloud/ticloud-import-start-s3.md | 8 +++--- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/tidb-cloud/ticloud-import-start-local.md b/tidb-cloud/ticloud-import-start-local.md index 3ee10580b1f6d..2696fa288f11a 100644 --- a/tidb-cloud/ticloud-import-start-local.md +++ b/tidb-cloud/ticloud-import-start-local.md @@ -41,16 +41,16 @@ In non-interactive mode, you need to manually enter the required flags. In inter | Flag | Description | Required | Note | |--------------------------|-------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| -| --backslash-escape | Parses backslashes inside fields as escape characters (`true` by default) for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --backslash-escape | Parses backslashes inside fields as escape characters for CSV files (`true` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | | --data-format string | Data format (Currently, only `CSV` is supported) | Yes | Only works in non-interactive mode. | -| --delimiter string | Specifies the delimiter used for quoting (`"` by default) for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --delimiter string | The delimiter used for quoting for CSV files (`"` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | | -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --separator string | Specifies the field separator of CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --separator string | The field separator for CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | --target-database string | Target database to import data to | Yes | Only works in non-interactive mode. | | --target-table string | Target table to import data to | Yes | Only works in non-interactive mode. | -| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files (`true` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | ## Inherited flags diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index 9133c952efcbf..56b9159bb7ee1 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -5,7 +5,7 @@ summary: The reference of `ticloud import start mysql`. # ticloud import start mysql -Import one table from a MySQL compatible database to a [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#tidb-serverless-beta) cluster, the target table name is the same as the source table name: +Import a table from a MySQL-compatible database to a [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#tidb-serverless-beta) cluster: ```shell ticloud import start mysql [flags] @@ -13,7 +13,9 @@ ticloud import start mysql [flags] > **Note:** > -> It depends on 'mysql' command-line tool, please make sure you have installed it and add to path. +> - Before running this command, make sure that you have installed a `mysql` command-line tool first. +> - If the target table already exists in the target database, to use this command for table import, make sure that the target table name is the same as the source table name and add the `skip-create-table` flag to the command. +> - If the target table does not exist in the target database, executing this command will automatically create a target table with the same name as the source table in the target database. ## Examples @@ -23,19 +25,19 @@ Start an import task in interactive mode: ticloud import start mysql ``` -Start an import task in non-interactive mode(using the default user `.root`): +Start an import task in non-interactive mode (using the TiDB Serverless cluster default user `.root`): ```shell ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password ``` -Start an import task with a specific user: +Start an import task in non-interactive mode (using a specific user): ```shell ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --target-user ``` -Start an import task skipping create table: +Start an import task that skips creating the target table if it already exists in the target database: ```shell ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --skip-create-table @@ -43,7 +45,7 @@ ticloud import start mysql --project-id --cluster-id - > **Note:** > -> Mysql 8.0 uses `utf8mb4_0900_ai_ci` as the default collation, which is not supported by TiDB. You can alter the source table collation, or manually create the target table. +> MySQL 8.0 uses `utf8mb4_0900_ai_ci` as the default collation, which is currently not supported by TiDB. If your source table uses the `utf8mb4_0900_ai_ci` collation, before the import, you need to either alter the source table collation to a [supported collation of TiDB](/character-set-and-collation.md#character-sets-and-collations-supported-by-tidb) or manually create the target table in TiDB. ## Flags @@ -54,17 +56,16 @@ In non-interactive mode, you need to manually enter the required flags. In inter | -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | | -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | | -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --skip-create-table | Skip create table | No | Only works in non-interactive mode. | -| --source-database string | The database of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-host string | The host of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-password string | The password of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-port int | The port of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-table string | The table of the source MySQL | Yes | Only works in non-interactive mode. | -| --source-user string | The user of the source MySQL | Yes | Only works in non-interactive mode. | -| --target-database string | Target database to import data to | Yes | Only works in non-interactive mode. | -| --target-password string | The password of the target serverless cluster | Yes | Only works in non-interactive mode. | -| --target-table string | Target table to import data to | Yes | Only works in non-interactive mode. | -| --target-user string | The user of the target serverless cluster | No | Only works in non-interactive mode. | +| --skip-create-table | Skip creating the target table if it already exists in the target database | No | Only works in non-interactive mode. | +| --source-database string | The name of the source MySQL database | Yes | Only works in non-interactive mode. | +| --source-host string | The host of the source MySQL database | Yes | Only works in non-interactive mode. | +| --source-password string | The password of the source MySQL database | Yes | Only works in non-interactive mode. | +| --source-port int | The port of the source MySQL database | Yes | Only works in non-interactive mode. | +| --source-table string | The source table name in the source MySQL database | Yes | Only works in non-interactive mode. | +| --source-user string | The user to log in to the source MySQL database | Yes | Only works in non-interactive mode. | +| --target-database string | The target database name in TiDB | Yes | Only works in non-interactive mode. | +| --target-password string | The password of the target TiDB Serverless cluster | Yes | Only works in non-interactive mode. | +| --target-user string | The user to log in to the target TiDB Serverless cluster | No | Only works in non-interactive mode. | ## Inherited flags diff --git a/tidb-cloud/ticloud-import-start-s3.md b/tidb-cloud/ticloud-import-start-s3.md index fc3ea7591e74b..443f4cb51edf7 100644 --- a/tidb-cloud/ticloud-import-start-s3.md +++ b/tidb-cloud/ticloud-import-start-s3.md @@ -42,15 +42,15 @@ In non-interactive mode, you need to manually enter the required flags. In inter | Flag | Description | Required | Note | |-------------------------|-------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| | --aws-role-arn string | AWS S3 IAM Role ARN | Yes | Only works in non-interactive mode. | -| --backslash-escape | Parses backslashes inside fields as escape characters (`true` by default) for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --backslash-escape | Parses backslashes inside fields as escape characters for CSV files (`true` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | | --data-format string | Data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | -| --delimiter string | Specifies the delimiter used for quoting (`"` by default) for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --delimiter string | The delimiter used for quoting for CSV files (`"` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | | -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --separator string | Specifies the field separator of CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --separator string | The field separator for CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | --source-url string | The S3 path where the source data files are stored | Yes | Only works in non-interactive mode. | -| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files (`true` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | ## Inherited flags From a545d6b37ec0d6cb32097ed43b5497c7ce697726 Mon Sep 17 00:00:00 2001 From: yangxin Date: Tue, 6 Jun 2023 19:11:32 +0800 Subject: [PATCH 07/15] polish --- tidb-cloud/ticloud-import-start-local.md | 32 ++++++++++++------------ tidb-cloud/ticloud-import-start-mysql.md | 32 ++++++++++++------------ tidb-cloud/ticloud-import-start-s3.md | 24 +++++++++--------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/tidb-cloud/ticloud-import-start-local.md b/tidb-cloud/ticloud-import-start-local.md index 2696fa288f11a..81ea841b1a635 100644 --- a/tidb-cloud/ticloud-import-start-local.md +++ b/tidb-cloud/ticloud-import-start-local.md @@ -39,25 +39,25 @@ ticloud import start local --project-id --cluster-id **Note:** > -> - Before running this command, make sure that you have installed a `mysql` command-line tool first. +> - Before running this command, make sure that you have installed the `mysql` command-line tool first. > - If the target table already exists in the target database, to use this command for table import, make sure that the target table name is the same as the source table name and add the `skip-create-table` flag to the command. > - If the target table does not exist in the target database, executing this command will automatically create a target table with the same name as the source table in the target database. @@ -51,21 +51,21 @@ ticloud import start mysql --project-id --cluster-id - In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. -| Flag | Description | Required | Note | -|--------------------------|-----------------------------------------------|----------|------------------------------------------------------| -| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | -| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --skip-create-table | Skip creating the target table if it already exists in the target database | No | Only works in non-interactive mode. | -| --source-database string | The name of the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-host string | The host of the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-password string | The password of the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-port int | The port of the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-table string | The source table name in the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-user string | The user to log in to the source MySQL database | Yes | Only works in non-interactive mode. | -| --target-database string | The target database name in TiDB | Yes | Only works in non-interactive mode. | -| --target-password string | The password of the target TiDB Serverless cluster | Yes | Only works in non-interactive mode. | -| --target-user string | The user to log in to the target TiDB Serverless cluster | No | Only works in non-interactive mode. | +| Flag | Description | Required | Note | +|--------------------------|----------------------------------------------------------------------------|----------|------------------------------------------------------| +| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | +| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | +| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | +| --skip-create-table | Skip creating the target table if it already exists in the target database | No | Only works in non-interactive mode. | +| --source-database string | The name of the source MySQL database | Yes | Only works in non-interactive mode. | +| --source-host string | The host of the source MySQL instance | Yes | Only works in non-interactive mode. | +| --source-password string | The password of the source MySQL instance | Yes | Only works in non-interactive mode. | +| --source-port int | The port of the source MySQL instance | Yes | Only works in non-interactive mode. | +| --source-table string | The source table name in the source MySQL database | Yes | Only works in non-interactive mode. | +| --source-user string | The user to log in to the source MySQL instance | Yes | Only works in non-interactive mode. | +| --target-database string | The target database name in TiDB Serverless cluster | Yes | Only works in non-interactive mode. | +| --target-password string | The password of the target TiDB Serverless cluster | Yes | Only works in non-interactive mode. | +| --target-user string | The user to log in to the target TiDB Serverless cluster | No | Only works in non-interactive mode. | ## Inherited flags diff --git a/tidb-cloud/ticloud-import-start-s3.md b/tidb-cloud/ticloud-import-start-s3.md index 443f4cb51edf7..32b661cb73556 100644 --- a/tidb-cloud/ticloud-import-start-s3.md +++ b/tidb-cloud/ticloud-import-start-s3.md @@ -39,18 +39,18 @@ ticloud import start s3 --project-id --cluster-id --aw In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. -| Flag | Description | Required | Note | -|-------------------------|-------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| -| --aws-role-arn string | AWS S3 IAM Role ARN | Yes | Only works in non-interactive mode. | -| --backslash-escape | Parses backslashes inside fields as escape characters for CSV files (`true` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | -| --data-format string | Data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | -| --delimiter string | The delimiter used for quoting for CSV files (`"` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --separator string | The field separator for CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| --source-url string | The S3 path where the source data files are stored | Yes | Only works in non-interactive mode. | -| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files (`true` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| Flag | Description | Required | Note | +|-------------------------|----------------------------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| +| --aws-role-arn string | AWS S3 IAM Role ARN | Yes | Only works in non-interactive mode. | +| --backslash-escape | Parses backslashes inside fields as escape characters for CSV files (`true` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | +| --data-format string | Data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | +| --delimiter string | The delimiter used for quoting for CSV files (`"` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | +| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | +| --separator string | The field separator for CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --source-url string | The S3 path where the source data files are stored | Yes | Only works in non-interactive mode. | +| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files (`false` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | ## Inherited flags From 3a20666e412e9165bed5aa92e74e139be405e79c Mon Sep 17 00:00:00 2001 From: Xiang Zhang Date: Tue, 6 Jun 2023 19:29:19 +0800 Subject: [PATCH 08/15] Apply suggestions from code review --- tidb-cloud/ticloud-import-start-mysql.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index 94461e99b6eac..656490e66a760 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -62,10 +62,10 @@ In non-interactive mode, you need to manually enter the required flags. In inter | --source-password string | The password of the source MySQL instance | Yes | Only works in non-interactive mode. | | --source-port int | The port of the source MySQL instance | Yes | Only works in non-interactive mode. | | --source-table string | The source table name in the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-user string | The user to log in to the source MySQL instance | Yes | Only works in non-interactive mode. | +| --source-user string | The user to login to the source MySQL instance | Yes | Only works in non-interactive mode. | | --target-database string | The target database name in TiDB Serverless cluster | Yes | Only works in non-interactive mode. | | --target-password string | The password of the target TiDB Serverless cluster | Yes | Only works in non-interactive mode. | -| --target-user string | The user to log in to the target TiDB Serverless cluster | No | Only works in non-interactive mode. | +| --target-user string | The user to login to the target TiDB Serverless cluster | No | Only works in non-interactive mode. | ## Inherited flags From d5e47691dd148fe82ba6c2b310e87f33c2f57350 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Wed, 7 Jun 2023 11:47:09 +0800 Subject: [PATCH 09/15] Apply suggestions from code review --- tidb-cloud/ticloud-import-start-mysql.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index 656490e66a760..94461e99b6eac 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -62,10 +62,10 @@ In non-interactive mode, you need to manually enter the required flags. In inter | --source-password string | The password of the source MySQL instance | Yes | Only works in non-interactive mode. | | --source-port int | The port of the source MySQL instance | Yes | Only works in non-interactive mode. | | --source-table string | The source table name in the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-user string | The user to login to the source MySQL instance | Yes | Only works in non-interactive mode. | +| --source-user string | The user to log in to the source MySQL instance | Yes | Only works in non-interactive mode. | | --target-database string | The target database name in TiDB Serverless cluster | Yes | Only works in non-interactive mode. | | --target-password string | The password of the target TiDB Serverless cluster | Yes | Only works in non-interactive mode. | -| --target-user string | The user to login to the target TiDB Serverless cluster | No | Only works in non-interactive mode. | +| --target-user string | The user to log in to the target TiDB Serverless cluster | No | Only works in non-interactive mode. | ## Inherited flags From 88ec6cbea178b10450fc414e1acd49355baa38f8 Mon Sep 17 00:00:00 2001 From: yangxin Date: Wed, 7 Jun 2023 14:09:46 +0800 Subject: [PATCH 10/15] Add mysql installation instruction --- tidb-cloud/get-started-with-cli.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tidb-cloud/get-started-with-cli.md b/tidb-cloud/get-started-with-cli.md index 16f2eca4af30c..9f5fecb00ce45 100644 --- a/tidb-cloud/get-started-with-cli.md +++ b/tidb-cloud/get-started-with-cli.md @@ -42,6 +42,26 @@ For macOS or Linux, you can install `ticloud` using any of the following methods To set up `ticloud` in GitHub Action, use [`setup-tidbcloud-cli`](https://github.com/tidbcloud/setup-tidbcloud-cli). +The MySQL command-line client can be installed via your package manager. + +- Debian-based distributions: + + ```shell + sudo apt-get install mysql-client + ``` + +- RPM-based distributions: + + ```shell + sudo yum install mysql + ``` + +- macOS: + + ```shell + brew install mysql-client + ``` +
@@ -56,6 +76,8 @@ For Windows, you can install `ticloud` using either of the following methods: To set up `ticloud` in GitHub Actions, use [`setup-tidbcloud-cli`](https://github.com/tidbcloud/setup-tidbcloud-cli). +The MySQL command-line client is available in the [Windows MySQL Installer](https://dev.mysql.com/doc/refman/8.0/en/windows-installation.html). To launch `ticloud connect` in Windows, you need to have the `mysql.exe` executable's directory in your shell's PATH. +
From 616b01347b5dd3f98f42caaf5d3b1dd6c0b08180 Mon Sep 17 00:00:00 2001 From: Leon Yang Date: Wed, 7 Jun 2023 14:13:11 +0800 Subject: [PATCH 11/15] Update tidb-cloud/ticloud-import-start-mysql.md Co-authored-by: Grace Cai --- tidb-cloud/ticloud-import-start-mysql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index 94461e99b6eac..1b60e7a825a25 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -15,7 +15,7 @@ ticloud import start mysql [flags] > > - Before running this command, make sure that you have installed the `mysql` command-line tool first. > - If the target table already exists in the target database, to use this command for table import, make sure that the target table name is the same as the source table name and add the `skip-create-table` flag to the command. -> - If the target table does not exist in the target database, executing this command will automatically create a target table with the same name as the source table in the target database. +> - If the target table does not exist in the target database, executing this command automatically creates a target table with the same name as the source table in the target database. ## Examples From 43da4d37d4bca6aa1dc8f6cb0b4a88abc12bbd8e Mon Sep 17 00:00:00 2001 From: Leon Yang Date: Wed, 7 Jun 2023 16:51:05 +0800 Subject: [PATCH 12/15] Apply suggestions from code review Co-authored-by: Grace Cai --- tidb-cloud/get-started-with-cli.md | 4 ++-- tidb-cloud/ticloud-import-start-mysql.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tidb-cloud/get-started-with-cli.md b/tidb-cloud/get-started-with-cli.md index 9f5fecb00ce45..4f4a7c8d0a817 100644 --- a/tidb-cloud/get-started-with-cli.md +++ b/tidb-cloud/get-started-with-cli.md @@ -42,7 +42,7 @@ For macOS or Linux, you can install `ticloud` using any of the following methods To set up `ticloud` in GitHub Action, use [`setup-tidbcloud-cli`](https://github.com/tidbcloud/setup-tidbcloud-cli). -The MySQL command-line client can be installed via your package manager. +Install the MySQL command-line client if you do not have it. You can install it via your package manager: - Debian-based distributions: @@ -76,7 +76,7 @@ For Windows, you can install `ticloud` using either of the following methods: To set up `ticloud` in GitHub Actions, use [`setup-tidbcloud-cli`](https://github.com/tidbcloud/setup-tidbcloud-cli). -The MySQL command-line client is available in the [Windows MySQL Installer](https://dev.mysql.com/doc/refman/8.0/en/windows-installation.html). To launch `ticloud connect` in Windows, you need to have the `mysql.exe` executable's directory in your shell's PATH. +Install the MySQL command-line client if you do not have it. You can refer to the instructions in [Windows MySQL Installer](https://dev.mysql.com/doc/refman/8.0/en/windows-installation.html) for the installation. To launch `ticloud connect` in Windows, you need to have the `mysql.exe` executable's directory in your shell's PATH. diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index 1b60e7a825a25..c3d63ec5cdf9c 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -13,7 +13,7 @@ ticloud import start mysql [flags] > **Note:** > -> - Before running this command, make sure that you have installed the `mysql` command-line tool first. +> - Before running this command, make sure that you have installed the MySQL command-line tool first. See [Installation](/tidb-cloud/get-started-with-cli.md#installation) for details. > - If the target table already exists in the target database, to use this command for table import, make sure that the target table name is the same as the source table name and add the `skip-create-table` flag to the command. > - If the target table does not exist in the target database, executing this command automatically creates a target table with the same name as the source table in the target database. From c46a8a15214a231b83a50c9d1eb616b96e1056b0 Mon Sep 17 00:00:00 2001 From: Leon Yang Date: Thu, 8 Jun 2023 15:48:08 +0800 Subject: [PATCH 13/15] Apply suggestions from code review Co-authored-by: Aolin --- tidb-cloud/get-started-with-cli.md | 2 +- tidb-cloud/ticloud-import-start-local.md | 32 +++++----- tidb-cloud/ticloud-import-start-mysql.md | 76 ++++++++++++------------ tidb-cloud/ticloud-import-start-s3.md | 32 +++++----- 4 files changed, 71 insertions(+), 71 deletions(-) diff --git a/tidb-cloud/get-started-with-cli.md b/tidb-cloud/get-started-with-cli.md index 4f4a7c8d0a817..47f31093bc395 100644 --- a/tidb-cloud/get-started-with-cli.md +++ b/tidb-cloud/get-started-with-cli.md @@ -76,7 +76,7 @@ For Windows, you can install `ticloud` using either of the following methods: To set up `ticloud` in GitHub Actions, use [`setup-tidbcloud-cli`](https://github.com/tidbcloud/setup-tidbcloud-cli). -Install the MySQL command-line client if you do not have it. You can refer to the instructions in [Windows MySQL Installer](https://dev.mysql.com/doc/refman/8.0/en/windows-installation.html) for the installation. To launch `ticloud connect` in Windows, you need to have the `mysql.exe` executable's directory in your shell's PATH. +Install the MySQL command-line client if you do not have it. You can refer to the instructions in [MySQL Installer for Windows](https://dev.mysql.com/doc/refman/8.0/en/mysql-installer.html) for the installation. To launch `ticloud connect` on Windows, you need to have the directory containing `mysql.exe` in the PATH environment variable. diff --git a/tidb-cloud/ticloud-import-start-local.md b/tidb-cloud/ticloud-import-start-local.md index 81ea841b1a635..eb2957a7cb65a 100644 --- a/tidb-cloud/ticloud-import-start-local.md +++ b/tidb-cloud/ticloud-import-start-local.md @@ -39,25 +39,25 @@ ticloud import start local --project-id --cluster-id **Note:** > -> - Before running this command, make sure that you have installed the MySQL command-line tool first. See [Installation](/tidb-cloud/get-started-with-cli.md#installation) for details. -> - If the target table already exists in the target database, to use this command for table import, make sure that the target table name is the same as the source table name and add the `skip-create-table` flag to the command. -> - If the target table does not exist in the target database, executing this command automatically creates a target table with the same name as the source table in the target database. +> - Before running this command, make sure that you have installed the MySQL command-line tool first. For more details, see [Installation](/tidb-cloud/get-started-with-cli.md#installation). +> - If the target table already exists in the target database, to use this command for table import, make sure that the target table name is the same as the source table name and add the `skip-create-table` flag in the command. +> - If the target table does not exist in the target database, executing this command automatically creates a table with the same name as the source table in the target database. ## Examples -Start an import task in interactive mode: +- Start an import task in interactive mode: -```shell -ticloud import start mysql -``` + ```shell + ticloud import start mysql + ``` -Start an import task in non-interactive mode (using the TiDB Serverless cluster default user `.root`): +- Start an import task in non-interactive mode (using the TiDB Serverless cluster default user `.root`): -```shell -ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password -``` + ```shell + ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password + ``` -Start an import task in non-interactive mode (using a specific user): +- Start an import task in non-interactive mode (using a specific user): -```shell -ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --target-user -``` + ```shell + ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --target-user + ``` -Start an import task that skips creating the target table if it already exists in the target database: +- Start an import task that skips creating the target table if it already exists in the target database: -```shell -ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --skip-create-table -``` + ```shell + ticloud import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --skip-create-table + ``` > **Note:** > @@ -51,28 +51,28 @@ ticloud import start mysql --project-id --cluster-id - In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. -| Flag | Description | Required | Note | -|--------------------------|----------------------------------------------------------------------------|----------|------------------------------------------------------| -| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | -| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --skip-create-table | Skip creating the target table if it already exists in the target database | No | Only works in non-interactive mode. | -| --source-database string | The name of the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-host string | The host of the source MySQL instance | Yes | Only works in non-interactive mode. | -| --source-password string | The password of the source MySQL instance | Yes | Only works in non-interactive mode. | -| --source-port int | The port of the source MySQL instance | Yes | Only works in non-interactive mode. | -| --source-table string | The source table name in the source MySQL database | Yes | Only works in non-interactive mode. | -| --source-user string | The user to log in to the source MySQL instance | Yes | Only works in non-interactive mode. | -| --target-database string | The target database name in TiDB Serverless cluster | Yes | Only works in non-interactive mode. | -| --target-password string | The password of the target TiDB Serverless cluster | Yes | Only works in non-interactive mode. | -| --target-user string | The user to log in to the target TiDB Serverless cluster | No | Only works in non-interactive mode. | +| Flag | Description | Required | Note | +|---|---|---|---| +| -c, --cluster-id string | Specifies the cluster ID. | Yes | Only works in non-interactive mode. | +| -h, --help | Displays help information for this command. | No | Works in both non-interactive and interactive modes. | +| -p, --project-id string | Specifies the project ID | Yes | Only works in non-interactive mode. | +| --skip-create-table | Skips creating the target table if it already exists in the target database. | No | Only works in non-interactive mode. | +| --source-database string | The name of the source MySQL database. | Yes | Only works in non-interactive mode. | +| --source-host string | The host of the source MySQL instance. | Yes | Only works in non-interactive mode. | +| --source-password string | The password for the source MySQL instance. | Yes | Only works in non-interactive mode. | +| --source-port int | The port of the source MySQL instance. | Yes | Only works in non-interactive mode. | +| --source-table string | The source table name in the source MySQL database. | Yes | Only works in non-interactive mode. | +| --source-user string | The user to log in to the source MySQL instance. | Yes | Only works in non-interactive mode. | +| --target-database string | The target database name in the TiDB Serverless cluster. | Yes | Only works in non-interactive mode. | +| --target-password string | The password for the target TiDB Serverless cluster. | Yes | Only works in non-interactive mode. | +| --target-user string | The user to log in to the target TiDB Serverless cluster. | No | Only works in non-interactive mode. | ## Inherited flags -| Flag | Description | Required | Note | -|----------------------|------------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| -| --no-color | Disables color in output | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | -| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | +| Flag | Description | Required | Note | +|---|---|---|---| +| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | +| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | ## Feedback diff --git a/tidb-cloud/ticloud-import-start-s3.md b/tidb-cloud/ticloud-import-start-s3.md index 32b661cb73556..96980a7d05d6e 100644 --- a/tidb-cloud/ticloud-import-start-s3.md +++ b/tidb-cloud/ticloud-import-start-s3.md @@ -39,25 +39,25 @@ ticloud import start s3 --project-id --cluster-id --aw In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. -| Flag | Description | Required | Note | -|-------------------------|----------------------------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| -| --aws-role-arn string | AWS S3 IAM Role ARN | Yes | Only works in non-interactive mode. | -| --backslash-escape | Parses backslashes inside fields as escape characters for CSV files (`true` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| -c, --cluster-id string | Cluster ID | Yes | Only works in non-interactive mode. | -| --data-format string | Data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | -| --delimiter string | The delimiter used for quoting for CSV files (`"` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| -h, --help | Help information for this command | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Project ID | Yes | Only works in non-interactive mode. | -| --separator string | The field separator for CSV files (`,` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| --source-url string | The S3 path where the source data files are stored | Yes | Only works in non-interactive mode. | -| --trim-last-separator | Treats separators as the line terminators and trims all trailing separators for CSV files (`false` by default) | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| Flag | Description | Required | Note | +|---|---|---|---| +| --aws-role-arn string | The specific AWS role ARN that needs to be assumed to access the Amazon S3 data source. | Yes | Only works in non-interactive mode. | +| --backslash-escape | Whether to parse backslashes inside fields as escape characters for CSV files. The default value is `true`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| -c, --cluster-id string | Specifies the cluster ID. | Yes | Only works in non-interactive mode. | +| --data-format string | Specifies the data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | +| --delimiter string | Specifies the delimiter used for quoting for CSV files. The default value is `"`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| -h, --help | Displays help information for this command. | No | Works in both non-interactive and interactive modes. | +| -p, --project-id string | Specifies the project ID. | Yes | Only works in non-interactive mode. | +| --separator string | Specifies the field separator for CSV files. The default value is `,`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | +| --source-url string | The S3 path where the source data files are stored. | Yes | Only works in non-interactive mode. | +| --trim-last-separator | Whether to treat separators as line terminators and trim all trailing separators for CSV files. The default value is `false`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | ## Inherited flags -| Flag | Description | Required | Note | -|----------------------|-----------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| -| --no-color | Disables color in output | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | -| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command | No | Works in both non-interactive and interactive modes. | +| Flag | Description | Required | Note | +|---|---|---|---| +| --no-color | Disables color in output | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | +| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | ## Feedback From fec319e0b38a51e0281d18b7f62d317f280171e7 Mon Sep 17 00:00:00 2001 From: Leon Yang Date: Fri, 9 Jun 2023 10:51:29 +0800 Subject: [PATCH 14/15] Apply suggestions from code review Co-authored-by: Aolin --- tidb-cloud/ticloud-import-start-local.md | 2 +- tidb-cloud/ticloud-import-start-mysql.md | 2 +- tidb-cloud/ticloud-import-start-s3.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tidb-cloud/ticloud-import-start-local.md b/tidb-cloud/ticloud-import-start-local.md index eb2957a7cb65a..d1bcd7ff80d8f 100644 --- a/tidb-cloud/ticloud-import-start-local.md +++ b/tidb-cloud/ticloud-import-start-local.md @@ -56,7 +56,7 @@ In non-interactive mode, you need to manually enter the required flags. In inter | Flag | Description | Required | Note | |---|---|---|---| -| --no-color | Disables color in output | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | +| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | | -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | ## Feedback diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md index 276638c0abb3d..1d92e3c420982 100644 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ b/tidb-cloud/ticloud-import-start-mysql.md @@ -55,7 +55,7 @@ In non-interactive mode, you need to manually enter the required flags. In inter |---|---|---|---| | -c, --cluster-id string | Specifies the cluster ID. | Yes | Only works in non-interactive mode. | | -h, --help | Displays help information for this command. | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Specifies the project ID | Yes | Only works in non-interactive mode. | +| -p, --project-id string | Specifies the project ID. | Yes | Only works in non-interactive mode. | | --skip-create-table | Skips creating the target table if it already exists in the target database. | No | Only works in non-interactive mode. | | --source-database string | The name of the source MySQL database. | Yes | Only works in non-interactive mode. | | --source-host string | The host of the source MySQL instance. | Yes | Only works in non-interactive mode. | diff --git a/tidb-cloud/ticloud-import-start-s3.md b/tidb-cloud/ticloud-import-start-s3.md index 96980a7d05d6e..c46f584d504db 100644 --- a/tidb-cloud/ticloud-import-start-s3.md +++ b/tidb-cloud/ticloud-import-start-s3.md @@ -44,7 +44,7 @@ In non-interactive mode, you need to manually enter the required flags. In inter | --aws-role-arn string | The specific AWS role ARN that needs to be assumed to access the Amazon S3 data source. | Yes | Only works in non-interactive mode. | | --backslash-escape | Whether to parse backslashes inside fields as escape characters for CSV files. The default value is `true`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | -c, --cluster-id string | Specifies the cluster ID. | Yes | Only works in non-interactive mode. | -| --data-format string | Specifies the data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | +| --data-format string | Specifies the data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | | --delimiter string | Specifies the delimiter used for quoting for CSV files. The default value is `"`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | -h, --help | Displays help information for this command. | No | Works in both non-interactive and interactive modes. | | -p, --project-id string | Specifies the project ID. | Yes | Only works in non-interactive mode. | From 24e9fa8aa75b424885db64af3716159c9cf73d66 Mon Sep 17 00:00:00 2001 From: Leon Yang Date: Fri, 9 Jun 2023 14:49:54 +0800 Subject: [PATCH 15/15] Apply suggestions from code review Co-authored-by: Grace Cai --- tidb-cloud/ticloud-import-start-s3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-cloud/ticloud-import-start-s3.md b/tidb-cloud/ticloud-import-start-s3.md index c46f584d504db..d42f84def8128 100644 --- a/tidb-cloud/ticloud-import-start-s3.md +++ b/tidb-cloud/ticloud-import-start-s3.md @@ -41,7 +41,7 @@ In non-interactive mode, you need to manually enter the required flags. In inter | Flag | Description | Required | Note | |---|---|---|---| -| --aws-role-arn string | The specific AWS role ARN that needs to be assumed to access the Amazon S3 data source. | Yes | Only works in non-interactive mode. | +| --aws-role-arn string | Specifies the AWS role ARN that is used to access the Amazon S3 data source. | Yes | Only works in non-interactive mode. | | --backslash-escape | Whether to parse backslashes inside fields as escape characters for CSV files. The default value is `true`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | | -c, --cluster-id string | Specifies the cluster ID. | Yes | Only works in non-interactive mode. | | --data-format string | Specifies the data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. |