diff --git a/lib/d1/src/result.rs b/lib/d1/src/result.rs index 0a23250..f1ec2b0 100644 --- a/lib/d1/src/result.rs +++ b/lib/d1/src/result.rs @@ -7,9 +7,14 @@ pub type Result = std::result::Result; /// The metadata of a D1 database execution. #[derive(Deserialize)] pub struct D1ResultMetadata { + #[serde(default)] duration: u64, - rows_read: Option, - rows_written: Option, + + #[serde(default)] + rows_read: u64, + + #[serde(default)] + rows_written: u64, } impl D1ResultMetadata { @@ -19,12 +24,12 @@ impl D1ResultMetadata { } /// Returns the number of rows read (scanned) by this query - pub fn rows_read(&self) -> Option { + pub fn rows_read(&self) -> u64 { self.rows_read } /// Returns the number of rows written by this query - pub fn rows_written(&self) -> Option { + pub fn rows_written(&self) -> u64 { self.rows_written } }