Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(encode): compare shapes by sorted fields (credits to @hongquan) #299

Closed

Conversation

MrFoxPro
Copy link
Contributor

@MrFoxPro MrFoxPro commented Mar 12, 2024

Problem:

use edgedb_protocol::{
   value::{EnumValue, Value as EValue},
};

let args = indexmap! {
   "me_num" => (Some(EValue::Int64(user.num)), Cd::One),
   "activities" => (Some(EValue::Array(vec![EValue::Enum(EnumValue::from("Freelancer"))])), Cd::AtMostOne)
};
let args = helpers::edge_object_from_pairs(m);

let q = "
   update User
   filter .num = <int64>$me_num
   set {
      activities := <optional array<Activity>>$activities ?? .activities,
   }
";
ctx.edb.execute(q, &args).await?;

Will fail with ClientEncodingError #298
Discord thread will full problem description: https://discord.com/channels/841451783728529451/1216718781846392852

I rewrote solution of @hongquan (#289) without reformatting, so changes are more readable.
We can discuss here more elegant solution

@MrFoxPro MrFoxPro mentioned this pull request Mar 27, 2024
@MrFoxPro
Copy link
Contributor Author

Should be fixed by #304

@MrFoxPro MrFoxPro closed this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant