packages feed

postgresql-orm 0.3.1 → 0.3.2

raw patch · 9 files changed

+40/−10 lines, 9 filesdep ~blaze-builder

Dependency ranges changed: blaze-builder

Files

Data/GetField.hs view
@@ -1,10 +1,13 @@ {-# LANGUAGE Safe #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-}+#if __GLASGOW_HASKELL__ < 710 {-# LANGUAGE OverlappingInstances #-}+#endif {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} @@ -157,7 +160,9 @@   extractCount :: f r -> a -> (Int, [Int])   default extractCount :: (GCount g) => f r -> a -> (Int, [Int])   extractCount fr a = gCount (extract fr a)-instance (TypeGCast THasNone g) => Extractor f a r g where+instance+  {-# OVERLAPPABLE #-}+  (TypeGCast THasNone g) => Extractor f a r g where   extract _ _ = typeGCast THasNone   extractCount _ _ = gCount THasNone 
Database/PostgreSQL/Devel.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-}  -- | Functions for initializing self-contained local postgreSQL@@ -11,7 +12,9 @@  import Control.Exception import Control.Monad+#if __GLASGOW_HASKELL__ < 710 import Data.Functor+#endif import Data.List import Database.PostgreSQL.Simple import System.Directory
Database/PostgreSQL/Escape.hs view
@@ -57,10 +57,17 @@ c2b# :: Char -> Word# c2b# (C# i) = int2Word# (ord# i) +inlinePerformIO :: IO a -> a+#if MIN_VERSION_bytestring(0,10,6)+inlinePerformIO = S.accursedUnutterablePerformIO+#else+inlinePerformIO = S.inlinePerformIO+#endif+ fastFindIndex :: (Word# -> Bool) -> S.ByteString -> Maybe Int {-# INLINE fastFindIndex #-} fastFindIndex test bs =-  S.inlinePerformIO $ S.unsafeUseAsCStringLen bs $ \(Ptr bsp0, I# bsl0) -> do+  inlinePerformIO $ S.unsafeUseAsCStringLen bs $ \(Ptr bsp0, I# bsl0) -> do     let bse = bsp0 `plusAddr#` bsl0         check bsp = IO $ \rw -> case readWord8OffAddr# bsp 0# rw of           (# rw1, w #) -> (# rw1, test w #)@@ -230,7 +237,7 @@         intercatlate [t] []        = t         intercatlate _ _           =           error $ "buildSql: wrong number of parameters for " ++ show template-        split s = case S.breakByte (c2b '?') s of+        split s = case S.break (== c2b '?') s of           (h,t) | S.null t  -> [fromByteString h]                 | otherwise -> fromByteString h : split (S.unsafeTail t) 
Database/PostgreSQL/Migrate.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP, OverloadedStrings #-}  -- | Functions for creating and running database migrations. You should -- probably be using the `pg_migrate` executable to run migrations, however@@ -27,8 +27,10 @@ import System.Directory import System.FilePath import System.Environment-import System.Locale import System.IO+#if !MIN_VERSION_time(1,5,0)+import System.Locale+#endif  import Paths_postgresql_orm 
Database/PostgreSQL/ORM/Association.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}@@ -20,7 +21,9 @@   , nestAssoc, chainAssoc   ) where +#if __GLASGOW_HASKELL__ < 710 import Control.Applicative+#endif import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as S8 import Data.List
Database/PostgreSQL/ORM/DBSelect.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE Trustworthy #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-}@@ -30,7 +31,9 @@ import Blaze.ByteString.Builder.Char.Utf8 (fromChar) import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as S8+#if __GLASGOW_HASKELL__ < 710 import Data.Functor+#endif import Data.Monoid import Data.String import Data.IORef
Database/PostgreSQL/ORM/Model.hs view
@@ -80,7 +80,7 @@     , DBKeyType, DBKey(..), isNullKey     , DBRef, DBRefUnique, GDBRef(..), mkDBRef       -- * Database operations on Models-    , findAll, findRow, save, trySave, destroy, destroyByRef+    , findAll, findRow, save, save_, trySave, destroy, destroyByRef       -- * Functions for accessing and using Models     , modelName, primaryKey, modelSelectFragment     , LookupRow(..), UpdateRow(..), InsertRow(..)@@ -1097,6 +1097,11 @@   case eResp of     Right resp -> return resp     Left  errs -> throwIO errs++-- | 'save' but returning '()' instead of the saved model.+save_ :: (Model r)+      => Connection -> r -> IO ()+save_ c r = void $ save c r  -- | Write a 'Model' to the database.  If the primary key is -- 'NullKey', the item is written with an @INSERT@ query, read back
Database/PostgreSQL/ORM/Validations.hs view
@@ -1,10 +1,12 @@-{-# LANGUAGE FlexibleContexts, DeriveDataTypeable, OverloadedStrings #-}+{-# LANGUAGE CPP, FlexibleContexts, DeriveDataTypeable, OverloadedStrings #-} module Database.PostgreSQL.ORM.Validations where  import Control.Exception import Data.Aeson import qualified Data.HashMap.Strict as H+#if __GLASGOW_HASKELL__ < 710 import Data.Monoid+#endif import qualified Data.Text as T import Data.Typeable 
postgresql-orm.cabal view
@@ -1,5 +1,5 @@ name: postgresql-orm-version: 0.3.1+version: 0.3.2 cabal-version: >= 1.14 build-type: Simple license: GPL@@ -18,7 +18,7 @@   Main-is: pg_migrate.hs   ghc-options: -Wall   build-depends: base < 6-               , blaze-builder+               , blaze-builder < 0.4                , bytestring                , directory                , filepath@@ -33,7 +33,7 @@   default-language: Haskell2010   build-depends: base < 6                , aeson-               , blaze-builder+               , blaze-builder < 0.4                , bytestring                , directory                , filepath