neo4j_bolt 0.3.0 → 0.4.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: 316d22f20084bb29755e8693c25860bd4d3afa5e5aadce5b89e415bf53157b82
4
- data.tar.gz: 405c68b29be5578f7859cdc973b956ccb9898a4b7d105cc19b0e31e81c5615b3
3
+ metadata.gz: 8c587989e6936680692675035dada5d220122cc81655f2607b97e72b4725b23b
4
+ data.tar.gz: 6bedef9539b66644474e2d657b1e4454918a7bfe4a7db73cdfc626fb9b150426
5
5
  SHA512:
6
- metadata.gz: 94766bfe86f3487582229ed0d11fa4c2bc813adac23fe1065c5dc026c692e3b82c859978b08d5dfb78915382d224425b7e7f81eb06f620eebb23014d8e4934b9
7
- data.tar.gz: e144730f9cb75b44450c0dfb3b56d76698c9839e1f54a375c4e7608cb6eb7d6cf70d1544a7065a78d08c4d813387da66ec758bc1749d24037899233c80feb3d7
6
+ metadata.gz: 9640636068e101464e9a92e0ca38e465bc3c847863b457d90ae3e5361c37960359e7fd9c24ec8915f1ad27f90311b0867b95973801e28a17939f2bf70b3bad75
7
+ data.tar.gz: ed3142cd503626d3ba4d04ea86a708426178a070513c14325e46bac405bfa384250f8978d12cf6eb72920bb35ec7170cbb3ecd90500de121f6c650279387313e
data/README.md CHANGED
@@ -1,196 +1,244 @@
1
1
  # Neo4jBolt
2
2
 
3
- A Neo4j/Bolt driver written in pure Ruby. **Currently only supporting Neo4j 4.4 with Bolt 4.4.** Contains a CLI tool which can dump databases, load database dumps, and visualize database contents.
4
-
5
- Caution: This gem is not feature complete regarding Neo4j and Bolt. Nevertheless, it is used successfully in production – make sure it supports the features you need.
6
-
7
- - PackStream:
8
- - data types:
9
- - supported: Null, Boolean, Integer, Float, String, List, Dictionary, Structure
10
- - not supported: Bytes
11
- - structures:
12
- - supported: Node, Relationship
13
- - not supported: UnboundRelationship, Path, Date, Time, LocalTime, DateTime, DateTimeZoneId, LocalDateTime, Duration, Point2D, Point3D
14
- - Bolt Protocol:
15
- - supported: transactions
16
- - not supported:
17
- - auto transactions (all transactions are explicit in Neo4jBolt)
18
- - routing
19
- - interrupt
3
+ Neo4jBolt 0.4 is a small compatibility and convenience layer for Ruby applications, backed by [neo4j-ruby-driver](https://github.com/neo4jrb/neo4j-ruby-driver). It preserves the straightforward `Neo4jBolt` application API while delegating connections, pooling, Bolt negotiation, protocol state, PackStream, reconnects, and modern Neo4j value support to the upstream driver.
4
+
5
+ Neo4jBolt no longer implements the Bolt wire protocol itself.
6
+
7
+ `0.4.0` requires Ruby 3.4 or newer and pins `neo4j-ruby-driver` to `6.2.1.beta.4`. Applications on older Rubies can remain on the Neo4jBolt 0.3.x line; this prerelease is intentionally not an automatic upgrade for them.
20
8
 
21
9
  ## Installation
22
10
 
23
- Add this line to your application's Gemfile:
11
+ For this prerelease, specify the version explicitly:
24
12
 
25
13
  ```ruby
26
- gem 'neo4j_bolt'
14
+ gem "neo4j_bolt", "0.4.0"
27
15
  ```
28
16
 
29
- And then execute:
30
-
31
- $ bundle install
17
+ Then run `bundle install`. A running Neo4j database is required.
32
18
 
33
- Or install it yourself as:
19
+ ## Connecting
34
20
 
35
- $ gem install neo4j_bolt
21
+ The existing host, port, and verbosity settings remain available:
36
22
 
37
- In order to use this gem, you need a running Neo4j database. Chances are you already have a Neo4j database running if you're reading this. Otherwise, you can start one via Docker using the following command:
38
-
39
- ```
40
- docker run --rm --env NEO4J_AUTH=none --publish 7687:7687 neo4j:4.4-community
23
+ ```ruby
24
+ Neo4jBolt.bolt_host = "localhost"
25
+ Neo4jBolt.bolt_port = 7687
26
+ Neo4jBolt.bolt_verbosity = 0
41
27
  ```
42
28
 
43
- If you want the Browser interface at http://localhost:7474/, additionaly specify `--publish 7474:7474`.
44
-
45
- ## Connecting to a Neo4j database
46
-
47
- Specify your Bolt host and port (if you omit this it will be localhost:7687 by default):
29
+ Applications can include the module as before:
48
30
 
49
31
  ```ruby
50
- Neo4jBolt.bolt_host = 'localhost'
51
- Neo4jBolt.bolt_port = 7687
32
+ include Neo4jBolt
52
33
  ```
53
34
 
54
- Use `Neo4jBolt::cleanup_neo4j` to disconnect (this is important when running a web app it might be a good idea to close a socket once we're done with it so we don't run out of available ports).
35
+ They can also extend another object or call the convenience methods directly on `Neo4jBolt`.
36
+
37
+ One lazily initialized upstream driver owns a thread-safe connection pool. Each standalone query uses a short-lived session and returns its connection to that pool after its result has been consumed. Queries from several Puma threads are not globally serialized.
38
+
39
+ `cleanup_neo4j` safely retires the driver and its pool after active operations finish. A later query creates a new driver. Do not call cleanup from inside an active query or transaction on the same thread.
55
40
 
56
41
  ## Running queries
57
42
 
58
- Use `neo4j_query` to run a query and receive all results:
43
+ Materialize all result rows:
59
44
 
60
45
  ```ruby
61
- entries = neo4j_query("MATCH (n) RETURN n;")
46
+ rows = neo4j_query("MATCH (person:Person) RETURN person.name AS name")
47
+ puts rows.first["name"]
62
48
  ```
63
- Alternatively, specify a block to make use of Neo4j's streaming capabilities and receive entries one by one:
49
+
50
+ Or process records incrementally without first materializing the complete result:
64
51
 
65
52
  ```ruby
66
- neo4j_query("MATCH (n) RETURN n;") do |entry|
67
- # handle entry here
53
+ neo4j_query("MATCH (person:Person) RETURN person") do |row|
54
+ puts row["person"][:name]
68
55
  end
69
56
  ```
70
57
 
71
- Using streaming avoids memory hog since it prevents having to read all entries into memory before handling them. Nodes are returned as `Neo4jBolt::Node`, relationships as `Neo4jBolt::Relationship`. Both are subclasses of `Hash`, providing access to all properties plus a few extra details:
58
+ The block form returns `nil`. Its upstream session, result, and pooled connection remain alive for the duration of iteration.
72
59
 
73
- - `Neo4jBolt::Node` attributes: `id`, `labels`
74
- - `Neo4jBolt::Relationship` attributes: `id`, `start_node_id`, `end_node_id`, `type`
60
+ Parameters stay separate from Cypher:
75
61
 
76
62
  ```ruby
77
- node = neo4j_query_expect_one("CREATE (n:Node {a: 1, b: 2}) RETURN n;")['n']
78
- # All nodes returned from Neo4j are a Neo4jBolt::Node
79
- # It's a subclass of Hash and it stores all the node's
80
- # properties plus two attributes called id and labels:
81
- puts node.id
82
- puts node.labels
83
- puts node.keys
84
- node.each_pair { |k, v| puts "#{k}: #{v}" }
85
- puts node.to_json
86
- puts "a: #{node[:a]}"
63
+ row = neo4j_query_expect_one(
64
+ "MATCH (person:Person {email: $email}) RETURN person",
65
+ email: "ada@example.test"
66
+ )
87
67
  ```
88
68
 
89
- While values returned by Neo4j can be accesses via string keys (`['n']` in the example above), property keys of nodes and relationships are converted to symbols (`node[:a]`).
69
+ `neo4j_query_expect_one` raises `Neo4jBolt::ExpectedOneResultError` unless the query produces exactly one row.
70
+
71
+ ### Result compatibility
72
+
73
+ Result-row keys are strings:
74
+
75
+ ```ruby
76
+ row["person"]
77
+ ```
90
78
 
91
- Use `neo4j_query_expect_one` if you want to make sure there's exactly one entry to be returned:
79
+ Nodes and relationships remain Hash subclasses whose property keys are symbols:
92
80
 
93
81
  ```ruby
94
- node = neo4j_query_expect_one("MATCH (n) RETURN n LIMIT 1;")['n']
82
+ node = row["person"]
83
+ node[:name]
84
+ node.id
85
+ node.labels
86
+ node.element_id
95
87
  ```
96
88
 
97
- If there's zero, two, or more results, this will raise a `ExpectedOneResultError`.
89
+ `Neo4jBolt::Node` preserves `id` and `labels` and additively exposes `element_id`.
90
+
91
+ `Neo4jBolt::Relationship` preserves `id`, `start_node_id`, `end_node_id`, and `type`, and additively exposes `element_id`, `start_node_element_id`, and `end_node_element_id`.
92
+
93
+ Arrays and maps are adapted recursively. Map/property keys inside values are symbols, matching Neo4jBolt 0.3 behavior. Modern upstream values that 0.3 could not represent—such as temporal, spatial, path, byte, duration, and UUID values—pass through as upstream value objects. This is additive support.
94
+
95
+ Signed 64-bit integer limits are checked before transport. Out-of-range integers raise `Neo4jBolt::IntegerOutOfRangeError`.
98
96
 
99
- ## Using transactions
97
+ ## Transactions
100
98
 
101
- Any Neo4j query will run in its own transaction by default. If you want to group multiple queries into a transaction to make sure they either succeed completely or fail completely, use `transaction` like this:
99
+ The convenient compatibility API is unchanged:
102
100
 
103
101
  ```ruby
104
102
  transaction do
105
- neo4j_query("CREATE (n:Node {a: 1});")
106
- neo4j_query("CREATE (n:Node {b: 1});")
103
+ neo4j_query("CREATE (:Person {name: 'Ada'})")
104
+ neo4j_query("CREATE (:Person {name: 'Grace'})")
107
105
  end
108
106
  ```
109
107
 
110
- Transactions can be nested, with the inner transactions doing nothing and the outermost transaction being committed unless something goes wrong in which case the outermost transaction gets rolled back. No matter how often you nest transactions, there's only one transaction from the perspective of Neo4j.
108
+ Nested `transaction` blocks reuse one actual upstream session and transaction. Applications do not receive or pass an upstream transaction object.
111
109
 
112
- ## Setting up constraints and indexes
110
+ Transaction context is isolated by calling thread and by the object using `Neo4jBolt`. Two threads using the same object receive independent upstream transactions and pooled connections.
113
111
 
114
- Use `setup_constraints_and_indexes` like this:
112
+ Transactions are rollback-only after any nested operation raises, even if application code rescues the exception later. This includes database failures and `ExpectedOneResultError`:
115
113
 
116
114
  ```ruby
117
- CONSTRAINTS_LIST = ['User/email', 'Session/sid']
118
- INDEX_LIST = ['Session/expires']
119
- setup_constraints_and_indexes(CONSTRAINTS_LIST, INDEX_LIST)
115
+ transaction do
116
+ neo4j_query("CREATE (:Marker)")
117
+
118
+ begin
119
+ neo4j_query("invalid cypher")
120
+ rescue Neo4jBolt::SyntaxError
121
+ end
122
+ end
123
+ # Nothing is committed.
120
124
  ```
121
125
 
122
- This setup up two uniqueness constraints and one index:
123
- - the `email` property of all nodes with label `User` must be unique
124
- - the `sid` property of all nodes with label `Session` must be unique
125
- - the `expires` property of all nodes with label `Session` gets indexed for faster lookup
126
+ Calling `rollback` inside a transaction marks that outer transaction rollback-only and returns `nil`. Calling it outside a transaction raises `Neo4jBolt::Error`; the old 0.3 implementation exposed the method but accidentally delegated to a nonexistent private implementation.
126
127
 
127
- Neo4jBolt prefixes all constraints and indexes declared this way with `neo4j_bolt_` and it will remove all such entries previously declared (as detected by the prefix) and not passed to `setup_constraints_and_indexes`. That way, constraints and indexes can be added and removed.
128
+ Upstream server/driver failures are translated to `Neo4jBolt::Error`. Syntax and uniqueness-constraint failures are translated narrowly to `Neo4jBolt::SyntaxError` and `Neo4jBolt::ConstraintValidationFailedError`. The upstream exception remains available as `error.cause`.
128
129
 
129
- Neo4jBolt does not currently support putting constraints on relationships or declaring indexes on relationships or combining several properties into one uniqueness constraint. You are, however, free to declare these constraints and indexes via Cypher yourself.
130
+ ## Constraints and indexes
130
131
 
131
- ## Housekeeping and inspection
132
+ The existing setup format remains supported:
132
133
 
133
- Use the `neo4j_bolt` command line tool to perform various tasks regarding your database:
134
+ ```ruby
135
+ setup_constraints_and_indexes(
136
+ ["User/email", "Session/sid"],
137
+ ["Session/expires"]
138
+ )
139
+ ```
134
140
 
135
- | Command | Description |
136
- | ------- | ----------- |
137
- | `neo4j_bolt console` | launch Pry console with Neo4jBolt |
138
- | `neo4j_bolt clear` | remove all nodes and relationships, needs `--srsly` argument |
139
- | `neo4j_bolt dump` | dump database contents |
140
- | `neo4j_bolt load` | load database dump |
141
- | `neo4j_bolt index ls` | list all database constraints and indexes |
142
- | `neo4j_bolt index rm` | remove all constraints and indexes, needs `-f` |
143
- | `neo4j_bolt visualize` | generates a visual representation of the current datbase contents |
141
+ Managed entries retain the `neo4j_bolt_` prefix. Setup removes obsolete entries with that prefix only; it does not remove arbitrary application-defined indexes or constraints.
144
142
 
145
- Specify you Neo4j host and port using `--host` if your database is not running on localhost:7687.
143
+ ## Dump and load
146
144
 
147
- ### Dump database contents
145
+ The textual format is unchanged:
148
146
 
149
- When you dump a database, output will go to `/dev/stdout` by default, but it can be redirected to any file via `--out-file`. In the export, node IDs start at 0, regardless of the actual node IDs in the database, and start node / end node IDs in the relationship dumps are adjusted accodingly. Don't rely on actual node IDs within your database, as they may change during export and import. Relationship IDs are omitted in the export.
147
+ ```text
148
+ n {"id":0,"labels":["Person"],"properties":{"name":"Ada"}}
149
+ n {"id":1,"labels":["Person"],"properties":{"name":"Grace"}}
150
+ r {"from":0,"to":1,"type":"KNOWS","properties":{"since":2024}}
151
+ ```
150
152
 
151
- ### Load database dump
153
+ ```ruby
154
+ File.open("database.dump", "w") { |io| dump_database(io, progress_io: $stderr) }
155
+ File.open("database.dump", "r") do |io|
156
+ load_database_dump(io, progress_io: $stderr)
157
+ end
158
+ ```
152
159
 
153
- A database dump can only be loaded if the database is empty. Otherwise, you'll have to specify `--force`.
160
+ Passing `progress_io:` is optional for the Ruby API. The CLI always reports dump/load progress on stderr, so dump data written to stdout remains safe to redirect or pipe. Terminal progress is updated in place; redirected stderr receives periodic progress lines.
154
161
 
155
- ### List constraints and indexes
162
+ The `0, 1, 2, ...` IDs are synthetic dump-local IDs. Database-internal IDs and element IDs are never written to the persistent format. Dumping keeps the count, node, and relationship reads in one transaction, so the driver-provided entity identity used to connect the two streamed result sets stays within Neo4j's transaction-scoped identity guarantee. To keep dump numbering deterministic, ordering uses `elementId()` on modern Neo4j and an internal `id()` fallback only on Neo4j 4.4, where `elementId()` does not exist. Old Neo4jBolt dumps remain loadable.
156
163
 
157
- Use the command `neo4j_bolt index ls` to see which constraints and indexes are currently active in the database.
164
+ For relational loads, the adapter assigns a random temporary label and dump-ID property to imported nodes. After the nodes are committed it builds a temporary `neo4j_bolt_` index on that property, uses indexed lookups while creating relationships, drops the index, and removes the temporary metadata in batches. No database-internal identity is carried from one load transaction to another. Loading a relational dump therefore requires permission to create and drop an index.
158
165
 
159
- ### Remove all constraints and indexes
166
+ Loads start with batches of 5,000 records by default. This is an initial ceiling rather than a claimed optimum: if Neo4j returns a transaction-memory/resource error whose server semantics guarantee rollback, the loader halves the failed batch and retries it, then keeps the smaller size for the rest of that phase. Node and relationship phases adapt independently. Other errors are not retried, because a generic connection failure cannot safely prove that a `CREATE` transaction did not commit. Callers can change the initial ceiling with `initial_batch_size:`; the CLI exposes the same setting as `--batch-size`.
160
167
 
161
- Use the command `neo4j_bolt index rm -f` to remove all constraints and indexes in the database but make sure you know what you're doing.
168
+ Loading requires an empty database unless `force_append: true` is passed. `load_database_dump` owns its batch transactions and therefore rejects being called from inside `transaction`.
162
169
 
163
- ### Visualize database contents
170
+ ## CLI
164
171
 
165
- Use the command `neo4j_bolt visualize` to obtain a GraphViz-formatted document suitable for piping into `dot`:
172
+ The `neo4j_bolt` executable retains these commands:
166
173
 
167
- ```bash
168
- ./bin/neo4j_bolt visualize | dot -Tsvg > graph.svg
169
- ```
174
+ | Command | Purpose |
175
+ | --- | --- |
176
+ | `neo4j_bolt console` | Open an IRB console with Neo4jBolt loaded |
177
+ | `neo4j_bolt clear --srsly` | Delete all nodes and relationships |
178
+ | `neo4j_bolt dump` | Write the textual database dump |
179
+ | `neo4j_bolt load [--force] [--batch-size N] PATH` | Load a textual dump |
180
+ | `neo4j_bolt index ls` | List constraints and indexes |
181
+ | `neo4j_bolt index rm --force` | Remove all constraints and indexes |
182
+ | `neo4j_bolt visualize` | Generate a GraphViz document |
170
183
 
171
- If you don't have GraphViz installed, you can use a Docker image instead:
184
+ Use `--host HOST:PORT` to select a server. `gli` remains a runtime dependency for the CLI, and `pry` remains for the separate `bin/console` executable.
172
185
 
173
- ```bash
174
- ./bin/neo4j_bolt visualize | docker run --rm -i nshine/dot dot -Tsvg > graph.svg
175
- ```
186
+ ## Tested Neo4j versions
176
187
 
177
- The result looks like this for the movie graph example provided by Neo4j:
188
+ The same complete integration suite is run against these exact Community images:
178
189
 
179
- <img src="movie_graph.svg" />
190
+ - `neo4j:4.4.48-community`
191
+ - `neo4j:5.26.28-community`
192
+ - `neo4j:2026.06.0-community`
180
193
 
181
- You can see nodes and relationships with their current numbers, plus all properties with their respective data types and for each data type the percentage of entities with that data type and min / mean / max values (for ints and floats) or min / mean / max lengths (for strings and lists).
194
+ No compatibility beyond this matrix is claimed for `0.4.0`.
182
195
 
183
- Uniqueness constraints and indexes (if available) are shown as well if they are defined on a single node or relationship with a single attribute.
196
+ Run one modern LTS target:
197
+
198
+ ```bash
199
+ bundle exec rake spec
200
+ ```
184
201
 
185
- If a property is an integer and has `ts` or `timestamp` in its name separated from other alphanumeric characters (like `ts_created` but not like `hits`), it gets treated as a UNIX timestamp (just for the visualization).
202
+ Run the complete sequential matrix:
186
203
 
187
- ## Development
204
+ ```bash
205
+ bundle exec rake spec:matrix
206
+ ```
188
207
 
189
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
208
+ The harness creates uniquely named disposable containers with `NEO4J_AUTH=none`, dynamically publishes Bolt ports, waits by establishing a real driver/query connection, and cleans every container through shell traps. A developer does not need to start Neo4j manually.
209
+
210
+ To point RSpec itself at an already disposable database, set `NEO4J_BOLT_TEST_HOST` and `NEO4J_BOLT_TEST_PORT`. The explicit port requirement protects real databases from the destructive integration suite.
211
+
212
+ ## Compatibility inventory for 0.4
213
+
214
+ | API | Status |
215
+ | --- | --- |
216
+ | `bolt_host`, `bolt_port`, `bolt_verbosity` | Preserved |
217
+ | Included/extended/module-style use | Preserved |
218
+ | `neo4j_query`, including incremental block form | Preserved via adapter |
219
+ | `neo4j_query_expect_one` | Preserved via adapter |
220
+ | `transaction`, nesting, rollback-only behavior | Preserved via thread-local adapter |
221
+ | `rollback` | Preserved and repaired as rollback-only |
222
+ | `cleanup_neo4j`, `wait_for_neo4j` | Preserved via pooled driver lifecycle |
223
+ | `setup_constraints_and_indexes` | Preserved with current Cypher |
224
+ | `dump_database`, `load_database_dump` | Preserved; relationship reconstruction modernized |
225
+ | Named error classes | Preserved with narrow upstream translation |
226
+ | `Node` and `Relationship` Hash behavior | Preserved via recursive value adapter |
227
+ | Element identity and modern values | Additive behavior |
228
+ | CLI commands | Preserved |
229
+ | `BoltSocket`, `BoltBuffer`, protocol markers/state/parser/packer | Intentionally removed private implementation details |
230
+
231
+ ## 0.4.0 migration notes
232
+
233
+ - Ruby 3.4 or newer is required; Ruby 2.x/3.0–3.3 applications should stay on 0.3.x until upgraded.
234
+ - The exact prerelease upstream dependency is pinned while no stable `neo4j-ruby-driver` 6.2.x exists.
235
+ - Connections are pooled and safe for concurrent use instead of one mutable socket per including object.
236
+ - TLS, routing, authentication, database selection, and other upstream-driver configuration are not newly exposed through the legacy three-setting API in this compatibility prerelease.
237
+ - `BoltSocket`, `BoltBuffer`, `ServerState`, `BoltMarker`, `UnexpectedServerResponse`, `State`, and `CypherError` were undocumented wire internals and are removed.
190
238
 
191
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
239
+ ## Development
192
240
 
193
- ## Contributing
241
+ Run `bin/setup`, then `bundle exec rake spec` or `bundle exec rake spec:matrix`. Build without publishing with `bundle exec rake build`.
194
242
 
195
- Bug reports and pull requests are welcome on GitHub at https://github.com/specht/neo4j_bolt.
243
+ Bug reports and pull requests are welcome at <https://github.com/specht/neo4j_bolt>.
196
244
 
data/bin/neo4j_bolt CHANGED
@@ -49,7 +49,7 @@ class App
49
49
  c.flag [:o, 'out-file'.to_sym], :default_value => '/dev/stdout'
50
50
  c.action do |global_options, options|
51
51
  File.open(options['out-file'.to_sym], 'w') do |f|
52
- dump_database(f)
52
+ dump_database(f, progress_io: $stderr)
53
53
  end
54
54
  end
55
55
  end
@@ -61,11 +61,18 @@ class App
61
61
  command :load do |c|
62
62
  # c.flag [:i, :in_file], :desc => 'input path', :required => true
63
63
  c.switch [:f, :force], :default_value => false, :desc => 'force appending nodes even if the database is not empty'
64
+ c.flag [:b, 'batch-size'.to_sym], :default_value => Neo4jBolt::LOAD_INITIAL_BATCH_SIZE,
65
+ :desc => 'initial batch size; automatically reduced on transaction-memory errors'
64
66
  c.action do |global_options, options, args|
65
67
  help_now!('input path is required') if args.empty?
66
68
  path = args.shift
67
69
  File.open(path, 'r') do |f|
68
- load_database_dump(f, force_append: options[:force])
70
+ load_database_dump(
71
+ f,
72
+ force_append: options[:force],
73
+ progress_io: $stderr,
74
+ initial_batch_size: options['batch-size'.to_sym]
75
+ )
69
76
  end
70
77
  end
71
78
  end
@@ -92,10 +99,10 @@ class App
92
99
  command :index do |c|
93
100
  c.command :ls do |c2|
94
101
  c2.action do |global_options, options, args|
95
- neo4j_query("SHOW ALL CONSTRAINTS") do |row|
102
+ neo4j_query("SHOW CONSTRAINTS") do |row|
96
103
  puts "#{row['type']} #{row['name']} #{(row['labelsOrTypes'] || []).join('/')}/#{(row['properties'] || []).join('/')}"
97
104
  end
98
- neo4j_query("SHOW ALL INDEXES") do |row|
105
+ neo4j_query("SHOW INDEXES") do |row|
99
106
  puts "#{row['uniqueness']} #{row['entityType']} #{row['state']} #{row['populationPercent']}% #{row['name']} #{(row['labelsOrTypes'] || []).join('/')}/#{(row['properties'] || []).join('/')}"
100
107
  end
101
108
  end
@@ -106,10 +113,10 @@ class App
106
113
  if options[:force]
107
114
  all_constraints = []
108
115
  all_indexes = []
109
- neo4j_query("SHOW ALL CONSTRAINTS") do |row|
116
+ neo4j_query("SHOW CONSTRAINTS") do |row|
110
117
  all_constraints << row['name']
111
118
  end
112
- neo4j_query("SHOW ALL INDEXES") do |row|
119
+ neo4j_query("SHOW INDEXES") do |row|
113
120
  all_indexes << row['name']
114
121
  end
115
122
  transaction do
@@ -242,7 +249,7 @@ class App
242
249
  'BTREE' => 'indexed',
243
250
  }
244
251
 
245
- ['SHOW ALL CONSTRAINTS', 'SHOW ALL INDEXES'].each do |query|
252
+ ['SHOW CONSTRAINTS', 'SHOW INDEXES'].each do |query|
246
253
  neo4j_query(query) do |row|
247
254
  # STDERR.puts row.to_json
248
255
  labels_or_types = row['labelsOrTypes'] || []
@@ -1,3 +1,3 @@
1
1
  module Neo4jBolt
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.1"
3
3
  end