hugsql

achikin 2019-05-15T13:02:05.025400Z

Hi!

achikin 2019-05-15T13:02:21.025800Z

I'm trying to use snippets and I'm a bit confused

achikin 2019-05-15T13:02:42.026200Z

It looks like that to use snippet I need to do the following:

achikin 2019-05-15T13:04:32.028Z

1. Define a snippet with -- :snip my-snip 2. Add a snippet to my usual query with :snip:my-snip 3. Pass that snippet when calling a query from clojure (my-query {:my-snip (my-snip params)})

achikin 2019-05-15T13:04:41.028300Z

that seems a bit confusing

achikin 2019-05-15T13:05:09.029Z

Can I simply define a snippet and then reuse it without passing it to every db function?

achikin 2019-05-15T13:05:29.029400Z

E.g. can I omit step 3?