How do you compare MappedTo[T] with raw T columns?
I have a problem (Cannot perform option-mapped operation) with this code:
toEventLink <- Link.linksFromQuery(fromEntity).filter(_.toTable === Event.tableName)
event <- Event.table.filter(e => e.id === toEventLink.toId)
} yield event
e.id === toEventLink.toId
This compiler check is doing what it’s supposed to do (e.g., not let you accidently compare an ID against something that isn’t an ID). But I can totally see why this would be useful (e.g., when migrating a schema to start to used typed keys).
You can use
asColumnOf to cast a column to the type you want. For example:
e => e.id.asColumnOf[Long] === toEventLink.toId
There is a an issue open to make a more general solution for this: https://github.com/slick/slick/issues/1664