lib/redgraph/query_response.rb in redgraph-0.2.0 vs lib/redgraph/query_response.rb in redgraph-0.2.1
- old
+ new
@@ -27,13 +27,20 @@
def initialize(response, graph)
@response = response
@graph = graph
- @header_row = @response[0]
- @result_rows = @response[1]
- @query_statistics = @response[2]
+ case @response.size
+ when 3
+ @header_row = @response[0]
+ @result_rows = @response[1]
+ @query_statistics = @response[2]
+ when 1 # queries with no RETURN clause
+ @header_row = []
+ @result_rows = []
+ @query_statistics = @response[0]
+ end
end
def stats
@stats ||= parse_stats
end
@@ -119,9 +126,11 @@
label, value = item.split(":")
case label
when /^Nodes created/
stats[:nodes_created] = value.to_i
+ when /^Nodes deleted/
+ stats[:nodes_deleted] = value.to_i
when /^Relationships created/
stats[:relationships_created] = value.to_i
when /^Properties set/
stats[:properties_set] = value.to_i
when /^Query internal execution time/