[error] ContentRepoLocal.scala:84: constructor cannot be instantiated to expected type;
[error] found : (T1, T2)
[error] required: slick.lifted.Rep[Option[(repo.model.UserContentTable, repo.model.ContentTable)]]
[error] .map { case (u, (uc, c)) => (u, c.optionProjection) }
[error] ^
[error] ContentRepoLocal.scala:84: diverging implicit expansion for type slick.lifted.Shape[_ <: slick.lifted.FlatShapeLevel, Nothing, T, G]
[error] starting with method repColumnShape in trait RepShapeImplicits
[error] .map { case (u, (uc, c)) => (u, c.optionProjection) }
def getContentsByUser(userId: UUID): Either[UserNotFoundError, List[Content]] = {
val subQuery =
for {
uc <- UserContentTable.query if uc.userId === userId.toString && (!uc.adopted.isDefined || !uc.adopted)
c <- ContentTable.query if uc.contentId === c.id
} yield (uc, c)
val query =
UserTable.query.filter(_.id === userId.toString)
.joinLeft(subQuery).on { case (u, (uc, c)) => u.id === uc.userId}
.map { case (u, (uc, c)) => (u, c.optionProjection) }
//...
}
val query =
UserTable.query.filter(_.id === userId.toString)
.joinLeft(subQuery).on { case (u, (uc, c)) => u.id === uc.userId}
//.map { case (u, (uc, c)) => (u, c.optionProjection) }
println("The type of the query is:")
println(getType(query))
The type of the query is:
slick.lifted.Query[(slick3.problem.repo.model.UserTable, slick.lifted.Rep[scala.Option[(slick3.problem.repo.model.UserContentTable, slick3.problem.repo.model.ContentTable)]]),(slick3.problem.repo.model.UserTable#TableElementType, scala.Option[(slick3.problem.repo.model.UserContentModel, slick3.problem.model.Content)]),scala.Seq]
slick.lifted.Rep[Option[(slick3.problem.repo.model.UserContentTable, slick3.problem.repo.model.ContentTable)]]
val query =
for (
(u, t) <- UserTable.query.filter(_.id === userId.toString) joinLeft subQuery on { case (u, (uc, c)) => u.id === uc.userId }
) yield (u, t)
println("The type of the query is:")
println(getType(query))
()
}
val query =
UserTable.query.filter(_.id === userId.toString)
.joinLeft(subQuery).on { case (u, (uc, c)) => u.id === uc.userId}
.map { case (u, sub) => (u, sub.map { case (uc, c) => c }) }