Sha256: 49d232263b3b77034df1d6bca864e501b586feb408d4c7ff71ef8d0ac11e5505
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
module Neo4j module Core class CypherSession module Adaptors module Schema def version(session) result = query(session, 'CALL dbms.components()', {}, skip_instrumentation: true) # BTW: community / enterprise could be retrieved via `result.first.edition` result.first.versions[0] end def indexes(session) result = query(session, 'CALL db.indexes()', {}, skip_instrumentation: true) result.map do |row| label, property = row.description.match(/INDEX ON :([^\(]+)\(([^\)]+)\)/)[1, 2] {type: row.type.to_sym, label: label.to_sym, properties: [property.to_sym], state: row.state.to_sym} end end def constraints(session) result = query(session, 'CALL db.indexes()', {}, skip_instrumentation: true) result.select { |row| row.type == 'node_unique_property' }.map do |row| label, property = row.description.match(/INDEX ON :([^\(]+)\(([^\)]+)\)/)[1, 2] {type: :uniqueness, label: label.to_sym, properties: [property.to_sym]} end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
neo4j-core-9.0.0 | lib/neo4j/core/cypher_session/adaptors/schema.rb |