Advertisement
DoctorRynerNew

Untitled

Nov 2nd, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. get_ :: AppM [User]
  2. get_ = ask >>= \state -> db state.pool $ \conn -> do
  3.     [Only users] :: [Only Value] <- query_ conn "SELECT * from users where data->>'username' = 'Tester'"
  4.     case fromJSON users of
  5.         Success a -> pure [a]
  6.         Error e   -> error e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement