Skip to content

Commit

Permalink
update dumpling code example format (#8999) (#13864)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jun 14, 2023
1 parent 182b064 commit aad8efb
Showing 1 changed file with 5 additions and 39 deletions.
44 changes: 5 additions & 39 deletions dumpling-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,7 @@ Dumpling exports data to SQL files by default. You can also export data to SQL f
{{< copyable "shell-regular" >}}

```shell
dumpling \
-u root \
-P 4000 \
-h 127.0.0.1 \
--filetype sql \
-t 8 \
-o /tmp/test \
-r 200000 \
-F 256MiB
dumpling -u root -P 4000 -h 127.0.0.1 --filetype sql -t 8 -o /tmp/test -r 200000 -F 256MiB
```

In the command above:
Expand Down Expand Up @@ -132,15 +124,7 @@ When you export data to CSV files, you can use `--sql <SQL>` to filter the recor
{{< copyable "shell-regular" >}}

```shell
./dumpling \
-u root \
-P 4000 \
-h 127.0.0.1 \
-o /tmp/test \
--filetype csv \
--sql 'select * from `test`.`sbtest1` where id < 100' \
-F 100MiB \
--output-filename-template 'test.sbtest1.{{.Index}}'
./dumpling -u root -P 4000 -h 127.0.0.1 -o /tmp/test --filetype csv --sql 'select * from `test`.`sbtest1` where id < 100' -F 100MiB --output-filename-template 'test.sbtest1.{{.Index}}'
```

In the command above:
Expand Down Expand Up @@ -257,13 +241,7 @@ When you back up data using Dumpling, explicitly specify the `--s3.region` param
{{< copyable "shell-regular" >}}

```shell
./dumpling \
-u root \
-P 4000 \
-h 127.0.0.1 \
-r 200000 \
-o "s3://${Bucket}/${Folder}" \
--s3.region "${region}"
./dumpling -u root -P 4000 -h 127.0.0.1 -r 200000 -o "s3://${Bucket}/${Folder}" --s3.region "${region}"
```

### Filter the exported data
Expand All @@ -275,12 +253,7 @@ By default, Dumpling exports all databases except system databases (including `m
{{< copyable "shell-regular" >}}

```shell
./dumpling \
-u root \
-P 4000 \
-h 127.0.0.1 \
-o /tmp/test \
--where "id < 100"
./dumpling -u root -P 4000 -h 127.0.0.1 -o /tmp/test --where "id < 100"
```

The above command exports the data that matches `id < 100` from each table. Note that you cannot use the `--where` parameter together with `--sql`.
Expand All @@ -292,14 +265,7 @@ Dumpling can filter specific databases or tables by specifying the table filter
{{< copyable "shell-regular" >}}

```shell
./dumpling \
-u root \
-P 4000 \
-h 127.0.0.1 \
-o /tmp/test \
-r 200000 \
--filter "employees.*" \
--filter "*.WorkOrder"
./dumpling -u root -P 4000 -h 127.0.0.1 -o /tmp/test -r 200000 --filter "employees.*" --filter "*.WorkOrder"
```

The above command exports all the tables in the `employees` database and the `WorkOrder` tables in all databases.
Expand Down

0 comments on commit aad8efb

Please sign in to comment.