ClickHouse / dbt-clickhouse

The Clickhouse plugin for dbt (data build tool)
Apache License 2.0
253 stars 113 forks source link

Add list support to `primary_key` #377

Open lucasfcnunes opened 2 weeks ago

lucasfcnunes commented 2 weeks ago

Summary

Enhance the primary_key macro to accept a list of columns, allowing for primary keys with multiple columns. This improves flexibility in configuration.

With this PR it's now possible to do the following:

{{
    config(
        primary_key=['a', 'b'],
        order_by=['a', 'b'],
    )
}}
-- ...

Before, you would need to use the literal expression as follows primary_key='(a, b)'

Checklist

BentsiLeviav commented 2 weeks ago

Hi @lucasfcnunes

Thank you for your contribution! Before reviewing your PR, please add an indication in the Changelog for your changes (Make sure to follow the structure).