neo4j-ruby-driver 4.4.6 → 5.7.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neo4j/driver/exceptions/unsupported_feature_exception.rb +11 -0
- data/lib/neo4j/driver/internal/duration_normalizer.rb +5 -0
- data/lib/neo4j-ruby-driver_loader.rb +0 -1
- data/ruby/neo4j/driver/graph_database.rb +3 -3
- data/ruby/neo4j/driver/internal/async/connection/bolt_protocol_util.rb +1 -1
- data/ruby/neo4j/driver/internal/async/pool/channel.rb +1 -2
- data/ruby/neo4j/driver/internal/driver_factory.rb +2 -2
- data/ruby/neo4j/driver/internal/internal_entity.rb +3 -2
- data/ruby/neo4j/driver/internal/internal_node.rb +2 -2
- data/ruby/neo4j/driver/internal/internal_relationship.rb +7 -6
- data/ruby/neo4j/driver/internal/messaging/bolt_protocol.rb +2 -0
- data/ruby/neo4j/driver/internal/messaging/common/common_value.rb +2 -0
- data/ruby/neo4j/driver/internal/messaging/common/common_value_packer.rb +6 -3
- data/ruby/neo4j/driver/internal/messaging/common/common_value_unpacker.rb +36 -14
- data/ruby/neo4j/driver/internal/messaging/encode/logoff_message_encoder.rb +14 -0
- data/ruby/neo4j/driver/internal/messaging/encode/logon_message_encoder.rb +15 -0
- data/ruby/neo4j/driver/internal/messaging/request/hello_message.rb +1 -2
- data/ruby/neo4j/driver/internal/messaging/request/logoff_message.rb +13 -0
- data/ruby/neo4j/driver/internal/messaging/request/logon_message.rb +13 -0
- data/ruby/neo4j/driver/internal/messaging/request/message_with_metadata.rb +7 -0
- data/ruby/neo4j/driver/internal/messaging/v3/bolt_protocol_v3.rb +2 -2
- data/ruby/neo4j/driver/internal/messaging/v3/message_format_v3.rb +3 -3
- data/ruby/neo4j/driver/internal/messaging/v4/message_format_v4.rb +1 -5
- data/ruby/neo4j/driver/internal/messaging/v43/message_format_v43.rb +1 -5
- data/ruby/neo4j/driver/internal/messaging/v44/message_format_v44.rb +1 -5
- data/ruby/neo4j/driver/internal/messaging/v5/bolt_protocol_v5.rb +21 -0
- data/ruby/neo4j/driver/internal/messaging/v5/message_format_v5.rb +18 -0
- data/ruby/neo4j/driver/internal/messaging/v5/value_unpacker_v5.rb +17 -0
- data/ruby/neo4j/driver/internal/messaging/v51/bolt_protocol_v51.rb +40 -0
- data/ruby/neo4j/driver/internal/messaging/v51/message_format_v51.rb +14 -0
- data/ruby/neo4j/driver/internal/messaging/v51/message_writer_v51.rb +17 -0
- data/ruby/neo4j/driver/version.rb +1 -1
- metadata +30 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71b95e5c46e4972f99faf4ae2022d22080dfc3c1dc9bdefa41f32d673fbbe12d
|
4
|
+
data.tar.gz: 2f835765a09b106233846a5fb6b27b7c4294432ddcf529e97e24a12d95453b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8fdbc3550b26212a79b6a88d8162fb1d3098ae6bf96e421a857a17ea3964fc4baa24a068aaa6876c49b17a19fe1fe2303ccda40cb3c17694ba768f74ac9e7c8
|
7
|
+
data.tar.gz: 553a6511cc8ea7d464d8e3d4e26ccb8eef4611c03ad6c758cac656f623bbd0d27053e4b071194ad8356bfb0fb25286577a18b7168d4c40ffccb4c2158c0c540c
|
@@ -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)
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'active_support/concern'
|
4
4
|
require 'active_support/core_ext/hash/indifferent_access'
|
5
|
-
require 'active_support/core_ext/object/blank'
|
6
5
|
require 'active_support/isolated_execution_state' if Gem::Requirement.create('>= 7').satisfied_by?(Gem.loaded_specs["activesupport"].version) # TODO: this should not be necessary https://github.com/rails/rails/issues/43851
|
7
6
|
require 'active_support/deprecator' if Gem::Requirement.create('>= 7.1').satisfied_by?(Gem.loaded_specs["activesupport"].version)
|
8
7
|
require 'active_support/deprecation'
|
@@ -7,14 +7,14 @@ module Neo4j::Driver
|
|
7
7
|
auto_closable :driver, :routing_driver
|
8
8
|
|
9
9
|
def driver(uri, auth_token = nil, **config)
|
10
|
-
internal_driver(uri, auth_token, config
|
10
|
+
internal_driver(uri, auth_token, config)
|
11
11
|
end
|
12
12
|
|
13
|
-
def internal_driver(uri, auth_token, config,
|
13
|
+
def internal_driver(uri, auth_token, config, &domain_name_resolver)
|
14
14
|
uri = URI(uri)
|
15
15
|
config = Config.new(**config)
|
16
16
|
|
17
|
-
|
17
|
+
Internal::DriverFactory.new(&domain_name_resolver).new_instance(
|
18
18
|
uri,
|
19
19
|
auth_token || AuthTokens.none,
|
20
20
|
config.routing_settings,
|
@@ -9,9 +9,9 @@ module Neo4j::Driver
|
|
9
9
|
DEFAULT_MAX_OUTBOUND_CHUNK_SIZE_BYTES = 2 ** 15 - 1
|
10
10
|
HANDSHAKE = [
|
11
11
|
BOLT_MAGIC_PREAMBLE,
|
12
|
+
Messaging::V5::BoltProtocolV5::VERSION.to_int,
|
12
13
|
Messaging::V44::BoltProtocolV44::VERSION.to_int_range(Messaging::V42::BoltProtocolV42::VERSION),
|
13
14
|
Messaging::V41::BoltProtocolV41::VERSION.to_int,
|
14
|
-
Messaging::V4::BoltProtocolV4::VERSION.to_int,
|
15
15
|
Messaging::V3::BoltProtocolV3::VERSION.to_int]
|
16
16
|
HANDSHAKE_BUF = HANDSHAKE.pack('N*').freeze
|
17
17
|
|
@@ -14,12 +14,11 @@ module Neo4j::Driver
|
|
14
14
|
@stream.write(Connection::BoltProtocolUtil.handshake_buf)
|
15
15
|
@stream.flush
|
16
16
|
Connection::HandshakeHandler.new(logger).decode(self)
|
17
|
-
stream_reader = Connection::StreamReader.new(@stream)
|
18
17
|
stream_writer = Outbound::ChunkAwareByteBufOutput.new(@stream)
|
19
18
|
@message_dispatcher = Inbound::InboundMessageDispatcher.new(self, logger)
|
20
19
|
@attributes[:message_dispatcher] = @message_dispatcher
|
21
20
|
@outbound_handler = Outbound::OutboundMessageHandler.new(stream_writer, message_format, logger)
|
22
|
-
@common_message_reader =
|
21
|
+
@common_message_reader = message_format.new_reader(@stream)
|
23
22
|
connector.initialize_channel(self, protocol)
|
24
23
|
end
|
25
24
|
|
@@ -3,8 +3,8 @@ module Neo4j::Driver::Internal
|
|
3
3
|
include Scheme
|
4
4
|
NO_ROUTING_CONTEXT_ERROR_MESSAGE = "Routing parameters are not supported with scheme 'bolt'. Given URI: "
|
5
5
|
|
6
|
-
def initialize(domain_name_resolver
|
7
|
-
@domain_name_resolver = domain_name_resolver
|
6
|
+
def initialize(&domain_name_resolver)
|
7
|
+
@domain_name_resolver = domain_name_resolver || ->(name) { [name] }
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_instance(uri, auth_token, routing_settings, retry_settings, config, security_plan, event_loop_group = nil)
|
@@ -1,12 +1,13 @@
|
|
1
1
|
module Neo4j::Driver
|
2
2
|
module Internal
|
3
3
|
class InternalEntity
|
4
|
-
attr_reader :id, :properties
|
4
|
+
attr_reader :id, :element_id, :properties
|
5
5
|
delegate :hash, to: :id
|
6
6
|
delegate :[], :size, :key?, :keys, :values, :to_h, to: :properties
|
7
7
|
|
8
|
-
def initialize(id, properties)
|
8
|
+
def initialize(id, element_id, **properties)
|
9
9
|
@id = id
|
10
|
+
@element_id = element_id || id.to_s
|
10
11
|
@properties = properties
|
11
12
|
end
|
12
13
|
|
@@ -4,8 +4,8 @@ module Neo4j::Driver
|
|
4
4
|
class InternalNode < InternalEntity
|
5
5
|
attr_reader :labels
|
6
6
|
|
7
|
-
def initialize(id, *labels, **properties)
|
8
|
-
super(id, properties)
|
7
|
+
def initialize(id, element_id, *labels, **properties)
|
8
|
+
super(id, element_id, **properties)
|
9
9
|
@labels = labels
|
10
10
|
end
|
11
11
|
|
@@ -3,19 +3,20 @@
|
|
3
3
|
module Neo4j::Driver
|
4
4
|
module Internal
|
5
5
|
class InternalRelationship < InternalEntity
|
6
|
-
attr_accessor :start_node_id, :end_node_id
|
6
|
+
attr_accessor :start_node_id, :end_node_id, :start_element_id, :end_element_id
|
7
7
|
attr_reader :type
|
8
8
|
|
9
|
-
def initialize(id, start_node_id, end_node_id, type, **properties)
|
10
|
-
super(id, properties)
|
11
|
-
|
12
|
-
@end_node_id = end_node_id
|
9
|
+
def initialize(id, element_id, start_node_id, start_element_id, end_node_id, end_element_id, type, **properties)
|
10
|
+
super(id, element_id, **properties)
|
11
|
+
set_start_and_end_node_ids(start_node_id, start_element_id, end_node_id, end_element_id)
|
13
12
|
@type = type.to_sym
|
14
13
|
end
|
15
14
|
|
16
|
-
def
|
15
|
+
def set_start_and_end_node_ids(start_node_id, start_element_id, end_node_id, end_element_id)
|
17
16
|
@start_node_id = start_node_id
|
17
|
+
@start_element_id = start_element_id || start_node_id.to_s
|
18
18
|
@end_node_id = end_node_id
|
19
|
+
@end_element_id = end_element_id || end_node_id.to_s
|
19
20
|
end
|
20
21
|
|
21
22
|
def to_s
|
@@ -20,6 +20,8 @@ module Neo4j::Driver
|
|
20
20
|
V43::BoltProtocolV43::INSTANCE
|
21
21
|
when V44::BoltProtocolV44::VERSION
|
22
22
|
V44::BoltProtocolV44::INSTANCE
|
23
|
+
when V5::BoltProtocolV5::VERSION
|
24
|
+
V5::BoltProtocolV5::INSTANCE
|
23
25
|
else
|
24
26
|
raise Exceptions::ClientException, "Unknown protocol version: #{version}"
|
25
27
|
end
|
@@ -13,7 +13,9 @@ module Neo4j::Driver
|
|
13
13
|
LOCAL_DATE_TIME = 'd'
|
14
14
|
LOCAL_DATE_TIME_STRUCT_SIZE = 2
|
15
15
|
DATE_TIME_WITH_ZONE_OFFSET = 'F'
|
16
|
+
DATE_TIME_WITH_ZONE_OFFSET_UTC = 'I'
|
16
17
|
DATE_TIME_WITH_ZONE_ID = 'f'
|
18
|
+
DATE_TIME_WITH_ZONE_ID_UTC = 'i'
|
17
19
|
DATE_TIME_STRUCT_SIZE = 3
|
18
20
|
DURATION = 'E'
|
19
21
|
DURATION_TIME_STRUCT_SIZE = 4
|
@@ -4,6 +4,7 @@ module Neo4j::Driver
|
|
4
4
|
module Common
|
5
5
|
module CommonValuePacker
|
6
6
|
include CommonValue
|
7
|
+
attr_writer :date_time_utc_enabled
|
7
8
|
|
8
9
|
def pack(value)
|
9
10
|
case value
|
@@ -61,18 +62,20 @@ module Neo4j::Driver
|
|
61
62
|
end
|
62
63
|
|
63
64
|
def pack_date_time_with_zone_id(time)
|
64
|
-
pack_struct_header(DATE_TIME_STRUCT_SIZE,
|
65
|
+
pack_struct_header(DATE_TIME_STRUCT_SIZE,
|
66
|
+
@date_time_utc_enabled ? DATE_TIME_WITH_ZONE_ID_UTC : DATE_TIME_WITH_ZONE_ID)
|
65
67
|
pack_date_time(time)
|
66
68
|
pack_string(time.time_zone.tzinfo.identifier)
|
67
69
|
end
|
68
70
|
|
69
71
|
def pack_date_time(time)
|
70
|
-
pack_integer(time.to_i + time.utc_offset)
|
72
|
+
pack_integer(time.to_i + (@date_time_utc_enabled ? 0 : time.utc_offset))
|
71
73
|
pack_integer(time.nsec)
|
72
74
|
end
|
73
75
|
|
74
76
|
def pack_date_time_with_zone_offset(time)
|
75
|
-
pack_struct_header(DATE_TIME_STRUCT_SIZE,
|
77
|
+
pack_struct_header(DATE_TIME_STRUCT_SIZE,
|
78
|
+
@date_time_utc_enabled ? DATE_TIME_WITH_ZONE_OFFSET_UTC : DATE_TIME_WITH_ZONE_OFFSET)
|
76
79
|
pack_date_time(time)
|
77
80
|
pack_utc_offset(time)
|
78
81
|
end
|
@@ -9,6 +9,7 @@ module Neo4j::Driver
|
|
9
9
|
UNBOUND_RELATIONSHIP = 'r'
|
10
10
|
PATH = 'P'
|
11
11
|
NODE_FIELDS = 3
|
12
|
+
RELATIONSHIP_FIELDS = 5
|
12
13
|
|
13
14
|
def unpack_map(size)
|
14
15
|
size.times.to_h { [unpack.to_sym, unpack] }
|
@@ -91,9 +92,15 @@ module Neo4j::Driver
|
|
91
92
|
when DATE_TIME_WITH_ZONE_OFFSET
|
92
93
|
ensure_correct_struct_size(:DATE_TIME_WITH_ZONE_OFFSET, DATE_TIME_STRUCT_SIZE, size)
|
93
94
|
unpack_date_time_with_zone_offset
|
95
|
+
when DATE_TIME_WITH_ZONE_OFFSET_UTC
|
96
|
+
ensure_correct_struct_size(:DATE_TIME_WITH_ZONE_OFFSET_UTC, DATE_TIME_STRUCT_SIZE, size)
|
97
|
+
unpack_date_time_with_zone_offset(true)
|
94
98
|
when DATE_TIME_WITH_ZONE_ID
|
95
99
|
ensure_correct_struct_size(:DATE_TIME_WITH_ZONE_ID, DATE_TIME_STRUCT_SIZE, size)
|
96
100
|
unpack_date_time_with_zone_id
|
101
|
+
when DATE_TIME_WITH_ZONE_ID_UTC
|
102
|
+
ensure_correct_struct_size(:DATE_TIME_WITH_ZONE_ID_UTC, DATE_TIME_STRUCT_SIZE, size)
|
103
|
+
unpack_date_time_with_zone_id(true)
|
97
104
|
when DURATION
|
98
105
|
ensure_correct_struct_size(:DURATION, DURATION_TIME_STRUCT_SIZE, size)
|
99
106
|
unpack_duration
|
@@ -104,13 +111,13 @@ module Neo4j::Driver
|
|
104
111
|
ensure_correct_struct_size(:POINT, POINT_3D_STRUCT_SIZE, size)
|
105
112
|
unpack_point3_d
|
106
113
|
when NODE
|
107
|
-
ensure_correct_struct_size(:NODE,
|
114
|
+
ensure_correct_struct_size(:NODE, node_fields, size)
|
108
115
|
adapted = unpack_node
|
109
116
|
when RELATIONSHIP
|
110
|
-
ensure_correct_struct_size(:RELATIONSHIP,
|
117
|
+
ensure_correct_struct_size(:RELATIONSHIP, relationship_fields, size)
|
111
118
|
unpack_relationship
|
112
119
|
when UNBOUND_RELATIONSHIP
|
113
|
-
ensure_correct_struct_size(:RELATIONSHIP,
|
120
|
+
ensure_correct_struct_size(:RELATIONSHIP, unbound_relationship_fields, size)
|
114
121
|
unpack_unbound_relationship
|
115
122
|
when PATH
|
116
123
|
ensure_correct_struct_size(:PATH, 3, size)
|
@@ -123,15 +130,26 @@ module Neo4j::Driver
|
|
123
130
|
private
|
124
131
|
|
125
132
|
def unpack_relationship
|
126
|
-
|
133
|
+
id = unpack
|
134
|
+
start_node_id = unpack
|
135
|
+
end_node_id = unpack
|
136
|
+
type = unpack
|
137
|
+
properties = unpack
|
138
|
+
InternalRelationship.new(id, unpack_element_id, start_node_id, unpack_element_id, end_node_id, unpack_element_id, type, **properties)
|
127
139
|
end
|
128
140
|
|
129
141
|
def unpack_unbound_relationship
|
130
|
-
|
142
|
+
id = unpack
|
143
|
+
type = unpack
|
144
|
+
properties = unpack
|
145
|
+
InternalRelationship.new(id, unpack_element_id, *[nil] * 4, type, **properties)
|
131
146
|
end
|
132
147
|
|
133
148
|
def unpack_node
|
134
|
-
|
149
|
+
id = unpack
|
150
|
+
labels = unpack.map(&:to_sym)
|
151
|
+
properties = unpack
|
152
|
+
InternalNode.new(id, unpack_element_id, *labels, **properties)
|
135
153
|
end
|
136
154
|
|
137
155
|
def unpack_path
|
@@ -168,7 +186,13 @@ module Neo4j::Driver
|
|
168
186
|
end
|
169
187
|
end
|
170
188
|
|
171
|
-
|
189
|
+
def node_fields = NODE_FIELDS
|
190
|
+
|
191
|
+
def relationship_fields = RELATIONSHIP_FIELDS
|
192
|
+
|
193
|
+
def unbound_relationship_fields = 3
|
194
|
+
|
195
|
+
def unpack_element_id = nil
|
172
196
|
|
173
197
|
def ensure_correct_struct_signature(struct_name, expected, actual)
|
174
198
|
if expected != actual
|
@@ -198,26 +222,24 @@ module Neo4j::Driver
|
|
198
222
|
Types::LocalDateTime.new(Time.at(unpack, unpack, :nsec).utc)
|
199
223
|
end
|
200
224
|
|
201
|
-
def unpack_date_time_with_zone_offset
|
225
|
+
def unpack_date_time_with_zone_offset(utc = false)
|
202
226
|
# Time.at(unpack, unpack, :nsec, in: unpack)
|
203
227
|
sec = unpack
|
204
228
|
nsec = unpack
|
205
229
|
offset = unpack
|
206
230
|
time = Time.at(sec, nsec, :nsec).utc
|
231
|
+
time += offset if utc
|
207
232
|
Time.new(time.year, time.month, time.mday, time.hour, time.min, time.sec + Rational(nsec, 1_000_000_000),
|
208
233
|
offset)
|
209
234
|
end
|
210
235
|
|
211
|
-
def unpack_date_time_with_zone_id
|
236
|
+
def unpack_date_time_with_zone_id(utc = false)
|
212
237
|
time = Time.at(unpack, unpack, :nsec).in_time_zone(TZInfo::Timezone.get(unpack))
|
213
|
-
time - time.utc_offset
|
238
|
+
utc ? time : time - time.utc_offset
|
214
239
|
end
|
215
240
|
|
216
241
|
def unpack_duration
|
217
|
-
|
218
|
-
ActiveSupport::Duration.days(unpack) +
|
219
|
-
ActiveSupport::Duration.seconds(unpack) +
|
220
|
-
ActiveSupport::Duration.seconds(unpack * BigDecimal('1e-9'))
|
242
|
+
DurationNormalizer.create(*4.times.map { unpack })
|
221
243
|
end
|
222
244
|
|
223
245
|
def unpack_point2_d
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Neo4j::Driver
|
2
|
+
module Internal
|
3
|
+
module Messaging
|
4
|
+
module Encode
|
5
|
+
class LogoffMessageEncoder
|
6
|
+
def encode(message, packer)
|
7
|
+
Util::Preconditions.check_argument(message, Request::LogoffMessage)
|
8
|
+
packer.pack_struct_header(0, message.class::SIGNATURE)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Neo4j::Driver
|
2
|
+
module Internal
|
3
|
+
module Messaging
|
4
|
+
module Encode
|
5
|
+
class LogonMessageEncoder
|
6
|
+
def encode(message, packer)
|
7
|
+
Util::Preconditions.check_argument(message, Request::LogonMessage)
|
8
|
+
packer.pack_struct_header(1, message.class::SIGNATURE)
|
9
|
+
packer.pack(message.metadata)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -3,6 +3,13 @@ module Neo4j::Driver
|
|
3
3
|
module Messaging
|
4
4
|
module Request
|
5
5
|
class MessageWithMetadata < Struct.new(:metadata)
|
6
|
+
protected
|
7
|
+
|
8
|
+
def safe_metadata = replace(metadata, Security::InternalAuthToken::CREDENTIALS_KEY, '******')
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def replace(hash, key, value) = hash.key?(key) ? hash.merge(key => value) : hash
|
6
13
|
end
|
7
14
|
end
|
8
15
|
end
|
@@ -21,11 +21,11 @@ module Neo4j::Driver
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def prepare_to_close_channel(channel)
|
24
|
-
message_dispatcher =
|
24
|
+
message_dispatcher = channel.message_dispatcher
|
25
25
|
|
26
26
|
message = Request::GoodbyeMessage::GOODBYE
|
27
27
|
message_dispatcher.enqueue(Handlers::NoOpResponseHandler::INSTANCE)
|
28
|
-
channel.write_and_flush(message
|
28
|
+
channel.write_and_flush(message)
|
29
29
|
|
30
30
|
message_dispatcher.prepare_to_close_channel
|
31
31
|
end
|
@@ -7,9 +7,9 @@ module Neo4j::Driver
|
|
7
7
|
MessageWriterV3.new(output)
|
8
8
|
end
|
9
9
|
|
10
|
-
def new_reader(input)
|
11
|
-
|
12
|
-
|
10
|
+
def new_reader(input) = Common::CommonMessageReader.new(new_value_unpacker(input))
|
11
|
+
|
12
|
+
def new_value_unpacker(input) = Async::Connection::StreamReader.new(input)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -2,14 +2,10 @@ module Neo4j::Driver
|
|
2
2
|
module Internal
|
3
3
|
module Messaging
|
4
4
|
module V4
|
5
|
-
class MessageFormatV4
|
5
|
+
class MessageFormatV4 < V3::MessageFormatV3
|
6
6
|
def new_writer(output)
|
7
7
|
MessageWriterV4.new(output)
|
8
8
|
end
|
9
|
-
|
10
|
-
def new_reader(input)
|
11
|
-
Common::CommonMessageReader.new(input)
|
12
|
-
end
|
13
9
|
end
|
14
10
|
end
|
15
11
|
end
|
@@ -3,14 +3,10 @@ module Neo4j::Driver
|
|
3
3
|
module Messaging
|
4
4
|
module V43
|
5
5
|
# Bolt message format v4.3
|
6
|
-
class MessageFormatV43
|
6
|
+
class MessageFormatV43 < V4::MessageFormatV4
|
7
7
|
def new_writer(output)
|
8
8
|
MessageWriterV43.new(output)
|
9
9
|
end
|
10
|
-
|
11
|
-
def new_reader(input)
|
12
|
-
Common::CommonMessageReader.new(input)
|
13
|
-
end
|
14
10
|
end
|
15
11
|
end
|
16
12
|
end
|
@@ -3,14 +3,10 @@ module Neo4j::Driver
|
|
3
3
|
module Messaging
|
4
4
|
module V44
|
5
5
|
# Bolt message format v4.4
|
6
|
-
class MessageFormatV44
|
6
|
+
class MessageFormatV44 < V43::MessageFormatV43
|
7
7
|
def new_writer(output)
|
8
8
|
MessageWriterV44.new(output)
|
9
9
|
end
|
10
|
-
|
11
|
-
def new_reader(input)
|
12
|
-
CommonMessageReader.new(input)
|
13
|
-
end
|
14
10
|
end
|
15
11
|
end
|
16
12
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Neo4j::Driver
|
2
|
+
module Internal
|
3
|
+
module Messaging
|
4
|
+
module V5
|
5
|
+
# Definition of the Bolt Protocol 5.0
|
6
|
+
class BoltProtocolV5 < V44::BoltProtocolV44
|
7
|
+
VERSION = BoltProtocolVersion.new(5, 0)
|
8
|
+
INSTANCE = new
|
9
|
+
|
10
|
+
def create_message_format
|
11
|
+
MessageFormatV5.new
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
def include_date_time_utc_patch_in_hello = false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Neo4j::Driver
|
2
|
+
module Internal
|
3
|
+
module Messaging
|
4
|
+
module V5
|
5
|
+
# Bolt message format v5.0
|
6
|
+
class MessageFormatV5 < V44::MessageFormatV44
|
7
|
+
def new_writer(output)
|
8
|
+
output.date_time_utc_enabled = true
|
9
|
+
super
|
10
|
+
end
|
11
|
+
def new_value_unpacker(input)
|
12
|
+
ValueUnpackerV5.new(input)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Neo4j::Driver
|
2
|
+
module Internal
|
3
|
+
module Messaging
|
4
|
+
module V5
|
5
|
+
class ValueUnpackerV5 < Async::Connection::StreamReader
|
6
|
+
alias unpack_element_id unpack
|
7
|
+
|
8
|
+
def node_fields = 4
|
9
|
+
|
10
|
+
def relationship_fields = 8
|
11
|
+
|
12
|
+
def unbound_relationship_fields = 4
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Neo4j::Driver
|
2
|
+
module Internal
|
3
|
+
module Messaging
|
4
|
+
module V51
|
5
|
+
class BoltProtocolV51 < V5::BoltProtocolV5
|
6
|
+
VERSION = BoltProtocolVersion.new(5, 1)
|
7
|
+
INSTANCE = new
|
8
|
+
|
9
|
+
def create_message_format
|
10
|
+
MessageFormatV51.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize_channel(channel, user_agent, auth_token, routing_context)
|
14
|
+
message = Request::HelloMessage.new(user_agent, {},
|
15
|
+
(routing_context.to_h if routing_context.server_routing_enabled?))
|
16
|
+
handler = Handlers::HelloV51ResponseHandler.new(channel, VERSION)
|
17
|
+
|
18
|
+
channel.message_dispatcher.enqueue(handler)
|
19
|
+
channel.write(message)
|
20
|
+
message = Request::LogonMessage(auth_token)
|
21
|
+
channel.message_dispatcher.enqueue(LogonResponseHandle.new(channel, auth_token))
|
22
|
+
channel.write_and_flush(message)
|
23
|
+
end
|
24
|
+
|
25
|
+
def logoff
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def logon
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def version
|
34
|
+
self.class::VERSION
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Neo4j::Driver
|
2
|
+
module Internal
|
3
|
+
module Messaging
|
4
|
+
module V51
|
5
|
+
class MessageWriterV51 < V44::MessageWriterV44
|
6
|
+
private
|
7
|
+
|
8
|
+
def build_encoders
|
9
|
+
super.merge(
|
10
|
+
LogonMessage.SIGNATURE => Encode::LogonMessageEncoder,
|
11
|
+
LogoffMessage.SIGNATURE => Encode::LogoffMessageEncoder)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-ruby-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.7.0.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heinrich Klobuczek
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-13 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activesupport
|
@@ -16,14 +15,14 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
18
|
+
version: '7.1'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
25
|
+
version: '7.1'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: zeitwerk
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +79,20 @@ dependencies:
|
|
80
79
|
- - ">="
|
81
80
|
- !ruby/object:Gem::Version
|
82
81
|
version: '0'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: csv
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :runtime
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
83
96
|
- !ruby/object:Gem::Dependency
|
84
97
|
name: ffaker
|
85
98
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,6 +244,7 @@ files:
|
|
231
244
|
- lib/neo4j/driver/exceptions/token_expired_exception.rb
|
232
245
|
- lib/neo4j/driver/exceptions/transaction_nesting_exception.rb
|
233
246
|
- lib/neo4j/driver/exceptions/transient_exception.rb
|
247
|
+
- lib/neo4j/driver/exceptions/unsupported_feature_exception.rb
|
234
248
|
- lib/neo4j/driver/exceptions/untrusted_server_exception.rb
|
235
249
|
- lib/neo4j/driver/exceptions/value/lossy_coercion.rb
|
236
250
|
- lib/neo4j/driver/exceptions/value/not_multi_valued.rb
|
@@ -379,6 +393,8 @@ files:
|
|
379
393
|
- ruby/neo4j/driver/internal/messaging/encode/goodbye_message_encoder.rb
|
380
394
|
- ruby/neo4j/driver/internal/messaging/encode/hello_message_encoder.rb
|
381
395
|
- ruby/neo4j/driver/internal/messaging/encode/init_message_encoder.rb
|
396
|
+
- ruby/neo4j/driver/internal/messaging/encode/logoff_message_encoder.rb
|
397
|
+
- ruby/neo4j/driver/internal/messaging/encode/logon_message_encoder.rb
|
382
398
|
- ruby/neo4j/driver/internal/messaging/encode/pull_all_message_encoder.rb
|
383
399
|
- ruby/neo4j/driver/internal/messaging/encode/pull_message_encoder.rb
|
384
400
|
- ruby/neo4j/driver/internal/messaging/encode/reset_message_encoder.rb
|
@@ -395,6 +411,8 @@ files:
|
|
395
411
|
- ruby/neo4j/driver/internal/messaging/request/goodbye_message.rb
|
396
412
|
- ruby/neo4j/driver/internal/messaging/request/hello_message.rb
|
397
413
|
- ruby/neo4j/driver/internal/messaging/request/init_message.rb
|
414
|
+
- ruby/neo4j/driver/internal/messaging/request/logoff_message.rb
|
415
|
+
- ruby/neo4j/driver/internal/messaging/request/logon_message.rb
|
398
416
|
- ruby/neo4j/driver/internal/messaging/request/message_with_metadata.rb
|
399
417
|
- ruby/neo4j/driver/internal/messaging/request/multi_database_util.rb
|
400
418
|
- ruby/neo4j/driver/internal/messaging/request/pull_all_message.rb
|
@@ -423,6 +441,12 @@ files:
|
|
423
441
|
- ruby/neo4j/driver/internal/messaging/v44/bolt_protocol_v44.rb
|
424
442
|
- ruby/neo4j/driver/internal/messaging/v44/message_format_v44.rb
|
425
443
|
- ruby/neo4j/driver/internal/messaging/v44/message_writer_v44.rb
|
444
|
+
- ruby/neo4j/driver/internal/messaging/v5/bolt_protocol_v5.rb
|
445
|
+
- ruby/neo4j/driver/internal/messaging/v5/message_format_v5.rb
|
446
|
+
- ruby/neo4j/driver/internal/messaging/v5/value_unpacker_v5.rb
|
447
|
+
- ruby/neo4j/driver/internal/messaging/v51/bolt_protocol_v51.rb
|
448
|
+
- ruby/neo4j/driver/internal/messaging/v51/message_format_v51.rb
|
449
|
+
- ruby/neo4j/driver/internal/messaging/v51/message_writer_v51.rb
|
426
450
|
- ruby/neo4j/driver/internal/metrics/connection_pool_metrics_listener.rb
|
427
451
|
- ruby/neo4j/driver/internal/metrics/internal_abstract_metrics.rb
|
428
452
|
- ruby/neo4j/driver/internal/metrics/internal_connection_pool_metrics.rb
|
@@ -483,7 +507,6 @@ licenses:
|
|
483
507
|
- MIT
|
484
508
|
metadata:
|
485
509
|
homepage_uri: https://github.com/neo4jrb/neo4j-ruby-driver
|
486
|
-
post_install_message:
|
487
510
|
rdoc_options:
|
488
511
|
- "--main"
|
489
512
|
- README.md
|
@@ -501,8 +524,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
501
524
|
- !ruby/object:Gem::Version
|
502
525
|
version: '0'
|
503
526
|
requirements: []
|
504
|
-
rubygems_version: 3.
|
505
|
-
signing_key:
|
527
|
+
rubygems_version: 3.6.2
|
506
528
|
specification_version: 4
|
507
529
|
summary: ''
|
508
530
|
test_files: []
|