edgedb-rust icon indicating copy to clipboard operation
edgedb-rust copied to clipboard

`Queryable` is not implemented for all `Value` variants

Open jquesada2016 opened this issue 1 year ago • 4 comments

Describe the bug A clear and concise description of what the bug is.

Please implement Queryable for all Value variants. In my particular case, Value::Bytes(_) does not have Queryable implemented for it, and for many other variants as well.   Reproduction

#[derive(Queryable)]
struct SomeStruct {
  data: Bytes, // Error, Bytes implements QueryArg, but not Queryable
}

Expected behavior A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem.

I expect all values that can go into a query should be able to come out as a result. Value itself also does not have Queryable implemented, only QueryResult, so you can't use Value as a field of a struct to work around this issue. The only workaround I can think of is to return the data in JSON and parse it out the other side, which works, but is far from ideal.

Versions (please complete the following information):

  • OS:
  • EdgeDB version:
  • EdgeDB CLI version:
  • Rust compiler version:
  • Cargo version:
  • EdgeDB Rust versions: 0.6.1

Additional context Add any other context about the problem here.

jquesada2016 avatar Aug 04 '24 00:08 jquesada2016

I've run into this issue as well.

Bytes should implement DecodeScalar I can create a PR to fix this.

ifiokjr avatar Aug 26 '24 08:08 ifiokjr

It seems that Range also doesn't include implement Queryable but I'm not sure how to represent it.

ifiokjr avatar Aug 26 '24 13:08 ifiokjr

Ranges can be represented with edgedb_protocol::model::Range.

aljazerzen avatar Aug 26 '24 16:08 aljazerzen

Ranges can be represented with edgedb_protocol::model::Range.

I'm aware, I'm just not sure how to create the Queryable implementation for it.

ifiokjr avatar Aug 28 '24 11:08 ifiokjr