postgresql-binary 0.3.0 → 0.3.1
raw patch · 2 files changed
+27/−3 lines, 2 filesdep ~QuickCheckdep ~attoparsecdep ~bytestring
Dependency ranges changed: QuickCheck, attoparsec, bytestring
Files
- executables/Tests.hs +24/−0
- postgresql-binary.cabal +3/−3
executables/Tests.hs view
@@ -304,6 +304,30 @@ fmap (Decoder.timestamp integerDatetimes . fromJust) $ query "SELECT '2000-01-19 10:41:06' :: timestamp" [] PQ.Binary +test_timestamptzOffset =+ do+ c <- connect+ initConnection c+ PQ.exec c "DROP TABLE IF EXISTS a"+ PQ.exec c "CREATE TABLE a (b TIMESTAMPTZ)"+ PQ.exec c "set timezone to 'America/Los_Angeles'"+ let p = (,,) (PQ.Oid $ fromIntegral o) + (Encoder.timestamptz integerDatetimes x) + (PQ.Binary)+ o = PTI.oidOf PTI.timestamptz+ x = read "2011-09-28 00:17:25"+ PQ.execParams c "insert into a (b) values ($1)" [Just p] PQ.Text+ PQ.exec c "set timezone to 'Europe/Stockholm'"+ assertEqual (Just "2011-09-28 02:17:25+02") + =<< singleResult + =<< PQ.execParams c "SELECT * FROM a" [] PQ.Text+ assertEqual (Just (Right x)) + =<< return . fmap (Decoder.timestamptz integerDatetimes)+ =<< singleResult + =<< PQ.execParams c "SELECT * FROM a" [] PQ.Binary+ where+ singleResult r = PQ.getvalue (fromJust r) 0 0+ prop_timestamptz = forAll microsUTCTimeGen $ \x -> Just (Right (timestamptzApxRep x)) === do
postgresql-binary.cabal view
@@ -1,7 +1,7 @@ name: postgresql-binary version:- 0.3.0+ 0.3.1 synopsis: Encoders and decoders for the PostgreSQL's binary format description:@@ -65,7 +65,7 @@ PostgreSQLBinary.Decoder build-depends: -- parsers:- attoparsec == 0.12.*,+ attoparsec >= 0.10 && < 0.13, -- data: uuid == 1.3.*, time >= 1.4 && < 1.6,@@ -101,7 +101,7 @@ postgresql-binary, HTF == 0.12.*, quickcheck-instances == 0.3.*,- QuickCheck == 2.7.*,+ QuickCheck >= 2.6 && < 2.8, -- database: postgresql-libpq == 0.9.*, -- data: