Scala Quill incorrect parses when two level Option Embedded classes

181 Views Asked by At

Quill does not parse embedded option class if it's two-level option embedded class is None

Version: 3.4.10 Module: quill-jdbc-monix Database: postgresql

Steps to reproduce the behavior

I have the next classes:

case class Customer(id: String, personData: Option[PersonData] = None)
case class PersonData(firstName: String, address: Option[Address] = None) extends Embedded
case class Address(country: String, city: String) extends Embedded

run(quote {
      query[Customer]
        .filter(_.id == lift(id))
    }).map(_.headOption)

If all fields are filled in the database then the query works fine. If address fields (country, city) are null in the database but person data field firstName is filled then the personData field in Customer is None. But I expected that the personData should be Some and only address field in it should be None

0

There are 0 best solutions below