> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Источники словаря

> Типы источников словаря

## Синтаксис

> [!TIP]
>
> Если вы используете словарь в ClickHouse Cloud, для создания словарей используйте вариант с DDL-запросом, а сам словарь создавайте от имени пользователя `default`.
> Также проверьте список поддерживаемых источников для словарей в [руководстве по совместимости с Cloud](https://clickhouse.com/docs/ru/products/cloud/guides/cloud-compatibility.md).

Словарь можно подключить к ClickHouse из самых разных источников.
Источник задаётся в разделе `source` файла конфигурации и с помощью предложения `SOURCE` в DDL-операторе.

> [tab] DDL
>
> ```sql theme={null}
> CREATE DICTIONARY dict_name (...)
> ...
> SOURCE(SOURCE_TYPE(param1 val1 ... paramN valN)) -- Конфигурация источника
> ...
> ```

> [tab] файл конфигурации
>
> ```xml theme={null}
> <clickhouse>
>   <dictionary>
>     ...
>     <source>
>       <source_type>
>         <!-- Конфигурация источника -->
>       </source_type>
>     </source>
>     ...
>   </dictionary>
>   ...
> </clickhouse>
> ```

## Поддерживаемые источники словаря

Доступны следующие типы источников (`SOURCE_TYPE`/`source_type`):

* [Локальный файл](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/local-file.md)
* [Исполняемый файл](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/executable-file.md)
* [Executable Pool](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/executable-pool.md)
* [HTTP(S)](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/http.md)
* СУБД
  * [ODBC](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/odbc.md)
  * [MySQL](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/mysql.md)
  * [ClickHouse](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/clickhouse.md)
  * [MongoDB](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/mongodb.md)
  * [Redis](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/redis.md)
  * [Cassandra](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/cassandra.md)
  * [PostgreSQL](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/postgresql.md)
  * [YTsaurus](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/ytsaurus.md)
* [YAMLRegExpTree](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/yamlregexptree.md)
* [Null](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/null.md)

Для типов источников [Локальный файл](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/local-file.md), [Исполняемый файл](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/executable-file.md), [HTTP(s)](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/http.md), [ClickHouse](https://clickhouse.com/docs/ru/reference/statements/create/dictionary/sources/clickhouse.md)
можно использовать дополнительные настройки:

> [tab] DDL
>
> ```sql highlight={2} theme={null}
> SOURCE(FILE(path './user_files/os.tsv' format 'TabSeparated'))
> SETTINGS(format_csv_allow_single_quotes = 0)
> ```

> [tab] Файл конфигурации
>
> ```xml highlight={7} theme={null}
> <source>
>   <file>
>     <path>/opt/dictionaries/os.tsv</path>
>     <format>TabSeparated</format>
>   </file>
>   <settings>
>       <format_csv_allow_single_quotes>0</format_csv_allow_single_quotes>
>   </settings>
> </source>
> ```
