diff --git a/README.md b/README.md index b846ae0..5e1a178 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Available Tools * [tgsql](./modules/tgsql) - Text based SQL client program. -* [tgdump](./modules/tgdump) - Table Dump Tool. +* [tgdump](./modules/tgdump) - Dump Tool. ## Requirements diff --git a/docs/tgdump-design_ja.md b/docs/tgdump-design_ja.md index 3a37cca..82efb6c 100644 --- a/docs/tgdump-design_ja.md +++ b/docs/tgdump-design_ja.md @@ -34,15 +34,12 @@ ```sh tgdump [ [...]] --to --connection -tgdump --sql : [: [...]] --to --connection +tgdump --sql [:] [[:] [...]] --to --connection ``` * mandatory parameters * `` (`--sql` が指定されていない場合) * ダンプ対象のテーブル名 (複数指定可能) - * `` (`--sql` が指定された場合) - * 直後の `` を識別するためのクエリラベル - * クエリラベルに文字 `:` や空白文字を含めることはできず、1文字以上40文字以内である必要がある * `` (`--sql` が指定された場合) * ダンプ処理の内容を表す SQL 文字列 * `--to` @@ -53,6 +50,13 @@ tgdump --sql : [: [...]] --to * optional parameters * `--sql` * テーブル名を指定する代わりに、ダンプ処理の内容を表す SQL 文を直接指定する + * `` (`--sql` が指定された場合) + * 直後の `` を識別するためのクエリラベル + * クエリラベルに以下のいずれの文字も含めることはできない + * 空白文字 (タブや改行を含む) + * クウォート文字 (`'`, `"`) + * コロン (`:`) + * 未指定の場合は、 "`<引数の位置>`" という名前のラベルを自動的に付与する (引数の位置は 1 から始まる整数) * `--profile` * [ダンププロファイル](#ダンププロファイル)名 * 未指定の場合は `default` という名前のプロファイルを使用する @@ -161,7 +165,9 @@ tgdump --sql : [: [...]] --to ------|------|------ `kind` | `data` | `format` | `dump-info` | ダンプ対象のテーブルをデータベース上に検出したことを表す - `table` | 対象のテーブル名 | `--sql` が指定された場合はクエリラベルを出力 + `type` | ダンプの種類 | `--sql` の指定がない場合は `table`, ある場合は `query` + `table` | テーブル名 | `--sql` が未指定の場合はクエリラベル + `query` | クエリ文字列 | `--sql` が未指定の場合は absent `destination` | 出力先ファイルパス | `columns` | ダンプ対象列の一覧 | 形式は後述 | `--sql` が指定された場合は absent diff --git a/modules/tgdump/README.md b/modules/tgdump/README.md index 3a27360..c438e5d 100644 --- a/modules/tgdump/README.md +++ b/modules/tgdump/README.md @@ -1,6 +1,6 @@ -# `tgdump` - Tsurugi Table Dump Tool +# `tgdump` - Tsurugi Dump Tool -Tsurugi Table Dump Tool extracts the contents of table data and saves them on files. +Tsurugi Dump Tool extracts the contents of table data or query result and saves them on files. ## Build and Install @@ -32,13 +32,12 @@ Deploy the files mentioned above, and the tgdump command will be available for u ```sh tgdump [ [...]] --to --connection ... -tgdump --sql : [: [...]] --to --connection ... +tgdump --sql [:] [[:] [...]] --to --connection ... ``` parameters: * `` - the dump target table names -* `` - the label for the accompanying SQL text * `` - the SQL text for dump operations * `--to` - the destination directory * `--connection` - the target Tsurugi endpoint URI (must be `ipc:` protocol) @@ -48,6 +47,9 @@ optional parameters: * `--sql` * use SQL text for dump operations instead of table names * default: use table names +* `` + * the label for the accompanying SQL text (``) + * default: auto-generated label * `--profile` * dump profile name / file path * available profile name: @@ -71,7 +73,7 @@ optional parameters: * default: no transaction labels * `--threads` * the number of client threads in dump operations - * The number of simultaneous processing tables is limited to the number of this threads. + * The number of simultaneous processing tables/queries is limited to the number of this threads. * default: `1` * `-v,--verbose` * print verbose messages during executions.