Permalink
Browse files

more testing

--HG--
extra : convert_revision : c1b682f83ed08c93ef1449deb1805be0b64f73dc
  • Loading branch information...
1 parent 4a545aa commit 1853a822d6838e4f91f8c6364948dc600310effb @waterson waterson committed Feb 18, 2009
Showing with 14 additions and 3 deletions.
  1. +14 −3 Test.hs
View
17 Test.hs
@@ -1,6 +1,5 @@
module Main where
-import System.IO.Unsafe
import Control.Monad
import Database.HDBC
import Database.HDBC.MySQL
@@ -10,8 +9,20 @@ go = do conn <- connectMySQL defaultMySQLConnectInfo
{ mysqlHost = "madchenwagen"
}
- rows <- quickQuery' conn "SELECT * FROM album" []
- forM_ rows $ \row -> putStrLn $ show row
+ {-
+ putStrLn $ "driver " ++ (show $ hdbcDriverName conn)
+ putStrLn $ "server version " ++ (show $ dbServerVer conn)
+ tables <- getTables conn
+ forM_ tables $ \t -> do
+ putStrLn $ "table " ++ t
+ cols <- describeTable conn t
+ forM_ cols $ \(name, desc) ->
+ putStrLn $ name ++ " " ++ (show desc)
+ -}
+
+ rows0 <- quickQuery' conn "SELECT a FROM album" []
+ rows1 <- quickQuery' conn "SELECT str FROM album" []
+ forM_ (zip rows0 rows1) $ \(a, str) -> putStrLn $ "a=" ++ (show a) ++ ", str=" ++ (show str)
main :: IO ()
main = handleSqlError (replicateM_ 1000 go)

0 comments on commit 1853a82

Please sign in to comment.