zio-quill icon indicating copy to clipboard operation
zio-quill copied to clipboard

CassandraSyncContext UDT doesn't support Option[List[String]]

Open dev590t opened this issue 3 years ago • 4 comments

Version: 3.8.0 Module: quill-cassandra

Actual behavior

case class MyUdt_optionList(col: Option[List[String]]) extends Udt
case class TableWith_optionList(c: MyUdt_optionList)

CassandraMirrorContext can compile, but CassandraSyncContext fails with

exception during macro expansion: 
scala.reflect.macros.TypecheckException: Can't find implicit `Decoder[Playground.MyUdt_optionList]`.

Steps to reproduce the behavior

https://scastie.scala-lang.org/dev590t/DV5PLzFPTuOISvVnuElJzA/112

@getquill/maintainers

dev590t avatar Jul 25 '21 12:07 dev590t

related #1742

dev590t avatar Jul 25 '21 12:07 dev590t

I have found a commit about how Make UDT encoding to support options: #1266. And a other make UDT to support List fields" : #1229

dev590t avatar Jul 25 '21 15:07 dev590t

Here is a other example that shows a different behavior between CassandraSyncContext and CassandraMirrorContext for the type Try[Int] https://scastie.scala-lang.org/dev590t/DV5PLzFPTuOISvVnuElJzA/167 It seem the problem don't concern only Option[List[String]]

dev590t avatar Jul 26 '21 11:07 dev590t

workaround add a Decoder[Option[List[String]]] don't solve the problem should add a Decoder for the udt containing field with Option[List[String]] https://scastie.scala-lang.org/dev590t/yIbvAomrTl64NqUswq4BlA

dev590t avatar Aug 01 '21 17:08 dev590t