selectSPJ :: MonadIO m => ReaderT SqlBackend m [Entity User] selectSPJ = selectList [UserName ==. "SPJ" ] []The above query when applied on dataset-1, will produce this:
+-----+-----+-----+ |id |name |age | +-----+-----+-----+ |1 |SPJ |40 | +-----+-----+-----+
c === dto place c above d. The local origin of the resulting combined diagram is the same as the local origin of the first. (===) is associative and has mempty as an identity. See the documentation of beside for more information.
query :: UserId -> SqlPersistT IO [Entity User] query userId = select $ do user <- from $ table @User where_ (user ^. UserId ==. val userId) pure userThis would generate the following SQL:
SELECT user.* FROM user WHERE user.id = ?