neo4j-ruby-driver 4.4.5-java → 5.13.0.alpha.2-java
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 +4 -4
- data/jruby/neo4j/driver/ext/config_converter.rb +15 -1
- data/jruby/neo4j/driver/ext/exception_mapper.rb +3 -0
- data/jruby/neo4j/driver/ext/graph_database.rb +8 -4
- data/jruby/neo4j/driver/ext/internal/driver_factory.rb +24 -0
- data/jruby/neo4j/driver/ext/internal/internal_notification_common.rb +13 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_notification.rb +27 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_plan.rb +26 -0
- data/jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb +3 -1
- data/jruby/neo4j/driver/ext/internal_driver.rb +8 -0
- data/jruby/neo4j/driver/ext/ruby_converter.rb +1 -1
- data/jruby/neo4j/driver/version.rb +1 -1
- data/jruby/neo4j/driver.rb +4 -0
- data/lib/neo4j/driver/exceptions/unsupported_feature_exception.rb +11 -0
- data/lib/neo4j/driver/internal/duration_normalizer.rb +5 -0
- metadata +31 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6ac6b55a21c40d97c9e50ccc54b506f3f591d7d9201e48deea60f148ebe6c49
|
4
|
+
data.tar.gz: '05599de93940a5bf25a5fbca66f2c141dda3858752a4178dc018bb163adb9511'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6924be75318a9d7cc41fbc0772f40a6b036e963a114c27cd28991518795092673351da074f8447b1a47b2abdc1b9b2f1d046224469e78b8db2061c282c15959
|
7
|
+
data.tar.gz: fa9b9bccded40cc136890ed3e1aecca7b2384690fe67c8f82ead69306a6e1a751663be7cefef44462a65062d27ff247e24e9d3ec03d69ee9d864e67f67e5eb9d
|
@@ -13,7 +13,7 @@ module Neo4j
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def apply_to(builder, **hash)
|
16
|
-
hash.compact.reduce(builder) { |object,
|
16
|
+
hash.compact.reduce(builder) { |object, (key, value)| object.send(*config_method(key, value)) }
|
17
17
|
end
|
18
18
|
|
19
19
|
def config_method(key, value)
|
@@ -45,6 +45,8 @@ module Neo4j
|
|
45
45
|
else
|
46
46
|
"with_#{value}_revocation_checks"
|
47
47
|
end
|
48
|
+
when 'notification_config'
|
49
|
+
value = notification_config(**value)
|
48
50
|
else
|
49
51
|
value = to_neo(value, skip_unknown: true)
|
50
52
|
end
|
@@ -63,6 +65,18 @@ module Neo4j
|
|
63
65
|
end
|
64
66
|
apply_to(trust_strategy, **config)
|
65
67
|
end
|
68
|
+
|
69
|
+
def notification_config(minimum_severity: nil, disabled_categories: nil)
|
70
|
+
org.neo4j.driver.internal.InternalNotificationConfig.new(
|
71
|
+
value_of(org.neo4j.driver.internal.InternalNotificationSeverity, minimum_severity),
|
72
|
+
disabled_categories
|
73
|
+
&.map { |value| value_of(org.neo4j.driver.internal.InternalNotificationCategory, value) }
|
74
|
+
&.then(&java.util.HashSet.method(:new)))
|
75
|
+
end
|
76
|
+
|
77
|
+
def value_of(klass, value)
|
78
|
+
klass.value_of(value&.to_s&.upcase).or_else(nil)
|
79
|
+
end
|
66
80
|
end
|
67
81
|
end
|
68
82
|
end
|
@@ -19,6 +19,7 @@ module Neo4j
|
|
19
19
|
java_import org.neo4j.driver.exceptions.TokenExpiredException
|
20
20
|
java_import org.neo4j.driver.exceptions.TransactionNestingException
|
21
21
|
java_import org.neo4j.driver.exceptions.TransientException
|
22
|
+
java_import org.neo4j.driver.exceptions.UnsupportedFeatureException
|
22
23
|
java_import org.neo4j.driver.exceptions.UntrustedServerException
|
23
24
|
|
24
25
|
def mapped_exception(exception)
|
@@ -48,6 +49,8 @@ module Neo4j
|
|
48
49
|
Neo4j::Driver::Exceptions::SecurityException
|
49
50
|
when TransactionNestingException
|
50
51
|
Neo4j::Driver::Exceptions::TransactionNestingException
|
52
|
+
when UnsupportedFeatureException
|
53
|
+
Neo4j::Driver::Exceptions::UnsupportedFeatureException
|
51
54
|
when ClientException
|
52
55
|
Neo4j::Driver::Exceptions::ClientException
|
53
56
|
when ConnectionReadTimeoutException
|
@@ -8,7 +8,7 @@ module Neo4j
|
|
8
8
|
include ConfigConverter
|
9
9
|
include ExceptionCheckable
|
10
10
|
|
11
|
-
auto_closable :driver
|
11
|
+
auto_closable :driver
|
12
12
|
|
13
13
|
def driver(uri, auth_token = Neo4j::Driver::AuthTokens.none, **config)
|
14
14
|
check do
|
@@ -17,10 +17,14 @@ module Neo4j
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def internal_driver(uri, auth_token = Neo4j::Driver::AuthTokens.none, **config, &domain_name_resolver)
|
21
21
|
check do
|
22
|
-
|
23
|
-
|
22
|
+
java_uri = java.net.URI.create(uri.to_s)
|
23
|
+
java_config = to_java_config(Neo4j::Driver::Config, **config)
|
24
|
+
Internal::DriverFactory
|
25
|
+
.new(&domain_name_resolver)
|
26
|
+
.new_instance(java_uri, org.neo4j.driver.internal.security.StaticAuthTokenManager.new(auth_token),
|
27
|
+
java_config)
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Neo4j
|
2
|
+
module Driver
|
3
|
+
module Ext
|
4
|
+
module Internal
|
5
|
+
class DriverFactory < org.neo4j.driver.internal.DriverFactory
|
6
|
+
def initialize(&domain_name_resolver)
|
7
|
+
super()
|
8
|
+
@domain_name_resolver = ->(name) do
|
9
|
+
domain_name_resolver.call(name).map do |addr|
|
10
|
+
java.net.InetAddress.get_by_name(addr)
|
11
|
+
rescue java.net.UnknownHostException => e
|
12
|
+
raise java.lang.RuntimeException.new(e)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def getDomainNameResolver
|
18
|
+
@domain_name_resolver
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Neo4j
|
2
|
+
module Driver
|
3
|
+
module Ext
|
4
|
+
module Internal
|
5
|
+
module Summary
|
6
|
+
module InternalNotification
|
7
|
+
def severity_level
|
8
|
+
super.or_else(nil)
|
9
|
+
end
|
10
|
+
|
11
|
+
def raw_severity_level
|
12
|
+
super.or_else(nil)
|
13
|
+
end
|
14
|
+
|
15
|
+
def raw_category
|
16
|
+
super.or_else(nil)
|
17
|
+
end
|
18
|
+
|
19
|
+
def category
|
20
|
+
super.or_else(nil)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Neo4j
|
4
|
+
module Driver
|
5
|
+
module Ext
|
6
|
+
module Internal
|
7
|
+
module Summary
|
8
|
+
module InternalPlan
|
9
|
+
def args
|
10
|
+
arguments&.to_h&.transform_values(&:as_ruby_object)
|
11
|
+
end
|
12
|
+
|
13
|
+
def identifiers
|
14
|
+
super.to_a
|
15
|
+
end
|
16
|
+
|
17
|
+
# this part should probably be included in testkit-backend
|
18
|
+
def to_h
|
19
|
+
{operator_type:, args:, identifiers:, children: children&.map(&:to_h)}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -9,7 +9,9 @@ module Neo4j
|
|
9
9
|
java_import org.neo4j.driver.summary.QueryType
|
10
10
|
|
11
11
|
%i[result_available_after result_consumed_after].each do |method|
|
12
|
-
define_method(method)
|
12
|
+
define_method(method) do
|
13
|
+
super(Java::JavaUtilConcurrent::TimeUnit::MILLISECONDS).then { |val| val unless val == -1 }
|
14
|
+
end
|
13
15
|
end
|
14
16
|
|
15
17
|
def query_type
|
@@ -16,7 +16,7 @@ module Neo4j
|
|
16
16
|
date = as_local_date
|
17
17
|
Date.new(date.year, date.month_value, date.day_of_month)
|
18
18
|
when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::DURATION
|
19
|
-
|
19
|
+
Driver::Internal::DurationNormalizer.create(*%i[months days seconds nanoseconds].map(&as_object.method(:send)))
|
20
20
|
when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::POINT
|
21
21
|
point = as_point
|
22
22
|
Types::Point.new(srid: point.srid, x: point.x, y: point.y, z: nullable(point.z))
|
data/jruby/neo4j/driver.rb
CHANGED
@@ -43,6 +43,8 @@ Java::OrgNeo4jDriverInternal::InternalBookmark.prepend Neo4j::Driver::Ext::Inter
|
|
43
43
|
Java::OrgNeo4jDriverInternal::InternalDriver.prepend Neo4j::Driver::Ext::InternalDriver
|
44
44
|
Java::OrgNeo4jDriverInternal::InternalEntity.include Neo4j::Driver::Ext::InternalEntity
|
45
45
|
Java::OrgNeo4jDriverInternal::InternalNode.prepend Neo4j::Driver::Ext::InternalNode
|
46
|
+
Java::OrgNeo4jDriverInternal::InternalNotificationCategory.prepend Neo4j::Driver::Ext::Internal::InternalNotificationCommon
|
47
|
+
Java::OrgNeo4jDriverInternal::InternalNotificationSeverity.prepend Neo4j::Driver::Ext::Internal::InternalNotificationCommon
|
46
48
|
Java::OrgNeo4jDriverInternal::InternalPath.include Neo4j::Driver::Ext::StartEndNaming
|
47
49
|
Java::OrgNeo4jDriverInternal::InternalPath::SelfContainedSegment.include Neo4j::Driver::Ext::StartEndNaming
|
48
50
|
Java::OrgNeo4jDriverInternal::InternalRecord.prepend Neo4j::Driver::Ext::InternalRecord
|
@@ -54,5 +56,7 @@ Java::OrgNeo4jDriverInternalAsync::InternalAsyncSession.prepend Neo4j::Driver::E
|
|
54
56
|
Java::OrgNeo4jDriverInternalCluster::RoutingTableRegistryImpl.include Neo4j::Driver::Ext::Internal::Cluster::RoutingTableRegistryImpl
|
55
57
|
Java::OrgNeo4jDriverInternalCursor::DisposableAsyncResultCursor.prepend Neo4j::Driver::Ext::Internal::Cursor::DisposableAsyncResultCursor
|
56
58
|
Java::OrgNeo4jDriverInternalMetrics::InternalConnectionPoolMetrics.include Neo4j::Driver::Ext::Internal::Metrics::InternalConnectionPoolMetrics
|
59
|
+
Java::OrgNeo4jDriverInternalSummary::InternalNotification.prepend Neo4j::Driver::Ext::Internal::Summary::InternalNotification
|
60
|
+
Java::OrgNeo4jDriverInternalSummary::InternalPlan.prepend Neo4j::Driver::Ext::Internal::Summary::InternalPlan
|
57
61
|
Java::OrgNeo4jDriverInternalSummary::InternalResultSummary.prepend Neo4j::Driver::Ext::Internal::Summary::InternalResultSummary
|
58
62
|
Java::OrgNeo4jDriverInternalValue::ValueAdapter.include Neo4j::Driver::Ext::RubyConverter
|
@@ -21,6 +21,11 @@ module Neo4j
|
|
21
21
|
duration&.in_milliseconds&.round
|
22
22
|
end
|
23
23
|
|
24
|
+
def create(months, days, seconds, nanoseconds)
|
25
|
+
{ months:, days:, seconds: seconds + (nanoseconds.zero? ? 0 : nanoseconds * BigDecimal('1e-9')) }
|
26
|
+
.sum { |key, value| ActiveSupport::Duration.send(key, value) }
|
27
|
+
end
|
28
|
+
|
24
29
|
private
|
25
30
|
|
26
31
|
def divmod(number, factor)
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-ruby-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.13.0.alpha.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Heinrich Klobuczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
|
-
- - "
|
16
|
+
- - "<"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
18
|
+
version: '7.1'
|
19
19
|
name: activesupport
|
20
20
|
prerelease: false
|
21
21
|
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '7.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 0.4.1
|
61
61
|
name: jar-dependencies
|
@@ -63,9 +63,23 @@ dependencies:
|
|
63
63
|
type: :runtime
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.4.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - '='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 5.1.0
|
75
|
+
name: psych
|
76
|
+
prerelease: false
|
77
|
+
type: :runtime
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 5.1.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|
71
85
|
requirements:
|
@@ -234,8 +248,12 @@ files:
|
|
234
248
|
- jruby/neo4j/driver/ext/internal/async/internal_async_session.rb
|
235
249
|
- jruby/neo4j/driver/ext/internal/cluster/routing_table_registry_impl.rb
|
236
250
|
- jruby/neo4j/driver/ext/internal/cursor/disposable_async_result_cursor.rb
|
251
|
+
- jruby/neo4j/driver/ext/internal/driver_factory.rb
|
237
252
|
- jruby/neo4j/driver/ext/internal/internal_bookmark.rb
|
253
|
+
- jruby/neo4j/driver/ext/internal/internal_notification_common.rb
|
238
254
|
- jruby/neo4j/driver/ext/internal/metrics/internal_connection_pool_metrics.rb
|
255
|
+
- jruby/neo4j/driver/ext/internal/summary/internal_notification.rb
|
256
|
+
- jruby/neo4j/driver/ext/internal/summary/internal_plan.rb
|
239
257
|
- jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb
|
240
258
|
- jruby/neo4j/driver/ext/internal_driver.rb
|
241
259
|
- jruby/neo4j/driver/ext/internal_entity.rb
|
@@ -276,6 +294,7 @@ files:
|
|
276
294
|
- lib/neo4j/driver/exceptions/token_expired_exception.rb
|
277
295
|
- lib/neo4j/driver/exceptions/transaction_nesting_exception.rb
|
278
296
|
- lib/neo4j/driver/exceptions/transient_exception.rb
|
297
|
+
- lib/neo4j/driver/exceptions/unsupported_feature_exception.rb
|
279
298
|
- lib/neo4j/driver/exceptions/untrusted_server_exception.rb
|
280
299
|
- lib/neo4j/driver/exceptions/value/lossy_coercion.rb
|
281
300
|
- lib/neo4j/driver/exceptions/value/not_multi_valued.rb
|
@@ -312,12 +331,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
312
331
|
version: '2.6'
|
313
332
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
333
|
requirements:
|
315
|
-
- - "
|
334
|
+
- - ">"
|
316
335
|
- !ruby/object:Gem::Version
|
317
|
-
version:
|
336
|
+
version: 1.3.1
|
318
337
|
requirements:
|
319
|
-
- jar org.neo4j.driver, neo4j-java-driver,
|
320
|
-
rubygems_version: 3.3.
|
338
|
+
- jar org.neo4j.driver, neo4j-java-driver-all, 5.13.0
|
339
|
+
rubygems_version: 3.3.26
|
321
340
|
signing_key:
|
322
341
|
specification_version: 4
|
323
342
|
summary: ''
|