Sha256: 29cabab9b874375db334a084fd653bc1915e98a11f81eafcadd9fad1fdb1e5bf

Contents?: true

Size: 433 Bytes

Versions: 8

Compression:

Stored size: 433 Bytes

Contents

module ActiveGraph::Shared
  class NodeQueryFactory < QueryFactory
    protected

    def match_string
      "(#{identifier})"
    end

    def create_query
      return match_query if graph_object.persisted?
      labels = graph_object.labels_for_create.map { |l| ":`#{l}`" }.join
      base_query.create("(#{identifier}#{labels} $#{identifier}_params)").params(identifier_params => graph_object.props_for_create)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
activegraph-12.0.0.beta.4 lib/active_graph/shared/node_query_factory.rb
activegraph-11.5.0.beta.3 lib/active_graph/shared/node_query_factory.rb
activegraph-12.0.0.beta.3 lib/active_graph/shared/node_query_factory.rb
activegraph-12.0.0.beta.2 lib/active_graph/shared/node_query_factory.rb
activegraph-11.5.0.beta.2 lib/active_graph/shared/node_query_factory.rb
activegraph-12.0.0.beta.1 lib/active_graph/shared/node_query_factory.rb
activegraph-11.5.0.beta.1 lib/active_graph/shared/node_query_factory.rb
activegraph-11.5.0.alpha.1 lib/active_graph/shared/node_query_factory.rb