opaleye 0.5.2.1 → 0.5.2.2
raw patch · 6 files changed
+12/−37 lines, 6 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Opaleye.Internal.RunQuery: arrayFieldParser :: Typeable a => FieldParser a -> FieldParser (PGArray a)
- Opaleye.Internal.RunQuery: fromArray :: FieldParser a -> TypeInfo -> Field -> Parser (Conversion [a])
+ Opaleye.Operators: infixr 3 .&&
Files
- CHANGELOG.md +4/−0
- opaleye.cabal +1/−1
- src/Opaleye/Internal/Column.hs +1/−1
- src/Opaleye/Internal/RunQuery.hs +3/−34
- src/Opaleye/Operators.hs +2/−0
- src/Opaleye/Order.hs +1/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 0.5.2.2++* Corrected fixity for .&&+ ## 0.5.2.1 * Improved documentation
opaleye.cabal view
@@ -1,6 +1,6 @@ name: opaleye copyright: Copyright (c) 2014-2016 Purely Agile Limited-version: 0.5.2.1+version: 0.5.2.2 synopsis: An SQL-generating DSL targeting PostgreSQL description: An SQL-generating DSL targeting PostgreSQL. Allows Postgres queries to be written within Haskell in a
src/Opaleye/Internal/Column.hs view
@@ -17,7 +17,7 @@ unColumn :: Column a -> HPQ.PrimExpr unColumn (Column e) = e -{-# DEPRECATED unsafeCoerce "Will be deprecated in version 0.6. Use unsafeCoerceColumn instead." #-}+{-# DEPRECATED unsafeCoerce "Will be removed in version 0.6. Use unsafeCoerceColumn instead." #-} unsafeCoerce :: Column a -> Column b unsafeCoerce = unsafeCoerceColumn
src/Opaleye/Internal/RunQuery.hs view
@@ -5,8 +5,8 @@ import Control.Applicative (Applicative, pure, (*>), (<*>), liftA2) import Database.PostgreSQL.Simple.Internal (RowParser)-import Database.PostgreSQL.Simple.FromField (FieldParser, FromField,- fromField)+import Database.PostgreSQL.Simple.FromField+ (FieldParser, FromField, fromField, pgArrayFieldParser) import Database.PostgreSQL.Simple.FromRow (fromRow, fieldWith) import Database.PostgreSQL.Simple.Types (fromPGArray, Only(..)) @@ -216,7 +216,7 @@ instance (Typeable b, QueryRunnerColumnDefault a b) => QueryRunnerColumnDefault (T.PGArray a) [b] where- queryRunnerColumnDefault = QueryRunnerColumn (P.lmap arrayColumn c) ((fmap . fmap . fmap) fromPGArray (arrayFieldParser f))+ queryRunnerColumnDefault = QueryRunnerColumn (P.lmap arrayColumn c) ((fmap . fmap . fmap) fromPGArray (pgArrayFieldParser f)) where QueryRunnerColumn c f = queryRunnerColumnDefault -- }@@ -248,37 +248,6 @@ (either fb gb) where QueryRunner fu fr fb = f QueryRunner gu gr gb = g---- }---- { Annoying postgresql-simple patch. Delete this when it is merged upstream.--arrayFieldParser :: Typeable a => FieldParser a -> FieldParser (PGArray a)-arrayFieldParser- fieldParser f mdat = do- info <- typeInfo f- case info of- TI.Array{} ->- case mdat of- Nothing -> returnError UnexpectedNull f ""- Just dat -> do- case parseOnly (fromArray fieldParser info f) dat of- Left err -> returnError ConversionFailed f err- Right conv -> PGArray <$> conv- _ -> returnError Incompatible f ""--fromArray :: FieldParser a -> TypeInfo -> Field -> Parser (Conversion [a])-fromArray fieldParser tInfo f = sequence . (parseIt <$>) <$> array delim- where- delim = typdelim (typelem tInfo)- fElem = f{ typeOid = typoid (typelem tInfo) }-- parseIt item =- fieldParser f' $ if item' == fromString "NULL" then Nothing else Just item'- where- item' = fmt delim item- f' | Arrays.Array _ <- item = f- | otherwise = fElem -- }
src/Opaleye/Operators.hs view
@@ -123,6 +123,8 @@ (.||) :: Column T.PGBool -> Column T.PGBool -> Column T.PGBool (.||) = C.binOp HPQ.OpOr +infixr 3 .&&+ -- | Boolean and (.&&) :: Column T.PGBool -> Column T.PGBool -> Column T.PGBool (.&&) = (O..&&)
src/Opaleye/Order.hs view
@@ -26,7 +26,7 @@ {-| Order the rows of a `Query` according to the `Order`. @-import Data.Monoid (\<\>)+import Data.Monoid ((\<\>)) \-- Order by the first column ascending. When first columns are equal \-- order by second column descending.