From be7e5a4c58da0abf218af690867e37fb0132f4fe Mon Sep 17 00:00:00 2001 From: Jay White Date: Tue, 12 Nov 2024 22:32:58 -0500 Subject: [PATCH] feat: derive serde for `OwnedTable`/`OwnedColumn` --- crates/proof-of-sql/src/base/database/owned_column.rs | 3 ++- crates/proof-of-sql/src/base/database/owned_table.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/proof-of-sql/src/base/database/owned_column.rs b/crates/proof-of-sql/src/base/database/owned_column.rs index 0319c3796..afe30a142 100644 --- a/crates/proof-of-sql/src/base/database/owned_column.rs +++ b/crates/proof-of-sql/src/base/database/owned_column.rs @@ -19,8 +19,9 @@ use proof_of_sql_parser::{ intermediate_ast::OrderByDirection, posql_time::{PoSQLTimeUnit, PoSQLTimeZone}, }; +use serde::{Deserialize, Serialize}; -#[derive(Debug, PartialEq, Clone, Eq)] +#[derive(Debug, PartialEq, Clone, Eq, Serialize, Deserialize)] #[non_exhaustive] /// Supported types for [`OwnedColumn`] pub enum OwnedColumn { diff --git a/crates/proof-of-sql/src/base/database/owned_table.rs b/crates/proof-of-sql/src/base/database/owned_table.rs index 3c015dd02..82f3d1d35 100644 --- a/crates/proof-of-sql/src/base/database/owned_table.rs +++ b/crates/proof-of-sql/src/base/database/owned_table.rs @@ -1,6 +1,7 @@ use super::OwnedColumn; use crate::base::{map::IndexMap, scalar::Scalar}; use proof_of_sql_parser::Identifier; +use serde::{Deserialize, Serialize}; use snafu::Snafu; /// An error that occurs when working with tables. @@ -15,7 +16,7 @@ pub enum OwnedTableError { /// This is primarily used as an internal result that is used before /// converting to the final result in either Arrow format or JSON. /// This is the analog of an arrow [`RecordBatch`](arrow::record_batch::RecordBatch). -#[derive(Debug, Clone, Eq)] +#[derive(Debug, Clone, Eq, Serialize, Deserialize)] pub struct OwnedTable { table: IndexMap>, }