activecypher 0.7.0 → 0.7.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: 001236241c04680c15946488d5f7e915100342dad161abe512f5e1d1f47bb84f
4
- data.tar.gz: e6cbcd8f09b83bdfbb90830aded7a39ad7afc91c7aef03704d7dba8a55bcc12d
3
+ metadata.gz: e5ccd00478564eeb903b76a423867e21973268d6c23af232de7329abe94263d5
4
+ data.tar.gz: a6e74f587ad7c543123840d5f44440efca909a44efa0a59be5b8ce15d8d39f0f
5
5
  SHA512:
6
- metadata.gz: 2e4a8e7f74da14f8013152a7a4adebfbc0cab73be88919a3ae14994f2fbeaab1599832659fd31b6b4f7a6c5f14de14439aad29e913b17981bc62b2f46fdf824d
7
- data.tar.gz: b856e47065693eaab0152246a2aa7ee475706ef9c0b54c61d8e3746438971c670cb0157087d6f4456ee3e5757619e114d796880d5213d72c62048228007bc9ba
6
+ metadata.gz: 1b90a82d07ffc1504ddf9d07fcd88a80d3371d32ed09eb8f799c4d228958e090522a44cac2abd6bdf661983fda43ce95b898fe440f8e76c0427621f55ad342a0
7
+ data.tar.gz: bd848d6485fdc502673f88ad3ea3dd776d486a1e11cf501592994efba1347cb799b28af0b6f06e5a29daf3a60c79c39072181fb03d36f0938df5ed52699bd881
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
- require "active_cypher/schema/catalog"
2
+
3
+ require 'active_cypher/schema/catalog'
3
4
 
4
5
  module ActiveCypher
5
6
  module ConnectionAdapters
@@ -69,7 +70,10 @@ module ActiveCypher
69
70
  protected
70
71
 
71
72
  def parse_schema(rows)
72
- nodes, edges, idx, cons = [], [], [], []
73
+ nodes = []
74
+ edges = []
75
+ idx = []
76
+ cons = []
73
77
 
74
78
  rows.each do |row|
75
79
  case row['type']
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
- require "active_cypher/schema/catalog"
2
+
3
+ require 'active_cypher/schema/catalog'
3
4
 
4
5
  module ActiveCypher
5
6
  module ConnectionAdapters
@@ -33,7 +34,7 @@ module ActiveCypher
33
34
  end
34
35
 
35
36
  Schema::Catalog.new(indexes: idx_defs, constraints: con_defs,
36
- node_types: [], edge_types: [])
37
+ node_types: [], edge_types: [])
37
38
  rescue StandardError
38
39
  Schema::Catalog.new(indexes: [], constraints: [], node_types: [], edge_types: [])
39
40
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveCypher
2
4
  module Schema
3
5
  IndexDef = Data.define(:name, :element, :label, :props, :unique, :vector_opts)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fileutils'
2
4
  require 'optparse'
3
5
 
@@ -5,7 +7,7 @@ module ActiveCypher
5
7
  module Schema
6
8
  # Dumps the graph schema to a Cypher script
7
9
  class Dumper
8
- DEFAULT_PATH = 'graphdb'.freeze
10
+ DEFAULT_PATH = 'graphdb'
9
11
 
10
12
  def initialize(connection = ActiveCypher::Base.connection, base_dir: Dir.pwd)
11
13
  @connection = connection
@@ -60,7 +62,7 @@ module ActiveCypher
60
62
  def catalog_from_migrations
61
63
  idx = []
62
64
  cons = []
63
- Dir[File.join(@base_dir, 'graphdb', 'migrate', '*.rb')].sort.each do |file|
65
+ Dir[File.join(@base_dir, 'graphdb', 'migrate', '*.rb')].each do |file|
64
66
  require file
65
67
  class_name = File.basename(file, '.rb').split('_', 2).last.camelize
66
68
  klass = Object.const_get(class_name)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveCypher
2
4
  module Schema
3
5
  module Writer
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveCypher
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
 
6
6
  def self.gem_version
7
7
  Gem::Version.new VERSION
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :graphdb do
4
+ namespace :schema do
5
+ desc 'Dump current graph schema to graphdb/schema*.cypher'
6
+ task dump: :environment do
7
+ ActiveCypher::Schema::Dumper.run_from_cli
8
+ end
9
+ end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activecypher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
@@ -213,6 +213,7 @@ files:
213
213
  - lib/cyrel/types/hash_type.rb
214
214
  - lib/cyrel/types/symbol_type.rb
215
215
  - lib/tasks/graphdb_migrate.rake
216
+ - lib/tasks/graphdb_schema.rake
216
217
  - sig/activecypher.rbs
217
218
  homepage: https://github.com/seuros/activecypher
218
219
  licenses: