Skip to content

DOCAPI-7431: Formatted queries docs#6490

Merged
blinkov merged 16 commits intoClickHouse:masterfrom
BayoNet:en-docs/DOCAPI-7431-substitutions-in-queries
Aug 15, 2019
Merged

DOCAPI-7431: Formatted queries docs#6490
blinkov merged 16 commits intoClickHouse:masterfrom
BayoNet:en-docs/DOCAPI-7431-substitutions-in-queries

Conversation

@BayoNet
Copy link
Copy Markdown
Contributor

@BayoNet BayoNet commented Aug 14, 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 (docs, examples, READMEs). pr-documentation Documentation PRs for the specific code PR labels Aug 14, 2019

The command-line client allows passing external data (external temporary tables) for querying. For more information, see the section "External data for query processing".

### Formatted Queries {#cli-formatted-queries}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feature is usually called prepared statements, not formatted queries. This impacts the whole following text.
Though as far as I can see there's currently no actual preparation, so maybe "Queries with parameters" like in original PR might look better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've called it "Formatted" because we have a dial with formatted query string similar to format strings in Python or in C (printf). There is no any other functionality. Queries with parameters sounds strange for me because we don't talk about queries, we talk about interfaces of data I/O.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It should be similar to other DBMS, not other programming languages. Queries are part of public interface.

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:

```
{<name>:<structure>}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why structure? it's just data type

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you look at the examples you will see that it describes data structure, For example Tuple(UInt8, Tuple(String, UInt8))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's still just a complex data type.

@blinkov blinkov merged commit b1d1a23 into ClickHouse:master Aug 15, 2019
@BayoNet BayoNet deleted the en-docs/DOCAPI-7431-substitutions-in-queries branch August 15, 2019 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-documentation Documentation (docs, examples, READMEs). pr-documentation Documentation PRs for the specific code PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants