Skip to content

Commit

Permalink
chore: publish fnck_sql_serde_marco (#237)
Browse files Browse the repository at this point in the history
* chore: publish `fnck_sql_serde_marco`

* chore: codefmt
  • Loading branch information
KKould authored Nov 3, 2024
1 parent 7498b21 commit d83e691
Show file tree
Hide file tree
Showing 44 changed files with 57 additions and 55 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ regex = { version = "1" }
rocksdb = { version = "0.22.0" }
rust_decimal = { version = "1" }
serde = { version = "1", features = ["derive", "rc"] }
serde_macros = { path = "serde_macros" }
fnck_sql_serde_macros = { version = "0.1.0", path = "fnck_sql_serde_macros" }
siphasher = { version = "1", features = ["serde"] }
sqlparser = { version = "0.34", features = ["serde"] }
strum_macros = { version = "0.26.2" }
Expand All @@ -85,7 +85,7 @@ pprof = { version = "0.13", features = ["flamegraph", "criterion"] }
members = [
"tests/sqllogictest",
"tests/macros-test"
, "serde_macros"]
, "fnck_sql_serde_macros"]

[profile.release]
lto = true
16 changes: 16 additions & 0 deletions fnck_sql_serde_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "fnck_sql_serde_macros"
version = "0.1.0"
edition = "2021"
description = "SerdeMacros for FnckSQL"
license = "Apache-2.0"

[dependencies]
darling = "0.20"
proc-macro2 = "1"
quote = "1"
syn = "2"

[lib]
path = "src/lib.rs"
proc-macro = true
File renamed without changes.
File renamed without changes.
14 changes: 0 additions & 14 deletions serde_macros/Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion src/binder/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::errors::DatabaseError;
use crate::planner::operator::copy_from_file::CopyFromFileOperator;
use crate::planner::operator::copy_to_file::CopyToFileOperator;
use crate::planner::operator::Operator;
use fnck_sql_serde_macros::ReferenceSerialization;
use serde::{Deserialize, Serialize};
use serde_macros::ReferenceSerialization;
use sqlparser::ast::{CopyOption, CopySource, CopyTarget};

