Closed NicoWeio closed 4 months ago
I assumed that if the user uses a string representation, he will no longer use kwargs, but you are right - it can be confusing. I guess "combine the string and the kwargs" will be the best choice here E.g.
# RELATE person:john->wrote->article:best SET title = "title", text = "text";
print(db.relate("person:john->wrote->article:best").set('title = "title"', text="text"))
# RELATE person:john->wrote->article:best SET title = "title", text = "text";
print(db.relate("person:john->wrote->article:best").set(title="title", text="text"))
# RELATE person:john->wrote->article:best SET title = "title", text = "text";
print(db.relate("person:john->wrote->article:best").set('title = "title", text = "text"'))
Same exists for update and create, but it all use same class, fix it with version 0.5
@NicoWeio please update to 0.5, it should work there
pip install surrealist==0.5.0
Works nicely – thanks for the quick fix!
This happened to me when using
db.relate
and I guess the same issue exists elsewhere. I would have liked surrealist to either combine the string and the kwargs or raise an exception when trying to use both.