这是光滑2.0。
我有以下内容:
mytable
.returning(mytable.map(_.id))
.+=(item)(session)
我希望插入不仅返回id
但也name
场和lastname
字段。在 Slick 中可能吗?
map
确定返回表的投影,因此您可以选择所需的字段并将它们打包在元组中:
mytable
.returning(mytable.map(t => (t.id, t.name, t.lastname)))
.+=(item)(session)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)