There is not a good solution to this question for current slick version. You can pack some fields into one case class.

Please refer to this test case.


Actually this could be done via HList like this

def * = (col1 :: col2 :: .. :: HNil).shaped <> (
{ case x => new YYY(x(0), x(1), ..)}, 
{ x: YYY => Option(x.col1 :: x.col2 :: .. :: HNil)}

I've written an macro to do the mapping, you may take a look at this


I have a HListCaseClassShape that works exactly like the CaseClassShape but without the 22 column limit: here. You could then map it to your table like this: def * = MyHListCaseClassShape(f1, f2, f3...) (see the Pair * example here). Not sure if it'll work with Slick 2 but might be worth a shot.

Related Query

More Query from same tag