Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New option to pass through HugSQL options #25

Closed
nottmey opened this issue Oct 4, 2016 · 1 comment
Closed

New option to pass through HugSQL options #25

nottmey opened this issue Oct 4, 2016 · 1 comment

Comments

@nottmey
Copy link
Contributor

nottmey commented Oct 4, 2016

To my knowledge it is currently not possible to make use of the options parameter of the encapsulated hugsql.core/def-db-fns function (docs) when using conman.core/bind-connection to set connection specific configurations.

I propose the use of an options map for bind-connection, similar showcased and helpful in #19, which is then handed to def-db-fns.

In my case I need to enable :quoting (:mysql) for HugSQL functions per default. Currently this is solved by always providing the database and options map for each call of a generated HugSQL function (example in first snippet), which is far from ideal (second snippet), since connection aware functions are one key feature of conman.

(db/get-user *db* {:id "foo"} {:quoting :mysql})
(db/get-user {:id "foo"})
@yogthos
Copy link
Member

yogthos commented Oct 4, 2016

That sounds reasonable to me, would you by any chance be up for doing a pr? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants