edgedb_query/models/
query_result.rs

1use crate::{EdgeQl, EdgeResult, ToEdgeQl, ToEdgeShape};
2use edgedb_derive::Queryable;
3use uuid::Uuid;
4
5const STRUCT_ID: &str = "{ id }";
6
7/// BasicResult represents the default edgeDB query result
8#[derive(Default, Queryable)]
9pub struct BasicResult {
10    pub id: Uuid,
11}
12
13impl ToEdgeShape for BasicResult {
14    fn shape() -> String {
15        String::default()
16    }
17}
18
19impl ToEdgeQl for BasicResult {
20    fn to_edgeql(&self) -> EdgeQl {
21        EdgeQl::new(STRUCT_ID.to_owned(), false)
22    }
23}
24
25impl EdgeResult for BasicResult {
26    fn returning_fields() -> Vec<&'static str> {
27        vec![]
28    }
29}