It's Slick 2.0.
I have the following:
mytable
.returning(mytable.map(_.id))
.+=(item)(session)
I'd like the insert not only to return the id
but also the name
field and the lastname
fields. Is it possible in Slick?
It's Slick 2.0.
I have the following:
mytable
.returning(mytable.map(_.id))
.+=(item)(session)
I'd like the insert not only to return the id
but also the name
field and the lastname
fields. Is it possible in Slick?
map
determines what projection of the table is returned, so you can pick the fields you need and pack them in a tuple:
mytable
.returning(mytable.map(t => (t.id, t.name, t.lastname)))
.+=(item)(session)