snaplet-hdbc 0.6.2.1 → 0.6.2.2
raw patch · 2 files changed
+11/−10 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
snaplet-hdbc.cabal view
@@ -1,5 +1,5 @@ name: snaplet-hdbc-version: 0.6.2.1+version: 0.6.2.2 synopsis: HDBC snaplet for Snap Framework description: This snaplet consists of two parts: an HDBC abstraction snaplet and an HDBC authentication backend for Snap's authentication
src/Snap/Snaplet/Auth/Backends/Hdbc.hs view
@@ -229,10 +229,10 @@ , toSql $ userPassword au] fetchRow stmt' nid <- case rw of- Nothing -> fail $ "Failed to fetch the newly inserted row. " ++- "It might not have been inserted at all."- Just [] -> fail "Something went wrong"- Just (x:_) -> return (fromSql x :: Text)+ Nothing -> fail $ "Failed to fetch the newly inserted row. " +++ "It might not have been inserted at all."+ Just [] -> fail "Something went wrong"+ Just (x:_) -> return (fromSql x :: Text) return $ au { userId = Just (UserId nid) } lookupByUserId mgr@(HdbcAuthManager _ tbl qs) uid = authQuery mgr $@@ -249,11 +249,12 @@ return () authQuery :: HdbcAuthManager -> (String, [SqlValue]) -> IO (Maybe AuthUser)-authQuery (HdbcAuthManager pool tbl _) (qry, vals) = withResource pool $- \conn -> do- stmt <- prepare conn qry- _ <- execute stmt vals- res <- fetchRowMap stmt+authQuery (HdbcAuthManager pool tbl _) (qry, vals) =+ withResource pool $ \conn -> do+ res <- do+ stmt <- prepare conn qry+ _ <- execute stmt vals+ fetchRowMap stmt return $ (return . mkUser tbl) =<< res mkUser :: AuthTable -> Map String SqlValue -> AuthUser