persistent 0.6.3 → 0.6.4
raw patch · 3 files changed
+8/−14 lines, 3 files
Files
- Database/Persist/Base.hs +6/−10
- Database/Persist/GenericSql.hs +1/−3
- persistent.cabal +1/−1
Database/Persist/Base.hs view
@@ -68,7 +68,7 @@ import qualified Control.Monad.IO.Class as Trans import qualified Control.Exception as E-import Control.Monad.Error.Class (Error (..))+import Control.Monad.Trans.Error (Error (..)) import Data.Bits (bitSize) import Control.Monad (liftM)@@ -77,7 +77,6 @@ import qualified Data.Text.Encoding.Error as T import Web.PathPieces (SinglePiece (..)) import qualified Data.Text.Read-import Data.Maybe (fromMaybe, isJust) import Control.Monad.IO.Control (MonadControlIO) import Data.Object (TextObject)@@ -500,15 +499,12 @@ Just _ -> return False limitOffsetOrder :: PersistEntity val => [SelectOpt val] -> (Int, Int, [SelectOpt val])-limitOffsetOrder opts = let (l,o,ord) = go opts (Nothing, Nothing, []) in- (fromMaybe 0 l, fromMaybe 0 o, ord)+limitOffsetOrder opts =+ foldr go (0, 0, []) opts where- go [] tup = tup- go (LimitTo x:xs) (_,o,ord) = let tup = (Just x, o, ord) in- if isJust o then tup else go xs tup- go (OffsetBy x:xs) (l,_,ord) = let tup = (l, Just x, ord) in- if isJust l then tup else go xs tup- go (x:xs) (l, o, ord) = go xs (l,o,x:ord)+ go (LimitTo l) (_, b, c) = (l, b ,c)+ go (OffsetBy o) (a, _, c) = (a, o, c)+ go x (a, b, c) = (a, b, x : c) -- | Call 'select' but return the result as a list. selectList :: (PersistEntity val, PersistBackend b m)
Database/Persist/GenericSql.hs view
@@ -153,9 +153,7 @@ selectEnum filts opts = Iteratee . start where- limit = fst3 $ limitOffsetOrder opts- offset = snd3 $ limitOffsetOrder opts- orders = third3 $ limitOffsetOrder opts+ (limit, offset, orders) = limitOffsetOrder opts start x = do conn <- SqlPersist ask
persistent.cabal view
@@ -1,5 +1,5 @@ name: persistent-version: 0.6.3+version: 0.6.4 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>