Mapping table to several case classes in Slick

24 views
Skip to first unread message

Mike Limansky

unread,
Sep 5, 2016, 11:26:26 AM9/5/16
to Slick / ScalaQuery
Hi,

  I'm trying to use Slick with akka-http. I've found that it many cases it would be nice to map same table to the different case classes (for example I have REST API for lists of items, which contain only subset of  fields, and another API to get particular item with the all fields). And definitely I'd like to have only required subset of fields in the generated SQL queries. The most obvious way to implement it is to create several Table classes, one for each case class.

  But maybe there is some better way?

  And the second question, if I create several Table classes, can I make some of them readonly?

--
WBR,
Mike.
Reply all
Reply to author
Forward
0 new messages