cypher-stream
Advanced tools
+7
-2
| language: node_js | ||
| node_js: | ||
| - "0.10" | ||
| services: | ||
| - neo4j | ||
| env: | ||
| - NEO4J_VERSION="2.0.0" | ||
| before_install: | ||
| # install Neo4j locally: | ||
| - wget dist.neo4j.org/neo4j-community-$NEO4J_VERSION-unix.tar.gz | ||
| - tar -xzf neo4j-community-$NEO4J_VERSION-unix.tar.gz | ||
| - neo4j-community-$NEO4J_VERSION/bin/neo4j start |
+4
-1
@@ -33,3 +33,6 @@ var oboe = require('oboe'); | ||
| .fail(function(error) { | ||
| stream.emit('error', error); | ||
| var err = new Error('Query failure: '+error.jsonBody.message); | ||
| err.neo4j = error.jsonBody; | ||
| err.neo4j.statusCode = error.statusCode; | ||
| stream.emit('error', err); | ||
| stream.push(null); | ||
@@ -36,0 +39,0 @@ }); |
+3
-3
| { | ||
| "name": "cypher-stream", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", | ||
| "description": "Streams cypher query results in a clean format", | ||
@@ -25,8 +25,8 @@ "main": "index.js", | ||
| "dependencies": { | ||
| "oboe": "~1.12.2" | ||
| "oboe": "~1.14.0" | ||
| }, | ||
| "devDependencies": { | ||
| "mocha": "~1.17.1", | ||
| "should": "~3.1.2" | ||
| "should": "~3.1.3" | ||
| } | ||
| } |
+2
-2
@@ -1,2 +0,2 @@ | ||
| # cypher-stream [](http://badge.fury.io/js/cypher-stream) [](https://david-dm.org/brian-gates/cypher-stream.png#info=devDependencies) | ||
| # cypher-stream [](https://travis-ci.org/brian-gates/cypher-stream) [](http://badge.fury.io/js/cypher-stream) [](https://david-dm.org/brian-gates/cypher-stream.png#info=devDependencies) | ||
@@ -41,2 +41,2 @@ Neo4j cypher queries as node object streams. | ||
| ``` | ||
| ``` |
@@ -8,2 +8,5 @@ var should = require('should'); | ||
| .on('end', done) | ||
| .on('error', function (error){ | ||
| console.error(error); | ||
| }) | ||
| .resume(); | ||
@@ -34,8 +37,8 @@ }); | ||
| cypher('invalid query') | ||
| .on('data', function (data){ | ||
| console.log(data); | ||
| }) | ||
| .on('error', function (error) { | ||
| errored = true; | ||
| error.statusCode.should.eql(400); | ||
| String(error).should.equal('Error: Query failure: Invalid input \'i\': expected SingleStatement (line 1, column 1)\n"invalid query"\n ^'); | ||
| error.neo4j.exception.should.equal('SyntaxException'); | ||
| error.neo4j.stacktrace.should.be.an.array; | ||
| error.neo4j.statusCode.should.equal(400); | ||
| }) | ||
@@ -46,2 +49,3 @@ .on('end', function() { | ||
| }) | ||
| .resume() // need to manually start it since we have no on('data') | ||
| ; | ||
@@ -48,0 +52,0 @@ }); |
16520
5.78%89
8.54%41
-2.38%+ Added
+ Added
- Removed
- Removed
Updated