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

Params in query call possible ? #75

Open
olymk2 opened this issue Mar 30, 2020 · 1 comment
Open

Params in query call possible ? #75

olymk2 opened this issue Mar 30, 2020 · 1 comment

Comments

@olymk2
Copy link

olymk2 commented Mar 30, 2020

I have been looking at the code here

(defn query
from what I can tell query does not take :params to pass in parameters ? or else I am not understanding whats going on.

Tried a few things like

(db/query honey-sql-query :search "text")

But this does not work, the doc string says it takes a honey sql form which i Take it is just the hash map form before its passed to sql/format which has a :params keyword to allow you to injected name params into your query.

@camsaul is this possible am i missing something, or would toucan need to be extended to allow for this ?

@olymk2
Copy link
Author

olymk2 commented Mar 30, 2020

I have worked around it using the code below, by calling jdbc directly if this is not possible I may attempt a PR if that's of interest ?

  (jdbc/query (db/connection) 
              (sql/format   query
                            :params {:search "text"}))

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

1 participant