honeysql

igrishaev 2025-07-15T15:18:42.445709Z

Let's imagine I have a schema, e.g. :test_env and a function name :get_some_data , both keywords. How can I compose a function call like this?

select "test_env"."get_some_data"(some_arg) as data
The only option I found was
(honey.sql/format {:select [[[:'test_env.get_some_data :arg] :data]]})

["SELECT test_env.get_some_data(arg) AS data"]
but this means, I should compose a full function name with a dot which involves concatenating strings, and it also doesn't have double quotes. Any ideas? UPD: I thought the :. syntax would help, something like
{:select [[[:. :test_env :get_some_data] :arg] :data]}
but no

valerauko 2025-07-15T15:27:00.004989Z

haven't tried, but maybe :test_env/get_some_data ?

igrishaev 2025-07-15T15:28:06.136569Z

I tried it as well but honeysql takes only the name and drops the namespace. It becomes GET_SOME_DATA(...)

p-himik 2025-07-15T15:29:36.011459Z

I think technically it should be

{:select [[[[:. :test_env :get_some_data] :some-arg] :data]]}
But then it becomes
SELECT (test_env.get_some_data, some_arg) AS data
Seems that a vector in place of a keyword prevents HoneySQL from recognizing the parent vector as a function call.

seancorfield 2025-07-15T16:15:45.491959Z

Right now, the "quoted keyword" approach is the only way to get a schema-qualified function name -- the README gives specific examples of that -- and there's no way to have an expression in the fn position . Feel free to create an issue and I'll have a think about it.

igrishaev 2025-07-16T07:17:43.455589Z

Done: https://github.com/seancorfield/honeysql/issues/579