如何使用 Slick Lifted Embedding 更新多个列? [英] How do you update multiple columns using Slick Lifted Embedding?

查看:18
本文介绍了如何使用 Slick Lifted Embedding 更新多个列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 Slick Lifted Embedding 更新多个列?本文档不多说了.

How do you update multiple columns using Slick Lifted Embedding ? This document doesn't say much.

我希望它是这样的

Query(AbilitiesTable).filter((ab: AbilitiesTable.type) => ab.id === ability_id).map((ab: AbilitiesTable.type) => (ab.verb, ab.subject)).update("edit", "doc")

推荐答案

我想通了.应该是这样的

I figured it out. It should be like this

val map = Query(AbilitiesTable)
  .filter(_.id === ability_id)
  .map(ab => ab.verb ~ ab.context)

map.update(("", ""))

Typesafe,为什么您的文档如此糟糕?我不得不谷歌几乎所有愚蠢的事情或挖掘单元测试几个小时.请改进它.谢谢.

Typesafe, why your documentation is so bad ? I have to Google pretty much every silly thing or dig through unit-tests for hours. Please improve it. Thanks.

这篇关于如何使用 Slick Lifted Embedding 更新多个列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