scala - How to work with columns in Slick 2 framework -


i'm familiarizing slick don't know how deal column values.

in slick documentation mention briefly aggregate function exists, , use in query this:

val e = entity.filter(_.id === myid).exists 

how deal result if want check if it's true? pattern matching on it, or that.

e match{    case true =>   case false => } 

you have call .run boolean value:

val e: boolean = entity.filter(_.id === myid).exists.run 

with .run call invoker, can if/else or param match.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -