Remove serde serialization field skipping
Due to a bug in msgpack-rust (https://github.com/3Hren/msgpack-rust/issues/86), in order to have correct serialization<->deserialization of data, we need to ensure all fields are serialized even when empty. This will affect the output size of the data, but will ensure that once serialized, the data is deserialized without issue.
This commit is contained in:
parent
19909885e9
commit
7710451d7b
13 changed files with 0 additions and 47 deletions
|
@ -38,9 +38,7 @@ impl fmt::Display for Dir {
|
||||||
pub struct Graph {
|
pub struct Graph {
|
||||||
pub dir: Dir,
|
pub dir: Dir,
|
||||||
pub what: Tables,
|
pub what: Tables,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub cond: Option<Value>,
|
pub cond: Option<Value>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub alias: Option<Idiom>,
|
pub alias: Option<Idiom>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,7 @@ use std::fmt;
|
||||||
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||||
pub struct Model {
|
pub struct Model {
|
||||||
pub table: String,
|
pub table: String,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub count: Option<u64>,
|
pub count: Option<u64>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub range: Option<(u64, u64)>,
|
pub range: Option<(u64, u64)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,8 @@ use std::fmt;
|
||||||
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct CreateStatement {
|
pub struct CreateStatement {
|
||||||
pub what: Values,
|
pub what: Values,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub data: Option<Data>,
|
pub data: Option<Data>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub output: Option<Output>,
|
pub output: Option<Output>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub timeout: Option<Timeout>,
|
pub timeout: Option<Timeout>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -186,9 +186,7 @@ fn database(i: &str) -> IResult<&str, DefineDatabaseStatement> {
|
||||||
pub struct DefineLoginStatement {
|
pub struct DefineLoginStatement {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub base: Base,
|
pub base: Base,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub pass: Option<String>,
|
pub pass: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub hash: Option<String>,
|
pub hash: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,13 +353,9 @@ fn token(i: &str) -> IResult<&str, DefineTokenStatement> {
|
||||||
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct DefineScopeStatement {
|
pub struct DefineScopeStatement {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub session: Option<Duration>,
|
pub session: Option<Duration>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub signup: Option<Value>,
|
pub signup: Option<Value>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub signin: Option<Value>,
|
pub signin: Option<Value>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub connect: Option<Value>,
|
pub connect: Option<Value>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,7 +477,6 @@ pub struct DefineTableStatement {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub drop: bool,
|
pub drop: bool,
|
||||||
pub full: bool,
|
pub full: bool,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub view: Option<View>,
|
pub view: Option<View>,
|
||||||
pub permissions: Permissions,
|
pub permissions: Permissions,
|
||||||
}
|
}
|
||||||
|
@ -682,13 +675,9 @@ fn event(i: &str) -> IResult<&str, DefineEventStatement> {
|
||||||
pub struct DefineFieldStatement {
|
pub struct DefineFieldStatement {
|
||||||
pub name: Idiom,
|
pub name: Idiom,
|
||||||
pub what: String,
|
pub what: String,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub kind: Option<Kind>,
|
pub kind: Option<Kind>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub value: Option<Value>,
|
pub value: Option<Value>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub assert: Option<Value>,
|
pub assert: Option<Value>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub priority: Option<u64>,
|
pub priority: Option<u64>,
|
||||||
pub permissions: Permissions,
|
pub permissions: Permissions,
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,8 @@ use std::fmt;
|
||||||
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct DeleteStatement {
|
pub struct DeleteStatement {
|
||||||
pub what: Values,
|
pub what: Values,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub cond: Option<Cond>,
|
pub cond: Option<Cond>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub output: Option<Output>,
|
pub output: Option<Output>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub timeout: Option<Timeout>,
|
pub timeout: Option<Timeout>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ use std::fmt;
|
||||||
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct IfelseStatement {
|
pub struct IfelseStatement {
|
||||||
pub exprs: Vec<(Value, Value)>,
|
pub exprs: Vec<(Value, Value)>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub close: Option<Value>,
|
pub close: Option<Value>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,8 @@ pub struct InsertStatement {
|
||||||
pub into: Table,
|
pub into: Table,
|
||||||
pub data: Data,
|
pub data: Data,
|
||||||
pub ignore: bool,
|
pub ignore: bool,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub update: Option<Data>,
|
pub update: Option<Data>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub output: Option<Output>,
|
pub output: Option<Output>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub timeout: Option<Timeout>,
|
pub timeout: Option<Timeout>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,7 @@ use std::fmt;
|
||||||
pub struct LiveStatement {
|
pub struct LiveStatement {
|
||||||
pub expr: Fields,
|
pub expr: Fields,
|
||||||
pub what: Values,
|
pub what: Values,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub cond: Option<Cond>,
|
pub cond: Option<Cond>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub fetch: Option<Fetchs>,
|
pub fetch: Option<Fetchs>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,8 @@ pub struct RelateStatement {
|
||||||
pub from: Values,
|
pub from: Values,
|
||||||
pub with: Values,
|
pub with: Values,
|
||||||
pub uniq: bool,
|
pub uniq: bool,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub data: Option<Data>,
|
pub data: Option<Data>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub output: Option<Output>,
|
pub output: Option<Output>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub timeout: Option<Timeout>,
|
pub timeout: Option<Timeout>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,23 +28,14 @@ use std::fmt;
|
||||||
pub struct SelectStatement {
|
pub struct SelectStatement {
|
||||||
pub expr: Fields,
|
pub expr: Fields,
|
||||||
pub what: Values,
|
pub what: Values,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub cond: Option<Cond>,
|
pub cond: Option<Cond>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub split: Option<Splits>,
|
pub split: Option<Splits>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub group: Option<Groups>,
|
pub group: Option<Groups>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub order: Option<Orders>,
|
pub order: Option<Orders>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub limit: Option<Limit>,
|
pub limit: Option<Limit>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub start: Option<Start>,
|
pub start: Option<Start>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub fetch: Option<Fetchs>,
|
pub fetch: Option<Fetchs>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub version: Option<Version>,
|
pub version: Option<Version>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub timeout: Option<Timeout>,
|
pub timeout: Option<Timeout>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,9 @@ use std::fmt;
|
||||||
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct UpdateStatement {
|
pub struct UpdateStatement {
|
||||||
pub what: Values,
|
pub what: Values,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub data: Option<Data>,
|
pub data: Option<Data>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub cond: Option<Cond>,
|
pub cond: Option<Cond>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub output: Option<Output>,
|
pub output: Option<Output>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub timeout: Option<Timeout>,
|
pub timeout: Option<Timeout>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,7 @@ use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct UseStatement {
|
pub struct UseStatement {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub ns: Option<String>,
|
pub ns: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub db: Option<String>,
|
pub db: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,7 @@ use std::fmt;
|
||||||
pub struct View {
|
pub struct View {
|
||||||
pub expr: Fields,
|
pub expr: Fields,
|
||||||
pub what: Tables,
|
pub what: Tables,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub cond: Option<Cond>,
|
pub cond: Option<Cond>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub group: Option<Groups>,
|
pub group: Option<Groups>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue