Fork me on GitHub
#hugsql
<
2023-11-22
>
erwinrooijakkers12:11:45

is there a way to get a scalar value from HugSQL?

erwinrooijakkers12:11:03

:? :1 syntax returns a map

erwinrooijakkers12:11:42

-- :name select :? :1 SELECT MAX(foo) FROM bar; returns {: 1} . I want to return the value directly. (I do know I can use SELECT MAX(foo) AS foo FROM bar; to change the keyword to :foo, but wonder if I can return the 1 only.)

erwinrooijakkers15:11:21

not according to the documentation

erwinrooijakkers15:11:04

could add a new function to the hugsql.adapter interface maybe, :scalar or so for result-scalar