#[derive(Debug, PartialEq, PartialOrd, Ord, Hash, Eq, Clone, ReferenceSerialization)]
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::expression::ScalarExpression;
use crate::types::tuple::EMPTY_TUPLE;
use crate::types::value::ValueRef;
use crate::types::{ColumnId, LogicalType};
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use sqlparser::ast::CharLengthUnits;
use std::hash::Hash;
use std::ops::Deref;
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::errors::DatabaseError;
use crate::types::index::{IndexMeta, IndexMetaRef, IndexType};
use crate::types::tuple::SchemaRef;
use crate::types::{ColumnId, LogicalType};
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::collections::BTreeMap;
use std::sync::Arc;
use std::{slice, vec};
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/view.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::catalog::TableName;
use crate::planner::LogicalPlan;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/expression/agg.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, ReferenceSerialization)]
pub enum AggKind {
Expand Down
2 changes: 1 addition & 1 deletion src/expression/function/scala.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::expression::ScalarExpression;
use crate::types::tuple::Tuple;
use crate::types::value::DataValue;
use crate::types::LogicalType;
use fnck_sql_serde_macros::ReferenceSerialization;
use serde::{Deserialize, Serialize};
use serde_macros::ReferenceSerialization;
use std::fmt::Debug;
use std::hash::{Hash, Hasher};
use std::ops::Deref;
Expand Down
2 changes: 1 addition & 1 deletion src/expression/function/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::errors::DatabaseError;
use crate::expression::function::FunctionSummary;
use crate::expression::ScalarExpression;
use crate::types::tuple::{SchemaRef, Tuple};
use fnck_sql_serde_macros::ReferenceSerialization;
use serde::{Deserialize, Serialize};
use serde_macros::ReferenceSerialization;
use std::fmt::Debug;
use std::hash::{Hash, Hasher};
use std::ops::Deref;
Expand Down
2 changes: 1 addition & 1 deletion src/expression/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use crate::expression::function::table::TableFunction;
use crate::types::evaluator::{BinaryEvaluatorBox, EvaluatorFactory, UnaryEvaluatorBox};
use crate::types::value::ValueRef;
use crate::types::LogicalType;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use sqlparser::ast::TrimWhereField;
use sqlparser::ast::{
BinaryOperator as SqlBinaryOperator, CharLengthUnits, UnaryOperator as SqlUnaryOperator,
Expand Down
2 changes: 1 addition & 1 deletion src/expression/range_detacher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::catalog::ColumnRef;
use crate::expression::{BinaryOperator, ScalarExpression};
use crate::types::value::{DataValue, ValueRef, NULL_VALUE};
use crate::types::ColumnId;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::cmp::Ordering;
use std::collections::Bound;
use std::fmt::Formatter;
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/core/histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::types::evaluator::EvaluatorFactory;
use crate::types::index::{IndexId, IndexMeta};
use crate::types::value::{DataValue, ValueRef};
use crate::types::LogicalType;
use fnck_sql_serde_macros::ReferenceSerialization;
use ordered_float::OrderedFloat;
use serde_macros::ReferenceSerialization;
use std::collections::Bound;
use std::sync::Arc;
use std::{cmp, mem};
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/core/statistics_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::serdes::{ReferenceSerialization, ReferenceTables};
use crate::storage::{StatisticsMetaCache, Transaction};
use crate::types::index::IndexId;
use crate::types::value::DataValue;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fs::OpenOptions;
use std::io::Write;
use std::path::Path;
Expand Down
2 changes: 1 addition & 1 deletion src/planner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use crate::planner::operator::union::UnionOperator;
use crate::planner::operator::values::ValuesOperator;
use crate::planner::operator::{Operator, PhysicalOption};
use crate::types::tuple::{Schema, SchemaRef};
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::sync::Arc;

#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/aggregate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::planner::LogicalPlan;
use crate::{expression::ScalarExpression, planner::operator::Operator};
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/alter_table/add_column.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::{ColumnCatalog, TableName};
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/alter_table/drop_column.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::TableName;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/analyze.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::catalog::TableName;
use crate::types::index::IndexMetaRef;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;

#[derive(Debug, PartialEq, Eq, Clone, Hash, ReferenceSerialization)]
pub struct AnalyzeOperator {
Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/copy_from_file.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::binder::copy::ExtSource;
use crate::types::tuple::SchemaRef;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/copy_to_file.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::binder::copy::ExtSource;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;

#[derive(Debug, PartialEq, Eq, Clone, Hash, ReferenceSerialization)]
pub struct CopyToFileOperator {
Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/create_index.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::catalog::{ColumnRef, TableName};
use crate::types::index::IndexType;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/create_table.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::catalog::{ColumnCatalog, TableName};
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/create_view.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::view::View;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/delete.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::{ColumnRef, TableName};
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/describe.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::TableName;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/drop_table.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::TableName;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/filter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::expression::ScalarExpression;
use crate::planner::LogicalPlan;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt::Formatter;
use std::{fmt, vec};

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/function_scan.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::expression::function::table::TableFunction;
use crate::planner::operator::Operator;
use crate::planner::LogicalPlan;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/insert.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::TableName;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/join.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::Operator;
use crate::expression::ScalarExpression;
use crate::planner::LogicalPlan;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;
use strum_macros::Display;
Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/limit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::Operator;
use crate::planner::LogicalPlan;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ use crate::planner::operator::union::UnionOperator;
use crate::planner::operator::update::UpdateOperator;
use crate::planner::operator::values::ValuesOperator;
use crate::types::index::IndexInfo;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/project.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::expression::ScalarExpression;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/sort.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::expression::ScalarExpression;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/table_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::planner::LogicalPlan;
use crate::storage::Bounds;
use crate::types::index::IndexInfo;
use crate::types::ColumnId;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/truncate.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::TableName;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/union.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::planner::operator::Operator;
use crate::planner::LogicalPlan;
use crate::types::tuple::SchemaRef;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/update.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::catalog::TableName;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/planner/operator/values.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::types::tuple::SchemaRef;
use crate::types::value::ValueRef;
use fnck_sql_serde_macros::ReferenceSerialization;
use itertools::Itertools;
use serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;

Expand Down
2 changes: 1 addition & 1 deletion src/types/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::expression::range_detacher::Range;
use crate::expression::ScalarExpression;
use crate::types::value::ValueRef;
use crate::types::{ColumnId, LogicalType};
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use std::fmt;
use std::fmt::Formatter;
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::any::TypeId;
use std::cmp;

use crate::errors::DatabaseError;
use serde_macros::ReferenceSerialization;
use fnck_sql_serde_macros::ReferenceSerialization;
use sqlparser::ast::{CharLengthUnits, ExactNumberInfo, TimezoneInfo};
use strum_macros::AsRefStr;
use ulid::Ulid;
Expand Down

0 comments on commit d83e691

Please sign in to comment.