Testing case sensitive column names

Our users love case sensitive column names like CustomerID.
When I try to put a test (unique or not null) on this column, the db does not recognize the column.
I used “CustomerID” and ‘CustomerID’ but when the statement is sent over to the db the " and ’ are removed and are thus not existing columns.
Is there a workaround for this other than not using case sensitive columns?

Hey @marc.clijsters - check out the docs for column-level quoting in schema.yml files. This feature is new in dbt v0.16.0 :slight_smile:

Thanks @drew !

I am having the same issues but it appears the document seems to have moved? I get redirected to a more generic doc at:
https://docs.getdbt.com/reference/declaring-properties/#quote

instead of the original link that went to:
/docs/building-a-dbt-project/testing-and-documentation/schemayml-files#quote

Is there an updated URL for that document?

Thanks!

-Stirling

Found it:
https://docs.getdbt.com/reference/resource-properties/quote/#add-tests-to-a-quoted-column-in-a-source-table

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.