pub struct EdgeQuery {
pub query: String,
pub args: Option<Value>,
pub cardinality: Cardinality,
}
Expand description
EgdeQuery represents a edgeDB query.
It combines the string query and its query arguments
query : the string query
args : the query arguments
cardinality : the query cardinality, MANY by default
§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, cardinality: Cardinality:: One };
Fields§
§query: String
§args: Option<Value>
§cardinality: Cardinality
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EdgeQuery
impl RefUnwindSafe for EdgeQuery
impl Send for EdgeQuery
impl Sync for EdgeQuery
impl Unpin for EdgeQuery
impl UnwindSafe for EdgeQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more