Closed sapalli2989 closed 1 week ago
Hi @sapalli2989,
I can confirm this is bug on our side and working on it. Meanwhile, I wonder if the following workaround works for u?
# Create :T
tid = uuid4()
conn.execute(
"""
CREATE (t:T {id: $tid}) RETURN t;
""", ....)
# Create :U if not exist
uid = uuid4()
conn.execute(
"""
MERGE (u:U {id: $uid})
SET u.name = $name
""", ...)
# Create :has if not exist
conn.execute(
"""
MATCH (t:T {id: $tid}), (u:U {id: $uid})
MERGE (t)-[e:has]->(u)
RETURN t, u, e
""", ...)
Essentially we split merge into multiple statements instead of one.
Great, thanks!
This is now fixed in #4046
Hi, above error can be reproduced by following snippet:
Some background for clarification: Goal was to construct a simple kind of object graph mapper (OGM) with
MERGE
: Given entitiesT
,U
with composite relation(:T)-[:has]->(:U)
, try to merge a new or existingU
from memory. (1) ensures:T
exists (2) merges an:U
by its identifier (otherwiseMERGE
would try to create a new entity, if any property has changed) (3) update all:U
properties in database (assuming object memory has most recent version or creates new entity)Kuzu 0.4.2