Advertisement
Guest User

Untitled

a guest
Mar 30th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. UserInfo
  2. fullName Text
  3. ageBracket Text Maybe
  4. gender Text
  5. createdOn UTCTime default=now()
  6. updatedOn UTCTime Maybe
  7. deriving Show
  8.  
  9. User
  10. userInfoId UserInfoId
  11. username Text
  12. password Text
  13. UniqueUsername username
  14. deriving Show
  15.  
  16. -- let say the output of this
  17. -- userInfoId = 1 -- this is a
  18. -- username = admin
  19. -- paswword = admin
  20. userData <- runDB $ selectFirst [UserUsername ==. uname , UsersPassword ==. pword] [LimitTo 1]
  21.  
  22.  
  23. case userData of
  24. Nothing -> ....
  25. Just (Entity _ u) -> do
  26. let userInfoId = T.pack (show (userUserInfoId u))
  27. $(logInfo) userInfoId
  28. .....
  29.  
  30. [INFO] UserInfoKey {unUserInfoKey = SqlBackendKey {unSqlBackendKey = 1}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement