You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling merge with a RecordID that exists, it updates the specified fields. But when running it with RecordID that does not exist or with Table name only, it does nothing, where the same SurrealQL creates records when they do not exist.
Additionally, when running custom query with UPSERT MERGE it works as expected (creates new records).
Steps to reproduce
# Does nothing, returns None
res = await db.merge(RecordID("test", "id1"), {"key": 1})
print(f"Merge1: {res}")
# Does nothing, returns [] ???
res = await db.merge(Table("test"), {"key": 1})
print(f"Merge2: {res}")
res = await db.create(RecordID("test", "id2"), {"key": 1})
print(f"Create: {res}")
# This works fine
res = await db.merge(RecordID("test", "id2"), {"key2": 2})
print(f"Merge3: {res}")
# This also works fine
res = await db.query(""" UPSERT test MERGE {"key3":3} """)
print(f"Query: {res}")
Assuming the SurrealQL behavior of MERGE is correct, I expect the merge method of the SDK to behave the same way - so create records if they don't exist
SurrealDB version
2.1.4
surrealdb.py version
0.4.1
Contact Details
No response
Is there an existing issue for this?
I have searched the existing issues
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Describe the bug
When calling merge with a RecordID that exists, it updates the specified fields. But when running it with RecordID that does not exist or with Table name only, it does nothing, where the same SurrealQL creates records when they do not exist.
Additionally, when running custom query with UPSERT MERGE it works as expected (creates new records).
Steps to reproduce
Result:
Expected behaviour
Assuming the SurrealQL behavior of MERGE is correct, I expect the merge method of the SDK to behave the same way - so create records if they don't exist
SurrealDB version
2.1.4
surrealdb.py version
0.4.1
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: