Permalink
Browse files

more thrashy test

--HG--
extra : convert_revision : 68a6e0e3c48744cd63b2ea356cc2dd01d9f5718d
  • Loading branch information...
1 parent 2a92d7f commit b7e75795122a1d334642e892121c8152bdae3344 @waterson waterson committed Feb 18, 2009
Showing with 5 additions and 16 deletions.
  1. +5 −16 Test.hs
View
21 Test.hs
@@ -1,28 +1,17 @@
module Main where
+import System.IO.Unsafe
import Control.Monad
import Database.HDBC
import Database.HDBC.MySQL
go :: IO ()
go = do conn <- connectMySQL defaultMySQLConnectInfo
--- { mysqlPort = 13306
--- , mysqlDatabase = "event"
--- }
+ { mysqlHost = "madchenwagen"
+ }
- putStrLn $ "you are connected to " ++ (hdbcDriverName conn) ++
- " server version " ++ (dbServerVer conn) ++
- " via client version " ++ (hdbcClientVer conn)
-
- tables <- getTables conn
- putStrLn $ "the tables in this database are " ++ (show tables)
-
- stmt <- prepare conn "SELECT NOW()"
- execute stmt []
- rows <- fetchAllRows stmt
+ rows <- quickQuery' conn "SELECT * FROM album" []
forM_ rows $ \row -> putStrLn $ show row
- disconnect conn
-
main :: IO ()
-main = handleSqlError go
+main = handleSqlError (replicateM_ 1000 go)

0 comments on commit b7e7579

Please sign in to comment.