Skip to content

DOCAPI-7431: Queries with parameters docs. EN review. RU translation.#6632

Merged
BayoNet merged 6 commits intoClickHouse:masterfrom
BayoNet:l10n/DOCAPI-7431-substitutions-in-queries
Aug 27, 2019
Merged

DOCAPI-7431: Queries with parameters docs. EN review. RU translation.#6632
BayoNet merged 6 commits intoClickHouse:masterfrom
BayoNet:l10n/DOCAPI-7431-substitutions-in-queries

Conversation

@BayoNet
Copy link
Contributor

@BayoNet BayoNet commented Aug 23, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Category (leave one):

@BayoNet BayoNet added comp-documentation Documentation. pr-documentation Documentation PRs for the specific code PR labels Aug 23, 2019
```

#### Syntax of a Query {#cli-queries-with-parameters-syntax}
#### Query Syntax {#cli-queries-with-parameters-syntax}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anchor uses old title

#### Query Syntax {#cli-queries-with-parameters-syntax}

Format a query by the standard method. Values that you want to put into the query from the app parameters place in braces and format as follows:
Format a query using the standard method. Place the values that you want to pass from the app parameters to the query in braces in the following format:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "standard method" mean? this syntax has nothing to do with SQL standard


- `name` — Identifier of a placeholder that should be used in app parameter as `--param_name = value`.
- `data type` — A data type of app parameter value. For example, data structure like `(integer, ('string', integer))` can have a data type `Tuple(UInt8, Tuple(String, UInt8))` (also you can use another [integer](../data_types/int_uint.md) types).
- `name` — Placeholder identifier that should be used in app parameters as `--param_<name> = value`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--param_... example is for console client only

- `name` — Identifier of a placeholder that should be used in app parameter as `--param_name = value`.
- `data type` — A data type of app parameter value. For example, data structure like `(integer, ('string', integer))` can have a data type `Tuple(UInt8, Tuple(String, UInt8))` (also you can use another [integer](../data_types/int_uint.md) types).
- `name` — Placeholder identifier that should be used in app parameters as `--param_<name> = value`.
- `data type` — Data type of the app parameter value. For example, a data structure like `(integer, ('string', integer))` can have the `Tuple(UInt8, Tuple(String, UInt8))` data type (you can also use another [integer](../data_types/int_uint.md) types).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe link to list of available data types?


### Запросы с параметрами {#cli-queries-with-parameters}

Вы можете создать запрос с параметрами и передать в них значения соответствующих параметров клиентского приложения. Например:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

см. английскую версию

clickhouse-client --param_parName="[1, 2]" -q "SELECT * FROM table WHERE a = {parName:Array(UInt16)}"
```

#### Cинтаксис запроса {#cli-queries-with-parameters-syntax}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...с параметрами?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется лишнее.


Параметры командной строки переопределяют значения по умолчанию и параметры конфигурационных файлов.

- Конфигурационных файлов.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кстати, где-то в этих краях не стоит упомянуть, что начинающееся на param_ интерпретируется как параметры?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавил в список параметров.

@BayoNet BayoNet merged commit 9c0b377 into ClickHouse:master Aug 27, 2019
@BayoNet BayoNet deleted the l10n/DOCAPI-7431-substitutions-in-queries branch August 27, 2019 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-documentation Documentation. pr-documentation Documentation PRs for the specific code PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants