neo4j_bolt 0.1.10 → 0.1.11

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: 45867052ad9a321932107079e772e8761b0eff8e365b7eb6b43f90d54cd04eda
4
- data.tar.gz: d5b5eadc6aa0de7688e1541dd9d51f631054037cb3dadb2dac2c509fc434db83
3
+ metadata.gz: 31a315fe0d04141dd4d3315da9b25f6b42e6571b799dee6f6fab39a4ced605bd
4
+ data.tar.gz: 4ac80c13abd2c1172f6786522342f8dd2d965c9352ae34d3011aeb38b6695dbe
5
5
  SHA512:
6
- metadata.gz: 59133a33da831e7f411e7ba43fc15a98c24335418736ed328277e95462777ab7e5cf649fd26af53f0449075ca589f3b796e543b9d7c25f7232fba4007ebfbba4
7
- data.tar.gz: bca9930c52c1a06e7a47a010b5f2f0c029dbd38ee4c360f550ea84a8f2d0c8913b66c48978ff1fc0211768367290692ffcb9997b68b77515fcd550e9ad271bbe
6
+ metadata.gz: 0e3db7bdadcc4c2ec69ef531466eb2d9696963a7d6709b7f7a198cfbf4c6ccf9037ccfca166d4c9bac5dd07426910cc1e7aa11f52de7785e4f1d697cabfe51d9
7
+ data.tar.gz: 1f7fab9c9b4f78271d36bf5baee3d480bccfc45245d634547d8b146c3c0dbbc75b2f3616689c96717f3cabefceb5d2e1129ead5ac0d6cec1f4aef1afafbd46a3
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neo4j_bolt (0.1.8)
4
+ neo4j_bolt (0.1.11)
5
+ gli
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
data/bin/neo4j_bolt CHANGED
@@ -83,6 +83,52 @@ class App
83
83
 
84
84
  # --------------------------------------------
85
85
 
86
+ desc 'Show or remove constraints and indexes'
87
+ # long_desc 'Clear all nodes and relationships'
88
+ command :index do |c|
89
+ c.command :ls do |c2|
90
+ c2.action do |global_options, options, args|
91
+ neo4j_query("SHOW ALL CONSTRAINTS") do |row|
92
+ # STDERR.puts row.to_yaml
93
+ puts "#{row['type']} #{row['name']} #{row['labelsOrTypes'].join('/')}/#{row['properties'].join('/')}"
94
+ end
95
+ neo4j_query("SHOW ALL INDEXES") do |row|
96
+ # STDERR.puts row.to_yaml
97
+ puts "#{row['uniqueness']} #{row['entityType']} #{row['state']} #{row['populationPercent']}% #{row['name']} #{row['labelsOrTypes'].join('/')}/#{row['properties'].join('/')}"
98
+ end
99
+ end
100
+ end
101
+ c.command :rm do |c2|
102
+ c2.switch [:f, :force], :required => true, :negatable => false, :desc => 'Specify --force to really remove all constraints and indexes'
103
+ c2.action do |global_options, options, args|
104
+ if options[:force]
105
+ all_constraints = []
106
+ all_indexes = []
107
+ neo4j_query("SHOW ALL CONSTRAINTS") do |row|
108
+ all_constraints << row['name']
109
+ end
110
+ neo4j_query("SHOW ALL INDEXES") do |row|
111
+ all_indexes << row['name']
112
+ end
113
+ transaction do
114
+ all_constraints.each do |name|
115
+ STDERR.puts "Removing constraint #{name}"
116
+ neo4j_query("DROP CONSTRAINT #{name} IF EXISTS")
117
+ end
118
+ all_indexes.each do |name|
119
+ STDERR.puts "Removing index #{name}"
120
+ neo4j_query("DROP INDEX #{name} IF EXISTS")
121
+ end
122
+ end
123
+ else
124
+ STDERR.puts "Doing nothing unless you specify --force."
125
+ end
126
+ end
127
+ end
128
+ end
129
+
130
+ # --------------------------------------------
131
+
86
132
  desc 'Visualize database'
87
133
  long_desc 'Generate a GraphViz-formatted visual representation of the database'
88
134
  command :visualize do |c|
@@ -1,3 +1,3 @@
1
1
  module Neo4jBolt
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j_bolt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Specht