surrealpatch/src/dbs/response.rs

25 lines
675 B
Rust
Raw Normal View History

use crate::sql::value::Value;
2021-03-29 15:43:37 +00:00
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "UPPERCASE")]
pub enum Status {
Ok,
Err,
}
2021-03-29 15:43:37 +00:00
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct Responses(pub Vec<Response>);
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct Response {
#[serde(skip_serializing_if = "Option::is_none")]
pub sql: Option<String>,
2021-03-29 15:43:37 +00:00
pub time: String,
pub status: Status,
2021-03-29 15:43:37 +00:00
#[serde(skip_serializing_if = "Option::is_none")]
pub detail: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<Value>,
2021-03-29 15:43:37 +00:00
}