hugsql

2018-11-30T18:30:45.000400Z

-- :name get-webhook :? :1
-- :doc retrieves a webhook record given the id
SELECT * FROM webhooks
WHERE id = :id
Is there a way to have query functions take positional args instead? I would prefer (db/get-row-by-id id) as opposed to (db/get-row-by-id {:id id})

2018-11-30T21:55:01.001200Z

@jayzawrotny there's no way to do that, but you might as well write your own wrapper function to do that

2018-11-30T21:56:22.003300Z

Ah ok thanks. It dawned on me it was probably better or at the very least consistent and I can change my other user-land functions to take a params map and now they all speak the same language 🙂

2018-11-30T21:57:02.004200Z

yeah, that's exactly the right way to put it, your userland functions can be different 🙂