Skip to content
Permalink
Browse files
Implement Merge Clause
MERGE either matches existing nodes and binds them, or
it creates new data and binds that. It’s like a
combination  of  MATCH  and  CREATE  that  additionally
allows  you  to  specify  what  happens  if  the  data
was matched or created.

For example, you can specify that the graph must contain
a node for a user with a certain name. If there isn’t a
node with the correct name, a new node will be created
and its name property set.

When  using  MERGE  on  full patterns, the behavior is
that either the whole pattern matches, or the whole
pattern is created. MERGE will not partially use existing
patterns—it’s all or nothing. If partial matches are
needed, this can be accomplished by splitting a pattern up
into multiple MERGE clauses.

As with MATCH, MERGE can match multiple occurrences of a
pattern. If there are multiple matches, they will all be
passed on to later stages of the query.
  • Loading branch information
JoshInnis committed Feb 10, 2022
1 parent ed283c0 commit bf55ad0268bb4314071aa678c4b03337426d43ff
Showing 29 changed files with 3,442 additions and 244 deletions.
@@ -27,6 +27,7 @@ OBJS = src/backend/age.o \
src/backend/commands/graph_commands.o \
src/backend/commands/label_commands.o \
src/backend/executor/cypher_create.o \
src/backend/executor/cypher_merge.o \
src/backend/executor/cypher_set.o \
src/backend/executor/cypher_utils.o \
src/backend/nodes/ag_nodes.o \
@@ -79,6 +80,7 @@ REGRESS = scan \
cypher_with \
cypher_vle \
cypher_union \
cypher_merge \
drop

srcdir=`pwd`
@@ -3130,6 +3130,11 @@ RETURNS void
LANGUAGE c
AS 'MODULE_PATHNAME';

CREATE FUNCTION ag_catalog._cypher_merge_clause(internal)
RETURNS void
LANGUAGE c
AS 'MODULE_PATHNAME';

--
-- query functions
--

0 comments on commit bf55ad0

Please sign in to comment.