sqlite-simple 0.2.0.0 → 0.2.1.0
raw patch · 3 files changed
+19/−16 lines, 3 filesdep ~text
Dependency ranges changed: text
Files
- Database/SQLite/Simple/Internal.hs +12/−12
- README.markdown +5/−2
- sqlite-simple.cabal +2/−2
Database/SQLite/Simple/Internal.hs view
@@ -23,6 +23,7 @@ import Prelude hiding (catch) import Control.Applicative+import Control.Monad.Fix (fix) import Control.Exception import Data.ByteString (ByteString) import Data.ByteString.Char8()@@ -65,16 +66,15 @@ exec (Connection conn) q = bracket (Base.prepare conn q) Base.finalize stepStmt --- Run a query a prepared statement++-- Run a query on a prepared statement stepStmt :: Base.Statement -> IO Result-stepStmt = go- where- go stmt = do- res <- Base.step stmt- case res of- Base.Row -> do- cols <- Base.columns stmt- next <- go stmt- return $ cols : next- Base.Done ->- return []+stepStmt stmt =+ flip fix [] $ \loop acc -> do+ res <- Base.step stmt+ case res of+ Base.Done ->+ return (reverse acc)+ Base.Row -> do+ !cols <- Base.columns stmt+ loop (cols : acc)
README.markdown view
@@ -10,8 +10,9 @@ in turn borrows from [mysql-simple](https://github.com/bos/mysql-simple). -The library has been fairly well unit tested, but I still consider it-somewhat experimental.+The library has been fairly well unit tested. It's also been benchmarked using+[db-bench](https://github.com/nurpax/db-bench) which is a performance comparison suite +for measuring database access overhead when using the various Haskell database libraries. [](http://travis-ci.org/nurpax/sqlite-simple) @@ -24,6 +25,8 @@ ``` cabal install sqlite-simple ```++A Windows user? It works but please see [this note](https://gist.github.com/3907344) on direct-sqlite Windows installation. Examples of use ---------------
sqlite-simple.cabal view
@@ -1,5 +1,5 @@ Name: sqlite-simple-Version: 0.2.0.0+Version: 0.2.1.0 Synopsis: Mid-Level SQLite client library Description: Mid-level SQLite client library, based on postgresql-simple.@@ -40,7 +40,7 @@ bytestring >= 0.9, containers, direct-sqlite >= 2.2 && < 2.3,- text >= 0.11.1,+ text >= 0.11, time, old-locale >= 1.0.0.0, transformers