hugsql

svt 2020-08-31T10:41:59.000900Z

Hello I’m trying to use IN operation but getting error : org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of clojure.lang.PersistentVector

2020-08-31T10:53:08.001500Z

hi @cksharma122, can you copy your code?

svt 2020-08-31T10:55:23.003900Z

Sorry I cannot but I can give you an example how my code looks like

2020-08-31T10:55:49.004500Z

yes, basically just make sure you have specified a value lists on the sql expression

2020-08-31T10:55:56.004700Z

something like

select * from characters where name in (:v*:names)

2020-08-31T10:56:14.005300Z

where names is the name of your parameter

svt 2020-08-31T10:56:18.005500Z

:names can be list or a vector right?

2020-08-31T10:56:56.006200Z

as long as you specified that is a value list, i dont’ think there is something else you need to do .

svt 2020-08-31T10:57:34.006900Z

Let me see once again. Thank you for the suggestion

👍 1
2020-08-31T10:58:17.007500Z

you can find an example on the docs https://www.hugsql.org/#param-value-list

svt 2020-08-31T11:06:47.008Z

Will it not work if I pass a vector instead of list?

2020-08-31T11:08:00.008200Z

it should work