Last active
June 3, 2016 01:00
-
-
Save komsit37/b06fe047bdc275b9a097db2ad7ab2689 to your computer and use it in GitHub Desktop.
scala quill - update sql without explicitly setting all fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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