layerware/hugsql

It'd be nice to be able to set metadata on functions defined by hugsql

ryfow opened this issue · 3 comments

ryfow commented

I'm most interested in marking functions private, but other metadata might be helpful too.

I think this is a good idea. I might have a short-hand to specify private with a dash suffix on :name (similar to defn- convention):
-- :name- employees :?

I'll have to think about what makes sense for additional metadata. Thanks for the idea!

This will ship in 0.4.0 with the following syntax:

-- :name- a-private-fn :?
-- notice the dash suffix on :name- above
select * from test

-- :name another-private-fn
-- :meta {:private true}
select * from test

-- :name user-meta
/* :meta {:one 1
          :two 2
          :three 3} */
select * from test
ryfow commented

awesome! thanks