pypika icon indicating copy to clipboard operation
pypika copied to clipboard

Add support of SETTINGS ClickHouse clause

Open martijnthe opened this issue 9 months ago • 1 comments

Summary

Clickhouse SQL has an optional SETTINGS clause with SELECTs which can be used to configure all kinds of options.

This PR adds a settings method to ClickHouseQueryBuilder to add these options to a SELECT query.

All current (Clickhouse 24.4) settings keys are snake-case. Therefore I opted to use the settings keys directly as kwargs to the settings method, allowing passing multiple settings pairs in one call in a Pythonic/ideomatic way.

Test Plan

Added a unit test to exercise the new function.

martijnthe avatar May 14 '24 13:05 martijnthe