Skip to content

Commit

Permalink
update dumpling code example format (#8999) (#13866)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jun 14, 2023
1 parent 1471fee commit 1cf4731
Showing 1 changed file with 5 additions and 38 deletions.
43 changes: 5 additions & 38 deletions dumpling-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,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 @@ -131,15 +123,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 @@ -262,12 +246,7 @@ Dumpling also supports reading credential files from `~/.aws/credentials`. Param
{{< copyable "shell-regular" >}}

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

### Filter the exported data
Expand All @@ -279,12 +258,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 @@ -296,14 +270,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 1cf4731

Please sign in to comment.