Inaccurate warning on Mapped Encodings at compile time
counter2015 opened this issue · comments
Version: 4.6.0
Module: quill-cassandra-zio
Database: cassandra
Expected behavior
import io.getquill.{CassandraZioContext, SnakeCase}
import io.getquill.CassandraZioContext.{CIO, CStream}
object AllPersistenceIds {
object MyCassandraZioContext extends CassandraZioContext(SnakeCase)
import MyCassandraZioContext._
def all(): CStream[AllPersistenceIdsRow] = stream {
query[AllPersistenceIdsRow]
}
case class AllPersistenceIdsRow(persistenceId: String)
}
It should compile well
Actual behavior
It will rasie warning in comple time
[WARNING] Questionable row-class found.
The field 'persistenceId' in the object AllPersistenceIdsRow will be used in the query instead of the field .
Are you sure this is the intended behavior? Perhaps you meant to write an encoder/decoder for AllPersistenceIdsRow?
See the section on Mapped Encodings in the quill documentation here: https://getquill.io/#extending-quill-custom-encoding for the simplest way to do that.
relative code
This seems to happen on case classes with a single parameter. AllPersistenceIdsRow(persistenceId: String, test: Int)
would not raise the warning, in my experience