packages feed

hasbolt 0.1.0.1 → 0.1.0.2

raw patch · 3 files changed

+11/−7 lines, 3 filesPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

API changes (from Hackage documentation)

+ Database.Bolt: queryP :: MonadIO m => Text -> Map Text Value -> BoltActionT m [Record]

Files

hasbolt.cabal view
@@ -1,5 +1,5 @@ name:                hasbolt-version:             0.1.0.1+version:             0.1.0.2 synopsis:            Haskell driver for Neo4j 3+ (BOLT protocol) description:         Please see README.md homepage:            https://github.com/zmactep/hasbolt#readme
src/Database/Bolt.hs view
@@ -1,7 +1,7 @@ module Database.Bolt     ( BoltActionT (..)     , connect, close, reset-    , run, query, query_+    , run, queryP, query, query_     , Pipe     , BoltCfg (..), Default (..)     , Value (..), Record, RecordValue (..), at
src/Database/Bolt/Connection.hs view
@@ -11,7 +11,7 @@ import           Control.Monad.IO.Class        (MonadIO (..)) import           Control.Monad.Trans.Reader    (ReaderT (..), ask, runReaderT) import           Data.Text                     (Text)-import           Data.Map.Strict               (empty)+import           Data.Map.Strict               (Map (..), empty)  -- |Monad Transformer to do all BOLT actions in type BoltActionT = ReaderT Pipe@@ -20,12 +20,12 @@ run :: MonadIO m => Pipe -> BoltActionT m a -> m a run = flip runReaderT --- |Runs Cypher query and returns list of obtained 'Record's-query :: MonadIO m => Text -> BoltActionT m [Record]-query cypher = toRecords <$> pullRequests+-- |Runs Cypher query with parameters and returns list of obtained 'Record's+queryP :: MonadIO m => Text -> Map Text Value -> BoltActionT m [Record]+queryP cypher params = toRecords <$> pullRequests   where pullRequests :: MonadIO m => BoltActionT m [Response]         pullRequests = do pipe <- ask-                          let request = RequestRun cypher empty+                          let request = RequestRun cypher params                           flush pipe request                           status <- fetch pipe                           if isSuccess status then do flush pipe RequestPullAll@@ -37,6 +37,10 @@         pullRest pipe = do resp <- fetch pipe                            if isSuccess resp then return [resp]                                              else (resp:) <$> pullRest pipe++-- |Runs Cypher query and returns list of obtained 'Record's+query :: MonadIO m => Text -> BoltActionT m [Record]+query cypher = queryP cypher empty  -- |Runs Cypher query and ignores response query_ :: MonadIO m => Text -> BoltActionT m ()