Skip to content

Instantly share code, notes, and snippets.

@komsit37
Last active June 3, 2016 01:00
Show Gist options
  • Select an option

  • Save komsit37/b06fe047bdc275b9a097db2ad7ab2689 to your computer and use it in GitHub Desktop.

Select an option

Save komsit37/b06fe047bdc275b9a097db2ad7ab2689 to your computer and use it in GitHub Desktop.
scala quill - update sql without explicitly setting all fields
case class DbOrg(id: Int, name: String, a: String, b: Int, c: Long)
val q = quote {
(id: Int, orgName: String) =>
query[DbOrg].filter(_.id == id).filter(_.name == orgName).update
}
val d = DbOrg(1, "n", "a", 1, 2L)
mirrorSource.run(q(lift(d.id), lift(d.name)))(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment