neo4j-ruby-driver 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -6
- data/ffi/neo4j/driver.rb +2 -0
- data/ffi/neo4j/driver/internal/async/direct_connection.rb +17 -0
- data/ffi/neo4j/driver/internal/internal_record.rb +1 -1
- data/ffi/neo4j/driver/internal/network_session.rb +14 -10
- data/lib/neo4j/driver/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c42b006e007156e7b426bd813fc8d13367c1a66931f7047268bf1b667a3a8b72
|
4
|
+
data.tar.gz: 7bad351ef37ace5c080db834502ebfc2de2f7a5e6a49171ff99a6069bce0b6f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3a392ed29054071570b452ff3485a03da001054fc6c8bbc23447ad20d6e408c41632c1b3d257cbf0d92ed3117bebfdb24949767e31f68a4c5bcf3e070daab9b
|
7
|
+
data.tar.gz: 76cdc83a140b7d365c45cada9bb23b715ee729b92ffdfa772274f97679450b9f799f15d391e96de5b75ea717575dac48268abb33bf39035f5859ffcc4aa74997
|
data/README.md
CHANGED
@@ -72,12 +72,11 @@ FFI based same as above but with driver variable set:
|
|
72
72
|
To run the tests the following tools need to be installed:
|
73
73
|
|
74
74
|
$ brew install python
|
75
|
-
$
|
76
|
-
$
|
77
|
-
$ neoctrl-
|
78
|
-
$ neoctrl-
|
79
|
-
$ neoctrl-
|
80
|
-
$ neoctrl-start servers/neo4j-enterprise-4.0.0
|
75
|
+
$ pip3 install --user git+https://github.com/klobuczek/boltkit@1.3#egg=boltkit
|
76
|
+
$ neoctrl-install -e 4.0.2 servers
|
77
|
+
$ neoctrl-configure servers/neo4j-enterprise-4.0.2 dbms.directories.import= dbms.default_listen_address=::
|
78
|
+
$ neoctrl-set-initial-password password servers/neo4j-enterprise-4.0.2
|
79
|
+
$ neoctrl-start servers/neo4j-enterprise-4.0.2
|
81
80
|
|
82
81
|
## Contributing
|
83
82
|
|
data/ffi/neo4j/driver.rb
CHANGED
@@ -30,6 +30,7 @@ module Neo4j
|
|
30
30
|
)
|
31
31
|
end
|
32
32
|
set_bookmarks(:set_run_bookmarks, boomarks_holder.bookmarks)
|
33
|
+
set_config(:set_run, config)
|
33
34
|
register(run_handler, Bolt::Connection.load_run_request(bolt_connection))
|
34
35
|
register(pull_handler, Bolt::Connection.load_pull_request(bolt_connection, -1))
|
35
36
|
flush
|
@@ -42,6 +43,7 @@ module Neo4j
|
|
42
43
|
def begin(bookmarks, config, begin_handler)
|
43
44
|
check_error Bolt::Connection.clear_begin(bolt_connection)
|
44
45
|
set_bookmarks(:set_begin_bookmarks, bookmarks)
|
46
|
+
set_config(:set_begin, config)
|
45
47
|
register(begin_handler, Bolt::Connection.load_begin_request(bolt_connection))
|
46
48
|
end
|
47
49
|
|
@@ -82,6 +84,21 @@ module Neo4j
|
|
82
84
|
Value::ValueAdapter.to_neo(value, bookmarks)
|
83
85
|
check_error Bolt::Connection.send(method, bolt_connection, value)
|
84
86
|
end
|
87
|
+
|
88
|
+
def set_config(method_prefix, config)
|
89
|
+
return unless config
|
90
|
+
config.each do |key, value|
|
91
|
+
case key
|
92
|
+
when :timeout
|
93
|
+
check_error Bolt::Connection.send("#{method_prefix}_tx_timeout", bolt_connection,
|
94
|
+
DurationNormalizer.milliseconds(value))
|
95
|
+
when :metadata
|
96
|
+
bolt_value = Bolt::Value.create
|
97
|
+
Value::ValueAdapter.to_neo(bolt_value, value)
|
98
|
+
check_error Bolt::Connection.send("#{method_prefix}_tx_metadata", bolt_connection, bolt_value)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
85
102
|
end
|
86
103
|
end
|
87
104
|
end
|
@@ -18,7 +18,7 @@ module Neo4j
|
|
18
18
|
@retry_logic = retry_logic
|
19
19
|
end
|
20
20
|
|
21
|
-
def run(statement, parameters = {}, config =
|
21
|
+
def run(statement, parameters = {}, config = {})
|
22
22
|
ensure_session_is_open
|
23
23
|
ensure_no_open_tx_before_running_query
|
24
24
|
acquire_connection(@mode)
|
@@ -27,11 +27,11 @@ module Neo4j
|
|
27
27
|
)
|
28
28
|
end
|
29
29
|
|
30
|
-
def read_transaction(config
|
30
|
+
def read_transaction(**config, &block)
|
31
31
|
transaction(Neo4j::Driver::AccessMode::READ, config, &block)
|
32
32
|
end
|
33
33
|
|
34
|
-
def write_transaction(config
|
34
|
+
def write_transaction(**config, &block)
|
35
35
|
transaction(Neo4j::Driver::AccessMode::WRITE, config, &block)
|
36
36
|
end
|
37
37
|
|
@@ -49,11 +49,8 @@ module Neo4j
|
|
49
49
|
@connection&.release
|
50
50
|
end
|
51
51
|
|
52
|
-
def begin_transaction(
|
53
|
-
|
54
|
-
ensure_no_open_tx_before_starting_tx
|
55
|
-
acquire_connection(mode)
|
56
|
-
@transaction = ExplicitTransaction.new(@connection, self).begin(bookmarks, config)
|
52
|
+
def begin_transaction(**config)
|
53
|
+
private_begin_transaction(@mode, config)
|
57
54
|
end
|
58
55
|
|
59
56
|
def last_bookmark
|
@@ -66,9 +63,16 @@ module Neo4j
|
|
66
63
|
|
67
64
|
private
|
68
65
|
|
69
|
-
def
|
66
|
+
def private_begin_transaction(mode, config)
|
67
|
+
ensure_session_is_open
|
68
|
+
ensure_no_open_tx_before_starting_tx
|
69
|
+
acquire_connection(mode)
|
70
|
+
@transaction = ExplicitTransaction.new(@connection, self).begin(bookmarks, config)
|
71
|
+
end
|
72
|
+
|
73
|
+
def transaction(mode, config)
|
70
74
|
@retry_logic.retry do
|
71
|
-
tx =
|
75
|
+
tx = private_begin_transaction(mode, config)
|
72
76
|
result = yield tx
|
73
77
|
tx.success
|
74
78
|
result
|
data/lib/neo4j/driver/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heinrich Klobuczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|