honeysql 2023-11-14

Is there a way to prevent upper-casing of function names?

Although I haven’t found documentation to support this, it appears that external BigQuery JavaScript UDFs are case sensitive.

The library of community-built UDFs have lower case names which makes them cumbersome to reference with honey

Currently, I have a custom formatter and reference using

{:select [[[:fn.cw_array_distinct [:array_agg :a]]
                         :step-array]]} 

I couldn’t figure out how to get :raw to work in function call position

Add ' after :, as in:

(sql/format {:select [[[:'fn.cw_array_distinct [:array_agg :a]]
                       :step-array]]}
            )
=> ["SELECT fn.cw_array_distinct(ARRAY_AGG(a)) AS step_array"]

Nice! Thanks!

👍 1

Thanks for the pointer! Somehow I missed this in my search