Permalink
Browse files

Refactor countClient function to use 'withConn'

  • Loading branch information...
adomokos committed Dec 5, 2017
1 parent 2dac1bc commit 3bb07613665dad7e07bd4bbb24b2c22fac981911
Showing with 1 addition and 4 deletions.
  1. +1 −4 app/Main.hs
View
@@ -42,10 +42,7 @@ insertClient name subdomain = do
countClient :: IO ()
countClient = do
conn <- getConn
Just (clientCount) <- countClientSQL conn
H.commit conn -- added line
H.disconnect conn -- added line
Just (clientCount) <- withConn countClientSQL
putStrLn $ "There are " ++ show clientCount ++ " records."
main :: IO ()

0 comments on commit 3bb0761

Please sign in to comment.