neo4j-ruby-driver 4.4.5-java → 5.13.0.alpha.1-java
Sign up to get free protection for your applications and to get access to all the features.
- 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/internal_result.rb +4 -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 +17 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbf26d42944323e18fc28f944ff365d981755118e1d01f52345c72ebdcea5641
|
4
|
+
data.tar.gz: 708c207bbc0602450a4514876b910319652166946f657c5ae7ff7993d53056fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 934c8d730afe408fe9b840c5bfc6c00c09886b0742d055139ead934c6adf59142171a3cdfdf3cabbbeefe57608b5b1417523d7dfc9232164bb728cc8285ef253
|
7
|
+
data.tar.gz: 93117f5187a574967021949c3b3a4bf0b4dc48706fba5080d2cc8f2210e598778460b0d22e46046c06d677cda165fb3d620239b94bb4d20331d57030c8ea8b9c
|
@@ -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.1
|
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-08 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,7 +63,7 @@ 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
69
|
- !ruby/object:Gem::Dependency
|
@@ -234,8 +234,12 @@ files:
|
|
234
234
|
- jruby/neo4j/driver/ext/internal/async/internal_async_session.rb
|
235
235
|
- jruby/neo4j/driver/ext/internal/cluster/routing_table_registry_impl.rb
|
236
236
|
- jruby/neo4j/driver/ext/internal/cursor/disposable_async_result_cursor.rb
|
237
|
+
- jruby/neo4j/driver/ext/internal/driver_factory.rb
|
237
238
|
- jruby/neo4j/driver/ext/internal/internal_bookmark.rb
|
239
|
+
- jruby/neo4j/driver/ext/internal/internal_notification_common.rb
|
238
240
|
- jruby/neo4j/driver/ext/internal/metrics/internal_connection_pool_metrics.rb
|
241
|
+
- jruby/neo4j/driver/ext/internal/summary/internal_notification.rb
|
242
|
+
- jruby/neo4j/driver/ext/internal/summary/internal_plan.rb
|
239
243
|
- jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb
|
240
244
|
- jruby/neo4j/driver/ext/internal_driver.rb
|
241
245
|
- jruby/neo4j/driver/ext/internal_entity.rb
|
@@ -276,6 +280,7 @@ files:
|
|
276
280
|
- lib/neo4j/driver/exceptions/token_expired_exception.rb
|
277
281
|
- lib/neo4j/driver/exceptions/transaction_nesting_exception.rb
|
278
282
|
- lib/neo4j/driver/exceptions/transient_exception.rb
|
283
|
+
- lib/neo4j/driver/exceptions/unsupported_feature_exception.rb
|
279
284
|
- lib/neo4j/driver/exceptions/untrusted_server_exception.rb
|
280
285
|
- lib/neo4j/driver/exceptions/value/lossy_coercion.rb
|
281
286
|
- lib/neo4j/driver/exceptions/value/not_multi_valued.rb
|
@@ -312,12 +317,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
312
317
|
version: '2.6'
|
313
318
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
319
|
requirements:
|
315
|
-
- - "
|
320
|
+
- - ">"
|
316
321
|
- !ruby/object:Gem::Version
|
317
|
-
version:
|
322
|
+
version: 1.3.1
|
318
323
|
requirements:
|
319
|
-
- jar org.neo4j.driver, neo4j-java-driver,
|
320
|
-
rubygems_version: 3.3.
|
324
|
+
- jar org.neo4j.driver, neo4j-java-driver-all, 5.13.0
|
325
|
+
rubygems_version: 3.3.26
|
321
326
|
signing_key:
|
322
327
|
specification_version: 4
|
323
328
|
summary: ''
|