pub struct EdgeQuery {
    pub query: String,
    pub args: Option<Value>,
}
Expand description

EgdeQuery represents a edgeDB query.

It combines the string query and its query arguments

query : the string query

args : the query arguments


Examples

     use edgedb_protocol::codec::ObjectShape;
     use edgedb_protocol::descriptors::{ShapeElement,  TypePos};
     use edgedb_protocol::value::Value;
     use edgedb_protocol::common::Cardinality;
     use edgedb_query::models::edge_query::EdgeQuery;

     let shape: &[ShapeElement] = &[ShapeElement {
         flag_implicit: false,
         flag_link_property: false,
         flag_link: false,
         cardinality: Some(Cardinality::One),
         name: "var".to_string(),
         type_pos: TypePos(0),
     }];
     
     let args = Some(Value::Object {
         shape: ObjectShape::from(shape),
         fields: vec![Some(Value::Str(String::from("Rust")))],
     });

     let query = "Select 'I love ' ++ <str>$var".to_owned();

     let edge_query = EdgeQuery { query, args };

Fields§

§query: String§args: Option<Value>

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.