[SlickException: Read NULL value for column (USERS /670412212).LOGIN_ID]
Your case class is not ok. If you use O.Nullable
, all your properties have to be Option[String]
.
If you get this error, you'll have to either make the properties O.Nullable
, or you have to specify that your query returns an option.
For example let's say you do a rightJoin
you might not want to make the properties of the right record optional. In that case you can customize the way you yield your results using .?
val results = (for {
(left, right) <- rightRecord.table rightJoin leftRecord.table on (_.xId === _.id)
} yield (rightRecord.id, leftRecord.name.?)).list
results map (r => SomeJoinedRecord(Some(r._1), r._2.getOrElse(default)))