...you're selecting rows, and the way I look at it, I'd find it hard to know what the SQL would be for the None part of that.
I suppose it could be `select id, name, null, null, null, null from user`. I don't think Slick will try to do that for you.
There are two approaches I can see.
1. Convert to (User,Option[Book]) on the client, rather than in SQL.
For example, maybe you work in terms of DBIO and do the conversation as part of that. Something like:
def addBlankBook(users: Seq[Users]): Seq[User,Option[Book]] = users.map(u => (u,None))
def query: DBIO[Seq[(User,Option[Book])]] = Table.users.result.map(addBlankBook)
(Apologies for any typos in any of this. I've not tried to compile it)
2. Or you could do a custom mapped projection to convert the query into one that returns the type you want. That would be something like...
def query = Table.users.map(u => (
u.name,
u.id) <> (withBlankBook, ignoreBook))
// Map the fields of our query into the type we want:
def withBlankBook(tuple: (Int,String,Double,Int)): (User,Option[Book]) =
( User(tuple._1, tuple._2, tuple._3, tuple._4), None )