From 4fb438718045acdd5f5fb44166c8225b5ee41700 Mon Sep 17 00:00:00 2001 From: adevyatova Date: Wed, 18 Aug 2021 13:32:34 +0000 Subject: [PATCH] Added examples --- docs/en/engines/database-engines/sqlite.md | 29 +++++++------- .../table-engines/integrations/sqlite.md | 40 ++++++++++--------- .../sql-reference/table-functions/sqlite.md | 13 +++--- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/docs/en/engines/database-engines/sqlite.md b/docs/en/engines/database-engines/sqlite.md index 3ecbfc7fc07..b0260b9c5cb 100644 --- a/docs/en/engines/database-engines/sqlite.md +++ b/docs/en/engines/database-engines/sqlite.md @@ -20,10 +20,12 @@ The engine works with [SQLite](https://www.sqlite.org/index.html). ## Data Types Support {#data_types-support} -| EngineName | ClickHouse | -|-----------------------|------------------------------------| -| NativeDataTypeName | [ClickHouseDataTypeName](link#) | - +| EngineName | ClickHouse | +|---------------|---------------------------------------------------------| +| INTEGER | [Int32](../../sql-reference/data-types/int-uint.md) | +| REAL | [Float32](../../sql-reference/data-types/float.md) | +| TEXT | [String](../../sql-reference/data-types/string.md) | +| BLOB | [String](../../sql-reference/data-types/string.md) | ## Specifics and recommendations {#specifics-and-recommendations} @@ -32,21 +34,18 @@ SQLite does not require service management (such as startup scripts) or access c ## Usage Example {#usage-example} -The example must show usage and use cases. The following text contains the recommended parts of this section. - -Input table: - -``` text -``` - -Query: +Database in ClickHouse, exchanging data with the SQLite: ``` sql +CREATE DATABASE sqlite_db ENGINE = SQLite('sqlite.db'); +SHOW TABLES FROM sqlite_db; ``` Result: ``` text -``` - -Follow up with any text to clarify the example. +┌──name───┐ +│ table1 │ +│ table2 │ +└─────────┘ +``` \ No newline at end of file diff --git a/docs/en/engines/table-engines/integrations/sqlite.md b/docs/en/engines/table-engines/integrations/sqlite.md index 6808b4f3a8e..8f37f5cfa1c 100644 --- a/docs/en/engines/table-engines/integrations/sqlite.md +++ b/docs/en/engines/table-engines/integrations/sqlite.md @@ -26,34 +26,38 @@ The engine provide to import and export data to SQLite and query SQLite tables d - `db_path` — Path to SQLite file with the database. - `table` — The SQLite table name. -## Specifics and recommendations {#specifics-and-recommendations} - -Algorithms -Specifics of read and write processes -Examples of tasks -Recommendations for usage -Specifics of data storage - ## Usage Example {#usage-example} -The example must show usage and use cases. The following text contains the recommended parts of this section. +Show query creating the SQLite table: -Input table: - -``` text -``` - -Query: - -``` sql +```sql +SHOW CREATE TABLE sqlite_db.table2; ``` Result: ``` text +CREATE TABLE SQLite.table2 +( + `col1` Nullable(Int32), + `col2` Nullable(String) +) +ENGINE = SQLite('sqlite.db','table2'); ``` -Follow up with any text to clarify the example. +Returns the data from the table: + +``` sql +SELECT * FROM sqlite_db.table2 ORDER BY col1; +``` + +```text +┌─col1─┬─col2──┐ +│ 1 │ text1 │ +│ 2 │ text2 │ +│ 3 │ text3 │ +└──────┴───────┘ +``` **See Also** diff --git a/docs/en/sql-reference/table-functions/sqlite.md b/docs/en/sql-reference/table-functions/sqlite.md index 972c16f4dd6..2e6b92ca2e5 100644 --- a/docs/en/sql-reference/table-functions/sqlite.md +++ b/docs/en/sql-reference/table-functions/sqlite.md @@ -24,21 +24,20 @@ Allows to performed queries on data that is stored in the `SQLite` database. **Example** -The example must show usage and/or a use cases. The following text contains recommended parts of an example. - -Input table (Optional): - -``` text -``` - Query: ``` sql +SELECT * FROM sqlite('sqlite.db', 'table1') ORDER BY col2; ``` Result: ``` text +┌─col1──┬─col2─┐ +│ line1 │ 1 │ +│ line2 │ 2 │ +│ line3 │ 3 │ +└───────┴──────┘ ``` **See Also**