Created
July 21, 2016 06:37
-
-
Save anonymous/64da1b8df3309db08811c113736353c5 to your computer and use it in GitHub Desktop.
the description for this gist
This file contains 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
/* Quill's infix mechanism */ | |
implicit class ForUpdate[T](q: Query[T]) { | |
def forUpdate = quote(infix"$q FOR UPDATE".as[Query[T]]) | |
} | |
val a = quote { | |
users.filter(u => u.isActive == true).forUpdate | |
} | |
/* Slick's raw query */ | |
sql""" | |
SELECT * FROM (SELECT * FROM users u WHERE u.is_active = true FOR UPDATE) u | |
""".as[(Long, String, Boolean))] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment