packages feed

dbm 0.1.1.0 → 0.2

raw patch · 2 files changed

+7/−3 lines, 2 filesdep +direct-sqlite

Dependencies added: direct-sqlite

Files

dbm.cabal view
@@ -1,5 +1,5 @@ name:                dbm-version:             0.1.1.0+version:             0.2 synopsis:            A *simple* database migration tool. homepage:            https://github.com/relrod/dbm license:             BSD3@@ -17,6 +17,7 @@                      , SQLite   -- other-extensions:   build-depends:       base >= 4 && < 5+                     , direct-sqlite >= 2.3 && < 2.4                      , directory                      , ini                      , optparse-applicative >= 0.12 && < 0.14
src/SQLite.hs view
@@ -5,6 +5,7 @@ import qualified Data.Text as T import qualified Data.Text.IO as T import Database.SQLite.Simple+import Database.SQLite3 (exec)  import Utility @@ -35,10 +36,12 @@  performMigration :: FilePath -> FilePath -> Integer -> IO () performMigration dbPath sql mid = do-  conn <- open dbPath+  conn@(Connection hdl) <- open dbPath   withTransaction conn $ do     migrationQuery <- T.readFile sql-    execute_ conn (Query migrationQuery)+    -- NOTE! We have to drop to direct-sqlite here and used 'exec' from it+    -- because of https://github.com/nurpax/sqlite-simple/issues/44+    exec hdl migrationQuery     logMigration conn mid  getLastMigration :: FilePath -> IO (Maybe Integer)