v.25.7New Feature

Add AI-powered SQL generation to ClickHouse client

Add AI-powered SQL generation to ClickHouse client. Users can now generate SQL queries from natural language descriptions by prefixing their query with ??. Supports OpenAI and Anthropic providers with automatic schema discovery. #83314 (Kaushik Iska).
AI-powered SQL generation: Enables automatic SQL query generation from natural language using the ClickHouse client by prefixing queries with ??.

Why it matters

This feature solves the problem of writing complex SQL queries by allowing users to describe their desired query in plain English. It increases accessibility and efficiency, especially for users less familiar with SQL syntax, by leveraging AI models (OpenAI and Anthropic) and automatic schema discovery to generate the correct queries.

How to use it

To use this feature, users simply start their input in the ClickHouse client with ?? followed by a natural language description of the desired query. The client will then generate the corresponding SQL statement using the configured AI provider (OpenAI or Anthropic).