Same as
get, but for a non-null (not Maybe) foreign key. Unsafe
unless your database is enforcing that the foreign key is valid.
Example usage
With
schema-1 and
dataset-1,
getJustSpj :: MonadIO m => ReaderT SqlBackend m User
getJustSpj = getJust spjId
spj <- getJust spjId
The above query when applied on
dataset-1, will get this
record:
+----+------+-----+
| id | name | age |
+----+------+-----+
| 1 | SPJ | 40 |
+----+------+-----+
getJustUnknown :: MonadIO m => ReaderT SqlBackend m User
getJustUnknown = getJust unknownId
mrx <- getJustUnknown
This just throws an error.