Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: derive serde for OwnedTable/OwnedColumn #369

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/proof-of-sql/src/base/database/owned_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<S: Scalar> {
Expand Down
3 changes: 2 additions & 1 deletion crates/proof-of-sql/src/base/database/owned_table.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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<S: Scalar> {
table: IndexMap<Identifier, OwnedColumn<S>>,
}
Expand Down
Loading