neo4j-ruby-driver 0.3.5 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c42b006e007156e7b426bd813fc8d13367c1a66931f7047268bf1b667a3a8b72
4
- data.tar.gz: 7bad351ef37ace5c080db834502ebfc2de2f7a5e6a49171ff99a6069bce0b6f2
3
+ metadata.gz: c2046ab6db9a33bd372582af76c0c91c02ec010beb3b72401fa6b79e758c4821
4
+ data.tar.gz: 034dfaa2aa250886d9967e626beda32d93bff9857095cf4c1e5573639902f8ce
5
5
  SHA512:
6
- metadata.gz: a3a392ed29054071570b452ff3485a03da001054fc6c8bbc23447ad20d6e408c41632c1b3d257cbf0d92ed3117bebfdb24949767e31f68a4c5bcf3e070daab9b
7
- data.tar.gz: 76cdc83a140b7d365c45cada9bb23b715ee729b92ffdfa772274f97679450b9f799f15d391e96de5b75ea717575dac48268abb33bf39035f5859ffcc4aa74997
6
+ metadata.gz: 95df5eedae01639609dc31b269c224a177b57598cab1a6239eb77795f290997bea05e80e241594326e6d0bc64356440c7e801feb23949fb87a62f0ec017f922d
7
+ data.tar.gz: b28ba72ae62720aa1d92068b9b3f934f8eef9e47c1f8078e9e5971c212c79b759a64d6904fa26c58f29963cca93e5151e81b4f03e1e0427d607e32b492ee2333
@@ -55,4 +55,6 @@ end
55
55
 
56
56
  Loader.load
57
57
 
58
+ Neo4j::Driver::Record = Neo4j::Driver::Internal::InternalRecord
59
+ Neo4j::Driver::StatementResult = Neo4j::Driver::Internal::InternalStatementResult
58
60
  Neo4j::Driver::Transaction = Neo4j::Driver::Internal::ExplicitTransaction
@@ -44,7 +44,7 @@ module Neo4j
44
44
  scheme = (uris.map(&method(:URI)).map(&:scheme) - VALID_ROUTING_SCHEMES).first
45
45
  return unless scheme
46
46
  raise ArgumentError,
47
- "Illegal URI scheme, expected URI scheme '#{scheme}' to be among [#{VALID_ROUTING_SCHEMES.join ', '}]"
47
+ "Illegal URI scheme, expected URI scheme '#{scheme}' to be among '[#{VALID_ROUTING_SCHEMES.join ', '}]'"
48
48
  end
49
49
  end
50
50
  end
@@ -49,7 +49,7 @@ module Neo4j
49
49
  )
50
50
  end
51
51
  end
52
- check_error Bolt::Config.set_user_agent(bolt_config, 'seabolt-cmake/1.7')
52
+ check_error Bolt::Config.set_user_agent(bolt_config, "neo4j-ruby-driver #{Neo4j::Driver::VERSION}")
53
53
  bolt_config
54
54
  end
55
55
 
@@ -82,7 +82,11 @@ module Neo4j
82
82
  end
83
83
 
84
84
  def throw(error)
85
- on_failure(error)
85
+ if @failure
86
+ error.add_suppressed(@failure)
87
+ else
88
+ on_failure(error)
89
+ end
86
90
  raise error
87
91
  end
88
92
 
@@ -61,12 +61,11 @@ module Neo4j
61
61
  end
62
62
 
63
63
  def on_failure(error)
64
+ @failure = error
64
65
  summary
65
66
  @finished = true
66
67
 
67
68
  after_failure(error)
68
-
69
- @failure = error
70
69
  end
71
70
 
72
71
  def finalize
@@ -34,8 +34,8 @@ module Neo4j
34
34
  after_success(nil)
35
35
  else
36
36
  return if previous&.failure
37
- @failure = Value::ValueAdapter.to_ruby(Bolt::Connection.failure(bolt_connection))
38
- raise new_neo4j_error(**@failure)
37
+ failure = Value::ValueAdapter.to_ruby(Bolt::Connection.failure(bolt_connection))
38
+ raise @failure = new_neo4j_error(**failure)
39
39
  end
40
40
  end
41
41
 
@@ -21,7 +21,7 @@ module Neo4j
21
21
  def finalize
22
22
  return if @finished
23
23
  super
24
- @statement_keys = Value::ValueAdapter.to_ruby(Bolt::Connection.field_names(bolt_connection))
24
+ @statement_keys = Value::ValueAdapter.to_ruby(Bolt::Connection.field_names(bolt_connection)).map(&:to_sym)
25
25
  metadata = Value::ValueAdapter.to_ruby(Bolt::Connection.metadata(bolt_connection))
26
26
  @result_available_after = metadata[:result_available_after] || metadata[:t_first]
27
27
  end
@@ -13,9 +13,13 @@ module Neo4j
13
13
  end
14
14
 
15
15
  def [](key)
16
- field_index = key.is_a?(Integer) ? key : @keys.index(key.to_s)
16
+ field_index = key.is_a?(Integer) ? key : @keys.index(key.to_sym)
17
17
  @values[field_index] if field_index
18
18
  end
19
+
20
+ def to_h
21
+ keys.zip(values).to_h
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -84,7 +84,7 @@ module Neo4j
84
84
  end
85
85
  end
86
86
 
87
- def acquire_connection(mode = @mode)
87
+ def acquire_connection(mode)
88
88
  # make sure previous result is fully consumed and connection is released back to the pool
89
89
  @result&.failure
90
90
 
@@ -94,7 +94,7 @@ module Neo4j
94
94
  # 3) previous result failed and error has been consumed
95
95
 
96
96
  raise Exceptions::IllegalStateException, 'Existing open connection detected' if @connection&.open?
97
- @connection = @connection_provider.acquire_connection(@mode)
97
+ @connection = @connection_provider.acquire_connection(mode)
98
98
  end
99
99
 
100
100
  def close_transaction_and_release_connection
@@ -11,6 +11,10 @@ module Neo4j
11
11
  @id = id
12
12
  @properties = properties
13
13
  end
14
+
15
+ def ==(other)
16
+ self.class == other.class && id == other.id
17
+ end
14
18
  end
15
19
  end
16
20
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neo4j
4
4
  module Driver
5
- VERSION = '0.3.5'
5
+ VERSION = '1.7.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-ruby-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heinrich Klobuczek
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-30 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -319,7 +319,7 @@ licenses:
319
319
  - MIT
320
320
  metadata:
321
321
  homepage_uri: https://github.com/neo4jrb/neo4j-ruby-driver
322
- post_install_message:
322
+ post_install_message:
323
323
  rdoc_options:
324
324
  - "--main"
325
325
  - README.md
@@ -338,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  version: '0'
339
339
  requirements: []
340
340
  rubygems_version: 3.1.2
341
- signing_key:
341
+ signing_key:
342
342
  specification_version: 4
343
343
  summary: ''
344
344
  test_files: []