hugsql

2018-11-29T17:56:36.022500Z

Hi… just started using hugsql. I wondered: in the query definitions, is there a way to extract parameters from a nested map of the passed-in structure? For example, to flatten {:name "Me", :contact {:phone "123-2345"}}?

2018-11-29T17:57:30.023500Z

Obviously I could adapt the data before calling e.g. create-user! but I thought it would be nice if the database functions accepted the same data as I’m using elsewhere.

curtis.summers 2018-11-29T21:42:00.024900Z

@credulous You can use HugSQL's deep-get parameter syntax to achieve this: :contact.phone See: https://www.hugsql.org/#deep-get-param-name

2018-11-29T21:44:02.025100Z

Thank yoU!