persistent-sqlite 1.1.2 → 1.1.3
raw patch · 3 files changed
+20/−12 lines, 3 filesdep ~conduitdep ~monad-controldep ~persistent
Dependency ranges changed: conduit, monad-control, persistent, text, transformers
Files
- Database/Persist/Sqlite.hs +6/−5
- Database/Sqlite.hs +8/−1
- persistent-sqlite.cabal +6/−6
Database/Persist/Sqlite.hs view
@@ -34,6 +34,7 @@ import Data.Conduit import qualified Data.Conduit.List as CL import Control.Applicative+import Data.Int (Int64) createSqlitePool :: MonadIO m => Text -> Int -> m ConnectionPool createSqlitePool s = createSqlPool $ open' s@@ -67,7 +68,7 @@ where helper t getter = do stmt <- getter t- execute stmt []+ _ <- execute stmt [] reset stmt ignoreExceptions = E.handle (\(_ :: E.SomeException) -> return ()) @@ -77,7 +78,7 @@ return Statement { finalize = Sqlite.finalize stmt , reset = Sqlite.reset stmt- , execute = execute' stmt+ , execute = execute' conn stmt , withStmt = withStmt' stmt } @@ -96,11 +97,11 @@ , ")" ] -execute' :: Sqlite.Statement -> [PersistValue] -> IO ()-execute' stmt vals = flip finally (liftIO $ Sqlite.reset stmt) $ do+execute' :: Sqlite.Connection -> Sqlite.Statement -> [PersistValue] -> IO Int64+execute' conn stmt vals = flip finally (liftIO $ Sqlite.reset stmt) $ do Sqlite.bind stmt vals Sqlite.Done <- Sqlite.step stmt- return ()+ Sqlite.changes conn withStmt' :: MonadResource m
Database/Sqlite.hs view
@@ -22,7 +22,8 @@ bindText, bind, column,- columns+ columns,+ changes ) where @@ -418,3 +419,9 @@ columns statement = do count <- columnCount statement mapM (\i -> column statement i) [0..count-1]++foreign import ccall "sqlite3_changes"+ changesC :: Connection -> IO Int++changes :: Connection -> IO Int64+changes = fmap fromIntegral . changesC
persistent-sqlite.cabal view
@@ -1,5 +1,5 @@ name: persistent-sqlite-version: 1.1.2+version: 1.1.3 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -19,13 +19,13 @@ library build-depends: base >= 4 && < 5 , bytestring >= 0.9.1- , transformers >= 0.2.1 && < 0.4- , persistent >= 1.1.2 && < 1.2- , monad-control >= 0.2 && < 0.4+ , transformers >= 0.2.1+ , persistent >= 1.1.5 && < 1.2+ , monad-control >= 0.2 , containers >= 0.2- , text >= 0.7 && < 1+ , text >= 0.7 , aeson >= 0.5- , conduit >= 0.5.3 && < 0.6+ , conduit >= 0.5.3 exposed-modules: Database.Sqlite Database.Persist.Sqlite ghc-options: -Wall