# ClickHouse Tools

The ClickHouse Tools allow DinoAI to explore your ClickHouse instance — listing databases, tables, and columns — so it can help you write accurate queries, build dbt models, and understand your data structure, all without leaving Paradime.

{% hint style="info" icon="plug-circle-plus" %}
**Requires a ClickHouse connection.** These tools are only available when your workspace is connected to ClickHouse. See your workspace settings to [configure a ClickHouse credential](https://docs.paradime.io/app-help/documentation/settings/connections/development-environment/clickhouse).
{% endhint %}

#### Capabilities

The ClickHouse Tools give DinoAI the following abilities:

* List all user databases in your ClickHouse instance (system databases are excluded automatically)
* List all tables within a given database, including their descriptions
* Inspect column names, descriptions, and data types for any table

#### Using the ClickHouse Tools

1. Open DinoAI in the right panel of the Code IDE
2. Describe what you want to explore (e.g., a table name, a database, or what columns you need)
3. Add your prompt describing what you want DinoAI to do with that information
4. Grant permission when DinoAI asks to access your ClickHouse instance
5. Review the results and implement DinoAI's suggested actions

#### Example Use Cases

**Generating a dbt Source File**

**Prompt**

```
List the columns in the `events` table in my `analytics` database and generate a dbt sources.yml for it.
```

**Result:** DinoAI fetches all column names, data types, and descriptions from your ClickHouse table and produces a ready-to-use `sources.yml` file with the correct structure and column definitions pre-filled.

**Exploring an Unfamiliar Database**

**Prompt**

```
What tables are available in my `raw` database?
```

**Result:** DinoAI lists every table in the database along with any available descriptions, giving you a complete picture before you start writing queries or building models.

**Understanding a Table's Structure**

**Prompt**

```
What columns does the `session_events` table in the `tracking` database have?
```

**Result:** DinoAI returns all column names, data types, and descriptions ordered by their position in the table, so you can immediately understand the schema and start writing accurate SQL.

#### Working with Other Tools

The ClickHouse Tools work well alongside DinoAI's other capabilities:

* Combine with the **dbt Tools** to inspect ClickHouse source tables and immediately scaffold dbt models or source definitions
* Combine with the **Catalog Search Tool** to cross-reference ClickHouse table structure with existing dbt model documentation
* Combine with the **Column Level Lineage Tool** to trace how a specific column flows from a raw ClickHouse table through your transformations

#### Best Practices

* **List databases first** — If you're unsure of exact database names, ask DinoAI to list all databases before drilling into tables or columns
* **Use exact identifiers** — ClickHouse identifiers are case-sensitive; provide the exact database and table names to avoid errors
* **Exclude system databases** — The listing tools automatically exclude `system`, `information_schema`, and `INFORMATION_SCHEMA`; you don't need to filter these manually
* **Check permissions** — DinoAI surfaces a `[ERROR]` if it cannot access a resource; confirm your ClickHouse credential has the necessary read permissions
