# ClickHouse (/integrations/clickhouse)





{/* MANUAL-CONTENT-START:intro */}

Use [ClickHouse](https://clickhouse.com) to query and insert analytical data, manage databases and tables, inspect schemas and system state, and execute SQL.

The block uses ClickHouse’s [HTTP interface](https://clickhouse.com/docs/interfaces/http). The endpoint must be reachable from the Sim execution runtime and allowed by its network policy.

## Connection details [#connection-details]

* **Host** — your ClickHouse hostname (e.g. `your-instance.clickhouse.cloud` or your server address).
* **Port** — the HTTP interface port. Use `8443` for HTTPS (ClickHouse Cloud) or `8123` for plain HTTP (self-hosted).
* **Database** / **Username** — default to `default` if not specified.
* **Password** — optional for unauthenticated local instances.
* **Use HTTPS** — keep enabled for any remote or Cloud instance.

## Mutations and network access [#mutations-and-network-access]

* `UPDATE` and `DELETE` are implemented as ClickHouse [mutations](https://clickhouse.com/docs/sql-reference/statements/alter/update) (`ALTER TABLE ... UPDATE/DELETE`). Mutations run **asynchronously** in the background, so the affected row count is not returned immediately.
* ClickHouse is optimized for bulk inserts. Prefer batching many rows per insert over many single-row inserts.
* Private and internal hosts are blocked by default. Self-hosted operators can configure an explicit database egress allowlist; a host must also be reachable from the runtime.

{/* MANUAL-CONTENT-END */}

## Use the block [#usage-instructions]

Query and insert data, manage databases and tables, inspect schemas, monitor mutations and running queries, manage partitions, and execute raw SQL over the ClickHouse HTTP interface.

## Actions [#actions]

### ClickHouse Query [#clickhouse-query]

Execute a SELECT query on a ClickHouse database

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `query` | string | Yes | SQL SELECT query to execute |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of rows returned from the query |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse Execute [#clickhouse-execute]

Execute raw SQL (DDL, mutations, or queries) on a ClickHouse database

<ReferenceDetails>
  #### Input [#input-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `query` | string | Yes | Raw SQL statement to execute |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of rows returned from the statement |
  | `rowCount` | number | Number of rows returned or affected |
</ReferenceDetails>

### ClickHouse Insert [#clickhouse-insert]

Insert a row into a ClickHouse table

<ReferenceDetails>
  #### Input [#input-2]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to insert data into |
  | `data` | object | Yes | Data object to insert (key-value pairs mapping column names to values) |

  #### Output [#output-2]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Inserted rows (empty for ClickHouse inserts) |
  | `rowCount` | number | Number of rows inserted |
</ReferenceDetails>

### ClickHouse Insert Rows [#clickhouse-insert-rows]

Insert multiple rows into a ClickHouse table

<ReferenceDetails>
  #### Input [#input-3]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table to insert into |
  | `rows` | json | Yes | Array of row objects to insert, e.g. \[\{"id":1,"name":"a"},\{"id":2,"name":"b"}] |

  #### Output [#output-3]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Inserted rows (empty for ClickHouse inserts) |
  | `rowCount` | number | Number of rows inserted |
</ReferenceDetails>

### ClickHouse Update [#clickhouse-update]

Update rows in a ClickHouse table via an ALTER TABLE ... UPDATE mutation

<ReferenceDetails>
  #### Input [#input-4]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to update data in |
  | `data` | object | Yes | Data object with fields to update (key-value pairs) |
  | `where` | string | Yes | WHERE clause condition (without the WHERE keyword) |

  #### Output [#output-4]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Updated rows (empty for ClickHouse mutations) |
  | `rowCount` | number | Number of rows written by the mutation |
</ReferenceDetails>

### ClickHouse Delete [#clickhouse-delete]

Delete rows from a ClickHouse table via an ALTER TABLE ... DELETE mutation

<ReferenceDetails>
  #### Input [#input-5]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to delete data from |
  | `where` | string | Yes | WHERE clause condition (without the WHERE keyword) |

  #### Output [#output-5]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Deleted rows (empty for ClickHouse mutations) |
  | `rowCount` | number | Number of rows affected by the mutation |
</ReferenceDetails>

### ClickHouse List Databases [#clickhouse-list-databases]

List all databases on a ClickHouse server

<ReferenceDetails>
  #### Input [#input-6]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |

  #### Output [#output-6]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | List of databases with engine and comment |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse List Tables [#clickhouse-list-tables]

List tables in the connected ClickHouse database

<ReferenceDetails>
  #### Input [#input-7]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |

  #### Output [#output-7]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of rows returned from the query |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse Describe Table [#clickhouse-describe-table]

Describe the columns of a ClickHouse table

<ReferenceDetails>
  #### Input [#input-8]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to describe |

  #### Output [#output-8]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of rows returned from the query |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse Show Create Table [#clickhouse-show-create-table]

Get the CREATE TABLE statement (DDL) for a ClickHouse table

<ReferenceDetails>
  #### Input [#input-9]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to get the CREATE statement for |

  #### Output [#output-9]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `ddl` | string | The CREATE TABLE statement |
</ReferenceDetails>

### ClickHouse Count Rows [#clickhouse-count-rows]

Count rows in a ClickHouse table, optionally filtered

<ReferenceDetails>
  #### Input [#input-10]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to count rows in |
  | `where` | string | No | Optional WHERE clause condition without the WHERE keyword |

  #### Output [#output-10]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `count` | number | Number of rows |
</ReferenceDetails>

### ClickHouse Introspect [#clickhouse-introspect]

Introspect a ClickHouse database to retrieve table structures, columns, and engines

<ReferenceDetails>
  #### Input [#input-11]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to introspect |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |

  #### Output [#output-11]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `tables` | array | Array of table schemas with columns and engines |
  | ↳ `name` | string | Table name |
  | ↳ `database` | string | Database the table belongs to |
  | ↳ `engine` | string | Table engine (e.g., MergeTree, Log) |
  | ↳ `totalRows` | number | Approximate total number of rows in the table |
  | ↳ `columns` | array | Table columns |
  | ↳ `name` | string | Column name |
  | ↳ `type` | string | ClickHouse data type (e.g., UInt32, String, DateTime) |
  | ↳ `defaultKind` | string | Kind of default expression (DEFAULT, MATERIALIZED, ALIAS) |
  | ↳ `defaultExpression` | string | Default value expression for the column |
  | ↳ `isInPrimaryKey` | boolean | Whether the column is part of the primary key |
  | ↳ `isInSortingKey` | boolean | Whether the column is part of the sorting key |
</ReferenceDetails>

### ClickHouse Create Database [#clickhouse-create-database]

Create a new database on a ClickHouse server

<ReferenceDetails>
  #### Input [#input-12]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `name` | string | Yes | Name of the database to create |

  #### Output [#output-12]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### ClickHouse Drop Database [#clickhouse-drop-database]

Drop a database from a ClickHouse server

<ReferenceDetails>
  #### Input [#input-13]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `name` | string | Yes | Name of the database to drop |

  #### Output [#output-13]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### ClickHouse Create Table [#clickhouse-create-table]

Create a new MergeTree-family table in ClickHouse

<ReferenceDetails>
  #### Input [#input-14]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Name of the table to create |
  | `columns` | json | Yes | Array of column definitions, each an object with name and type, e.g. \[\{"name":"id","type":"UInt64"},\{"name":"ts","type":"DateTime"}] |
  | `engine` | string | No | Table engine (default MergeTree) |
  | `orderBy` | string | Yes | ORDER BY expression, e.g. "id" or "(id, ts)" |
  | `partitionBy` | string | No | Optional PARTITION BY expression, e.g. toYYYYMM(ts) |

  #### Output [#output-14]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### ClickHouse Drop Table [#clickhouse-drop-table]

Drop a table from a ClickHouse database

<ReferenceDetails>
  #### Input [#input-15]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to drop |

  #### Output [#output-15]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### ClickHouse Truncate Table [#clickhouse-truncate-table]

Remove all rows from a ClickHouse table

<ReferenceDetails>
  #### Input [#input-16]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to truncate |

  #### Output [#output-16]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### ClickHouse Rename Table [#clickhouse-rename-table]

Rename a ClickHouse table

<ReferenceDetails>
  #### Input [#input-17]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Current table name |
  | `newTable` | string | Yes | New table name |

  #### Output [#output-17]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### ClickHouse Optimize Table [#clickhouse-optimize-table]

Trigger a merge of table parts via OPTIMIZE TABLE

<ReferenceDetails>
  #### Input [#input-18]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table to optimize |
  | `final` | boolean | No | Force a merge to a single part using FINAL |

  #### Output [#output-18]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### ClickHouse List Partitions [#clickhouse-list-partitions]

List active partitions for a ClickHouse table

<ReferenceDetails>
  #### Input [#input-19]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name to inspect partitions for |

  #### Output [#output-19]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of rows returned from the query |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse Drop Partition [#clickhouse-drop-partition]

Drop a partition from a ClickHouse table

<ReferenceDetails>
  #### Input [#input-20]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | Yes | Table name |
  | `partition` | string | Yes | Partition expression, e.g. '2024-01' or 202401 |

  #### Output [#output-20]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
</ReferenceDetails>

### ClickHouse List Mutations [#clickhouse-list-mutations]

List mutations (async ALTER UPDATE/DELETE) for the connected database

<ReferenceDetails>
  #### Input [#input-21]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | No | Optional table name to filter mutations |
  | `onlyRunning` | boolean | No | Only show mutations that are still running |

  #### Output [#output-21]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of mutation rows |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse List Running Queries [#clickhouse-list-running-queries]

List currently running queries on a ClickHouse server

<ReferenceDetails>
  #### Input [#input-22]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |

  #### Output [#output-22]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of rows returned from the query |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse Kill Query [#clickhouse-kill-query]

Kill a running query by its query ID

<ReferenceDetails>
  #### Input [#input-23]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `queryId` | string | Yes | The query\_id of the running query to kill |

  #### Output [#output-23]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Kill status rows |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse Table Stats [#clickhouse-table-stats]

Get row counts and on-disk size for tables in the connected database

<ReferenceDetails>
  #### Input [#input-24]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |
  | `table` | string | No | Optional table name to get stats for |

  #### Output [#output-24]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of table stats rows |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>

### ClickHouse List Clusters [#clickhouse-list-clusters]

List configured clusters, shards, and replicas

<ReferenceDetails>
  #### Input [#input-25]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `host` | string | Yes | ClickHouse server hostname (e.g., your-instance.clickhouse.cloud) |
  | `port` | number | Yes | ClickHouse HTTP interface port (8443 for HTTPS, 8123 for HTTP) |
  | `database` | string | Yes | Database name to connect to |
  | `username` | string | Yes | ClickHouse username |
  | `password` | string | No | ClickHouse password |
  | `secure` | boolean | No | Use a secure HTTPS connection (default: true) |

  #### Output [#output-25]

  | Parameter | Type | Description |
  | - | - | - |
  | `message` | string | Operation status message |
  | `rows` | array | Array of cluster node rows |
  | `rowCount` | number | Number of rows returned |
</ReferenceDetails>
