Closed emirkmo closed 8 months ago
I think it's already supported:
Python 3.11.3 (v3.11.3:f3909b8bc8, Apr 4 2023, 20:12:10) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import chdb
>>> chdb.chdb_version
('1', '2', '0')
>>> chdb.query("SELECT formatQuery('select a, b FRom tab WHERE a > 3 and b < 3');")
"SELECT
a,
b
FROM tab
WHERE (a > 3) AND (b < 3)"
Use case
In CI, I want to check compiled/generated sql. (Say from DBT or from a tool to generate Clickhouse migrations). The main Clickhouse binary is way too large for this. Even the smallest docker image is nearly 1GB. Would be awesome to be able to run the ‘formatQuery’ function.
https://clickhouse.com/docs/en/sql-reference/functions/other-functions#formatquery
(
clickhouse-format
the tool still requires the full Clickhouse binary.)Describe the solution you'd like
“Simply” add support for
formatQuery
function within the supported sql for chdb. That would be enough.