zmactep / hasbolt

Haskell driver for Neo4j 3+ (BOLT protocol)
BSD 3-Clause "New" or "Revised" License
82 stars 13 forks source link

Sending queries with parameters not in map hangs #3

Closed epsilonhalbe closed 7 years ago

epsilonhalbe commented 7 years ago
import           Database.Bolt           hiding (Value)
import qualified Data.Map.Strict         as M

main :: IO ()
main = do pipe <- connect $ def {user = "neo4j", password = neo4j}
          result <- run pipe $ queryP "MATCH (d {prop: {prop}}) return d;" M.empty
          putStr "Result:"
          print result
          close pipe

With a neo4j db in default config the above program does not terminate

zmactep commented 7 years ago

Hi!

I cannot reproduce the issue on current master head:

λ> pipe <- connect $ def {user = "neo4j", password = "neo4j"}
λ> result <- run pipe $ queryP "MATCH (n {prop: {prop}}) RETRUN n" M.empty
λ> print result
[]

Which version of Neo4j do you use?

epsilonhalbe commented 7 years ago

there's a typo in your query - RETRUN /= RETURN

zmactep commented 7 years ago

My fault. It shows one more problem: hasbolt does not provide error messages on syntax errors. I'll fix it, thank you!

P.S. But with correct 'return' or without it everything still works:

{-# LANGUAGE OverloadedStrings #-}

import           Database.Bolt           hiding (Value)
import qualified Data.Map.Strict         as M

main :: IO ()
main = do pipe <- connect $ def {user = "neo4j", password = "neo4j"}
          result <- run pipe $ queryP "MATCH (d {prop: {prop}})" M.empty
          putStr "Result:"
          print result
          close pipe

retruns Result:[]

zmactep commented 7 years ago

@epsilonhalbe please check if latest commit works to you.

epsilonhalbe commented 7 years ago

@zmactep no it does not work - my neo4j is a 3.1.0 - inside a docker container, I also tried the docker image for 3.0 which is (3.0.7 at the moment) without any results

epsilonhalbe commented 7 years ago

the docker command I use is

docker run --name neo4j --publish=7474:7474 --publish=7687:7687 --volume=$HOME/neo4j/data:/data --volume=$HOME/neo4j/logs:/logs neo4j:3.1

and later docker start neo4j

zmactep commented 7 years ago

It is deeply magical. I'll try on one more laptop, but as for now I have this:

with return:

2017-01-16 14 47 40

and without it:

2017-01-16 14 48 56
epsilonhalbe commented 7 years ago

I have now tried this at home (new fresh docker container, linux native not in a vmware container) - and it works fine - so I will delete the docker container & image and all of the temporary files I have created and try it again tomorrow

zmactep commented 7 years ago

Ok, thanks! I use OS X + Docker for Mac and CentOS 7 + native docker. Both work fine for me.

zmactep commented 7 years ago

So, I close this issue, as I cannot reproduce it on any machine.