Fork me on GitHub
#sql
<
2022-06-16
>
dumrat11:06:11

using, next.jdbc Is it possible to use named params in query? i.e. select * from X where a = :param1 and b = :param2 and c = :param1 ?

Simion Iulian Belea14:06:44

For this case I think it’s better to use hugsql.

isak14:06:27

There is no cross-database way to do it, but it is possible for some databases. Which one are you using?

isak14:06:22

The reason it is tricky is because of jdbc itself, not the clojure wrappers

seancorfield19:06:48

I would use HoneySQL if I wanted named parameters (it turns it into ? placeholders and ordered parameters, to be used with next.jdbc).