diff options
author | alextarazanov <alextarazanov@yandex-team.com> | 2022-11-22 16:45:12 +0300 |
---|---|---|
committer | alextarazanov <alextarazanov@yandex-team.com> | 2022-11-22 16:45:12 +0300 |
commit | 38a17156151fed92cfae599d91f6b496e1985a4c (patch) | |
tree | 749287c74367e756cdaf2d2be36b7fc28291c55f | |
parent | fced20b9af826fdc3ec0886fe1f9740467ffba72 (diff) | |
download | ydb-38a17156151fed92cfae599d91f6b496e1985a4c.tar.gz |
[review] [YDB] Check "Added ydb cli commands table drop and copy" translate
Тикеты:
Лог локальной сборки без ошибок.
4 files changed, 94 insertions, 2 deletions
diff --git a/ydb/docs/en/core/reference/ydb-cli/_includes/commands.md b/ydb/docs/en/core/reference/ydb-cli/_includes/commands.md index 394f2a627ad..8c78801c36a 100644 --- a/ydb/docs/en/core/reference/ydb-cli/_includes/commands.md +++ b/ydb/docs/en/core/reference/ydb-cli/_includes/commands.md @@ -53,7 +53,7 @@ Any command can be run from the command line with the `--help` option to get hel | [scripting yql](../scripting-yql.md) | Executing a YQL script | | table attribute add | Adding a table attribute | | table attribute drop | Deleting a table attribute | -| table drop | Deleting a table | +| [table drop](../table-drop.md) | Deleting a table | | [table index add global-async](../commands/secondary_index.md#add) | Adding an asynchronous index | | [table index add global-sync](../commands/secondary_index.md#add) | Adding a synchronous index | | [table index drop](../commands/secondary_index.md#drop) | Deleting an index | @@ -62,7 +62,7 @@ Any command can be run from the command line with the `--help` option to get hel | [table readtable](../commands/readtable.md) | Streaming table reads | | [table ttl set](../table-ttl-set.md) | Setting TTL parameters | | [table ttl drop](../table-ttl-drop.md) | Deleting TTL parameters | -| tools copy | Copying tables | +| [tools copy](../tools-copy.md) | Copying tables | | [tools dump](../export_import/tools_dump.md) | Dumping a directory or table to the file system | | [tools rename](../commands/tools/rename.md) | Renaming tables | | [tools restore](../export_import/tools_restore.md) | Restoring data from the file system | diff --git a/ydb/docs/en/core/reference/ydb-cli/table-drop.md b/ydb/docs/en/core/reference/ydb-cli/table-drop.md new file mode 100644 index 00000000000..f17f1f50938 --- /dev/null +++ b/ydb/docs/en/core/reference/ydb-cli/table-drop.md @@ -0,0 +1,35 @@ +# Deleting a table + +Using the `table drop` subcommand, you can delete a specified table. + +General format of the command: + +```bash +{{ ydb-cli }} [global options...] table drop [options...] <table path> +``` + +* `global options`: [Global parameters](commands/global-options.md). +* `options`: [Parameters of the subcommand](#options). +* `table path`: The table path. + +To view a description of the table delete command: + +```bash +{{ ydb-cli }} table drop --help +``` + +## Parameters of the subcommand {#options} + +| Name | Description | +---|--- +| `--timeout` | The time within which the operation should be completed on the server. | + +## Examples {examples} + +{% include [ydb-cli-profile](../../_includes/ydb-cli-profile.md) %} + +To delete the table `series`: + +```bash +{{ ydb-cli }} -p db1 table drop series +```
\ No newline at end of file diff --git a/ydb/docs/en/core/reference/ydb-cli/toc_i.yaml b/ydb/docs/en/core/reference/ydb-cli/toc_i.yaml index a861a4257e9..9bf0d864dad 100644 --- a/ydb/docs/en/core/reference/ydb-cli/toc_i.yaml +++ b/ydb/docs/en/core/reference/ydb-cli/toc_i.yaml @@ -19,12 +19,16 @@ items: href: commands/dir.md - name: Secondary indexes href: commands/secondary_index.md + - name: Copying tables + href: tools-copy.md - name: Renaming tables href: commands/tools/rename.md - name: Setting TTL parameters href: table-ttl-set.md - name: Deleting TTL parameters href: table-ttl-drop.md + - name: Deleting a table + href: table-drop.md - name: Operations with data items: - name: Getting a query execution plan and AST diff --git a/ydb/docs/en/core/reference/ydb-cli/tools-copy.md b/ydb/docs/en/core/reference/ydb-cli/tools-copy.md new file mode 100644 index 00000000000..cc20069196d --- /dev/null +++ b/ydb/docs/en/core/reference/ydb-cli/tools-copy.md @@ -0,0 +1,53 @@ +# Copying tables + +Using the `tools copy` subcommand, you can create a copy of one or more DB tables. The copy operation leaves the source table unchanged while the copy contains all the source table data. + +General format of the command: + +```bash +{{ ydb-cli }} [global options...] tools copy [options...] +``` + +* `global options`: [Global parameters](commands/global-options.md). +* `options`: [Parameters of the subcommand](#options). + +View a description of the command to copy a table: + +```bash +{{ ydb-cli }} tools copy --help +``` + +## Parameters of the subcommand {#options} + +| Parameter name | Parameter description | +---|--- +| `--timeout` | The time within which the operation should be completed on the server. | +| `--item <property>=<value>,...` | Operation properties. You can specify the parameter more than once to copy several tables in a single transaction.<br/>Required properties:<ul><li>`destination`, `dst`, `d`: Path to target table. If the destination path contains folders, they must be created in advance. No table with the destination name should exist.</li><li>`source`, `src`, `s`: Path to source table.</li></ul> | + +## Examples {#examples} + +{% include [ydb-cli-profile](../../_includes/ydb-cli-profile.md) %} + +Create the `backup` folder in the DB: + +```bash +{{ ydb-cli }} -p db1 scheme mkdir backup +``` + +Copy the `series` table to a table called `series-v1`, the `seasons` table to a table called `seasons-v1`, and `episodes` to `episodes-v1` in the `backup` folder: + +```bash +{{ ydb-cli }} -p db1 tools copy --item destination=backup/series-v1,source=series --item destination=backup/seasons-v1,source=seasons --item destination=backup/episodes-v1,source=episodes +``` + +View the listing of objects in the `backup` folder: + +```bash +{{ ydb-cli }} -p db1 scheme ls backup +``` + +Result: + +```text +episodes-v1 seasons-v1 series-v1 +```
\ No newline at end of file |