Sha256: 57cfedcff556348ff05a5027819f1f74da7dd7b39ca940a32f4262be85ba7fc4
Contents?: true
Size: 1.04 KB
Versions: 57
Compression:
Stored size: 1.04 KB
Contents
module Neo4j module Server class CypherLabel < Neo4j::Label extend Forwardable def_delegator :@session, :query_cypher_for attr_reader :name def initialize(session, name) @name = name @session = session end def create_index(property, options = {}, session = Neo4j::Session.current) validate_index_options!(options) properties = property.is_a?(Array) ? property.join(',') : property response = session._query("CREATE INDEX ON :`#{@name}`(#{properties})") response.raise_error if response.error? end def drop_index(property, options = {}, session = Neo4j::Session.current) validate_index_options!(options) response = session._query("DROP INDEX ON :`#{@name}`(#{property})") response.raise_error if response.error? && !response.error_msg.match(/No such INDEX ON/) end def indexes @session.indexes(@name) end def uniqueness_constraints @session.uniqueness_constraints(@name) end end end end
Version data entries
57 entries across 57 versions & 1 rubygems