Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Added more types, exports, removed some debug code.
  • Loading branch information
chrisdone committed Jun 2, 2011
1 parent 3fb0b1f commit beb05ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,5 +1,5 @@
.hi
.o
*.hi
*.o
dist
cabal-dev
TAGS
6 changes: 4 additions & 2 deletions Database/PostgreSQL/Base.hs
Expand Up @@ -198,7 +198,7 @@ sendQuery types h sql = do
sendMessage h Query $ string sql
listener $ \continue -> do
(typ,block) <- liftIO $ getMessage h
liftIO $ putStrLn $ show (typ,block)
-- liftIO $ putStrLn $ show (typ,block)
let setStatus = modify $ \r -> r { resultType = typ }
case typ of
ReadyForQuery -> return ()
Expand Down Expand Up @@ -308,7 +308,9 @@ fieldTypes =
,("int",Long)
,("int4",Long)
,("int8",LongLong)
,("timestamptz",TimestampWithZone)]
,("timestamptz",TimestampWithZone)
,("varchar",CharVarying)
,("text",Text)]

-- | Parse a type's size.
parseSize :: Int16 -> Size
Expand Down
14 changes: 1 addition & 13 deletions Database/PostgreSQL/Simple.hs
Expand Up @@ -60,7 +60,7 @@ module Database.PostgreSQL.Simple
, Base.close
-- * Queries that return results
, query
-- , query_
, query_
-- * Queries that stream results
-- , fold
-- , fold_
Expand Down Expand Up @@ -103,18 +103,6 @@ import qualified Data.ByteString.Char8 as B
import qualified Database.PostgreSQL.Base as Base
import qualified Data.Text as Text

test :: IO Connection
test = do
conn <- Base.connect Base.defaultConnectInfo {
connectUser="amelie"
, connectDatabase="amelie"
, connectPassword= "amelie"
}
return conn
-- xs <- query_ conn "select name,age from users"
-- forM_ xs $ \(name,age) ->
-- putStrLn $ Text.unpack name ++ " is " ++ show (age :: Int)

-- | Exception thrown if a 'Query' could not be formatted correctly.
-- This may occur if the number of \'@?@\' characters in the query
-- string does not match the number of parameters provided.
Expand Down

0 comments on commit beb05ae

Please sign in to comment.