Closed tetotechy closed 1 year ago
You have to specify <optional bool>$0
explicitly.
Although, the fact that we allow Some()
for non-optional parameter might be a bug (an artifact from early times where we didn't have this distinction manifested to the client).
This might be a bug, but when I provide an optional value as a param in methods like
Client::query_json
I get an error likeQueryError: parameter $0 is required
if the value in Rust isNone
. For example:type Maybe { val: bool; }
is the EdgeDB type/table in the database, i.e. with an optional property namedval
in Rust, assume I want to create
Maybe
values with:client.query_json("insert MaybeInt { val := <bool>$0 }", &(rust_val, ))
where
rust_val
is anOption<bool>
variable in scope. All is good ifrust_val
isSome(...)
, whereas I get the error when it isNone
, which is translated inValue::Nothing
Experimenting a bit, I had the same problem with values of other types.
Shouldn't
Value::Nothing
be the tool for representing "null" values of optional properties?