I would like to query a db table using the following sql
val ALL_BY_ID: Query[List[String] *: Int *: EmptyTuple, Store] =
sql"""SELECT id, name, description, account, enterdate
, company, modelid
FROM store
WHERE id IN $varchar AND modelid = $int4
""".query(storeDecoder)
here is the case class
final case class Store(
id: String,name: String,description: String,account: String,enterdate: Instant,company: String,modelid: Int)
and there is the storeDecoder
val storeDecoder: Decoder[Store] = storeCodec.map {
case (id, name, description, account, enterdate, company, modelid) =>
Store(id,name,description,account,toInstant(enterdate),company,modelid)}
This doesnt compile. Here the error
[error] 192 | sql"""
[error] 193 | SELECT id, name, description, account, enterdate,
[error] 195 | WHERE id IN $varchar AND modelid = $int4
[error] 196 | """.query(storeDecoder)
[error] | ^
[error] |Found: skunk.Query[(String, Int), tradex.domain.model.store.Store]
[error] |Required: skunk.Query[(List[String], Int), tradex.domain.model.store.Store]
What's wrong with this?