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

How do I pass arguments to SQL functions? #113

Open
asultanpur opened this issue Jun 26, 2018 · 1 comment
Open

How do I pass arguments to SQL functions? #113

asultanpur opened this issue Jun 26, 2018 · 1 comment

Comments

@asultanpur
Copy link

I want to pass the value of a var to my SQL function.

(sql/sql (sql/select db [:*] (sql/from `(:my-func ~arg))))

But I get an error:

ExceptionInfo Can't parse FROM form.  clojure.core/ex-info (core.clj:4739)

However I'm able to pass string arguments:

=> (sql/sql (sql/select db [:*] (sql/from '(:my-func "abc"))))
["SELECT * FROM \"my_func\"(?)" "abc"]

I want to pass the value of arg instead of plain string. How do I do that?

@r0man
Copy link
Owner

r0man commented Jun 27, 2018 via email

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