asilvestre / haskell-neo4j-rest-client Goto Github PK
View Code? Open in Web Editor NEWHaskell neo4j REST client
License: MIT License
Haskell neo4j REST client
License: MIT License
Currently these methods are emtpy. In particular, I want to write:
instance (NodeBatchIdentifier l, NodeBatchIdentifier r) =>
NodeBatchIdentifier (Either l r) where
getNodeBatchId = either getNodeBatchId getNodeBatchId
For now I have rather inconvenient duplication of code to handle the two cases.
haskell-neo4j-client: BuildFailureException Process exited with ExitFailure 1: ./Setup build
Building library for haskell-neo4j-client-0.3.2.4..
[ 1 of 19] Compiling Database.Neo4j.Types ( src/Database/Neo4j/Types.hs, dist/bu
ild/Database/Neo4j/Types.o )
src/Database/Neo4j/Types.hs:159:42: error:
Ambiguous occurrence ‘<>’
The same "ambiguous occurrence" error occurs ad infintum.
Do you think there should be function to avoid duplicated nodes? Or can this already be done somehow?
I'm having trouble getting proper error reporting-- when I try to delete a node which has dangling connections to other nodes in the Neo4j browser client, I get an exception of type TransactionFailureException
indicating that this is not possible. However, with the neo4j haskell client the same query returns a Result
type, not a TransError
, which falsely indicates that the node was deleted. Is this supposed to be like this?
I'm using version 0.3.2.2 and am wondering about opening a DB connection using newSecureAuthConnection
in combination with the resource pool package. That package has a function:
createPool
:: IO a -- acquire resource (open connection, e.g. "newSecureAuthConnection")
-> (a -> IO ()) -- close connection
-- ... other args...
-> IO (Pool a)
which manages the lifecycle of a pooled resource/connection. I was wondering if you had any advice on how to combine this and the Neo4j library. Or is there a different workflow that you've used?
Thanks!
I know this isn't the most informative issue, but one of my services is consistently exiting with code 139 when doing anything in withConnection host port . runTransaction
, even just
withConnection host port . runTransaction $ return 1
it's only happening in one service and not the others, but they're all in a shared sandbox and comparing the packages loaded between the two, the one that's not working has everything the working one does, same versions (the working one has three additional, unrelated packages).
Any ideas you have as far as debugging would be welcome.
> /tmp/stackage-build9$ stack unpack haskell-neo4j-client-0.3.2.2
Unpacked haskell-neo4j-client-0.3.2.2 to /tmp/stackage-build9/haskell-neo4j-client-0.3.2.2/
> /tmp/stackage-build9/haskell-neo4j-client-0.3.2.2$ runghc -clear-package-db -global-package-db -package-db=/var/stackage/work/builds/nightly/pkgdb Setup configure --package-db=clear --package-db=global --package-db=/var/stackage/work/builds/nightly/pkgdb --libdir=/var/stackage/work/builds/nightly/lib --bindir=/var/stackage/work/builds/nightly/bin --datadir=/var/stackage/work/builds/nightly/share --libexecdir=/var/stackage/work/builds/nightly/libexec --sysconfdir=/var/stackage/work/builds/nightly/etc --docdir=/var/stackage/work/builds/nightly/doc/haskell-neo4j-client-0.3.2.2 --htmldir=/var/stackage/work/builds/nightly/doc/haskell-neo4j-client-0.3.2.2 --haddockdir=/var/stackage/work/builds/nightly/doc/haskell-neo4j-client-0.3.2.2 --flags=
Configuring haskell-neo4j-client-0.3.2.2...
> /tmp/stackage-build9/haskell-neo4j-client-0.3.2.2$ runghc -clear-package-db -global-package-db -package-db=/var/stackage/work/builds/nightly/pkgdb Setup build
Building haskell-neo4j-client-0.3.2.2...
Preprocessing library haskell-neo4j-client-0.3.2.2...
[ 1 of 19] Compiling Database.Neo4j.Types ( src/Database/Neo4j/Types.hs, dist/build/Database/Neo4j/Types.o )
[ 2 of 19] Compiling Database.Neo4j.Http ( src/Database/Neo4j/Http.hs, dist/build/Database/Neo4j/Http.o )
src/Database/Neo4j/Http.hs:92:21: error:
Not in scope: ‘HC.checkStatus’
Module ‘Network.HTTP.Conduit’ does not export ‘checkStatus’.
Currently this can be worked around by adding the following to conf/neo4j-server.properties
dbms.security.auth_enabled=false
Thank you @asilvestre for pointing this out, but obviously disabling security features is less than desirable.
Here is the relevant Neo4j documentation.
Consider setting up Travis CI builds. Here's a .travis.yml
that should let you get easily started
language: haskell
services:
- neo4j
ghc:
- 7.10
- 7.8
I wanted to use your library with stack, but I noticed that it hasn't been added to stackage yet. I was wondering if you could submit it?
You just have to make a pull request with a line stating that this package should be included and that you are the maintainer:
https://github.com/fpco/stackage/#get-your-package-included
You might want to build the package with stackage first to see if it builds properly.
Thanks!
If you do runNeo4j (void $ runBatch f) conn
, even if the batch fails you never get exceptions. This is extremely surprising and counterintuitive for the user. Generally, you should avoid error
and throw
in most code, throwing exceptions from pure values is terrible for API users, we do not expect it. In particular, it is unexpected that something that essentially lives in IO would use throw
rather than throwIO
.
This is a very common pattern, since you rarely care about the Graph that results from a batch operation.
I think the quick fix would be to use $!
after the return
in the definition of runBatch
, but it would be better to use throwIO
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.