diff --git a/Cargo.toml b/Cargo.toml index 37ed7ebc9..1f40f0829 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,8 +38,6 @@ postgres-types = { version = "0", default-features = false, optional = true } rust_decimal = { version = "1", default-features = false, optional = true } bigdecimal = { version = "0.3", default-features = false, optional = true } uuid = { version = "1", default-features = false, optional = true } -proc-macro2 = { version = "1", default-features = false, optional = true } -quote = { version = "1", default-features = false, optional = true } time = { version = "0.3", default-features = false, optional = true, features = ["macros", "formatting"] } ipnetwork = { version = "0.20", default-features = false, optional = true } mac_address = { version = "1.1", default-features = false, optional = true } @@ -60,7 +58,7 @@ derive = ["sea-query-derive"] attr = ["sea-query-attr"] hashable-value = ["derivative", "ordered-float"] postgres-array = [] -postgres-interval = ["proc-macro2", "quote"] +postgres-interval = [] thread-safe = [] with-chrono = ["chrono"] with-json = ["serde_json"] diff --git a/src/table/column.rs b/src/table/column.rs index 325ed03cf..7e267c7a0 100644 --- a/src/table/column.rs +++ b/src/table/column.rs @@ -148,28 +148,6 @@ pub enum BlobSize { Long, } -#[cfg(feature = "postgres-interval")] -impl quote::ToTokens for PgInterval { - fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { - use quote::{quote, TokenStreamExt}; - tokens.append_all(match self { - PgInterval::Year => quote! { PgInterval::Year }, - PgInterval::Month => quote! { PgInterval::Month }, - PgInterval::Day => quote! { PgInterval::Day }, - PgInterval::Hour => quote! { PgInterval::Hour }, - PgInterval::Minute => quote! { PgInterval::Minute }, - PgInterval::Second => quote! { PgInterval::Second }, - PgInterval::YearToMonth => quote! { PgInterval::YearToMonth }, - PgInterval::DayToHour => quote! { PgInterval::DayToHour }, - PgInterval::DayToMinute => quote! { PgInterval::DayToMinute }, - PgInterval::DayToSecond => quote! { PgInterval::DayToSecond }, - PgInterval::HourToMinute => quote! { PgInterval::HourToMinute }, - PgInterval::HourToSecond => quote! { PgInterval::HourToSecond }, - PgInterval::MinuteToSecond => quote! { PgInterval::MinuteToSecond }, - }); - } -} - impl ColumnDef { /// Construct a table column pub fn new(name: T) -> Self diff --git a/tests/postgres/interval.rs b/tests/postgres/interval.rs deleted file mode 100644 index 82aa70417..000000000 --- a/tests/postgres/interval.rs +++ /dev/null @@ -1,36 +0,0 @@ -use pretty_assertions::assert_eq; -use quote::{quote, ToTokens}; -use sea_query::*; - -#[test] -fn with_quote_1() { - for (interval_field, token_stream) in [ - (PgInterval::Year, quote! { PgInterval::Year }), - (PgInterval::Month, quote! { PgInterval::Month }), - (PgInterval::Day, quote! { PgInterval::Day }), - (PgInterval::Hour, quote! { PgInterval::Hour }), - (PgInterval::Minute, quote! { PgInterval::Minute }), - (PgInterval::Second, quote! { PgInterval::Second }), - (PgInterval::YearToMonth, quote! { PgInterval::YearToMonth }), - (PgInterval::DayToHour, quote! { PgInterval::DayToHour }), - (PgInterval::DayToMinute, quote! { PgInterval::DayToMinute }), - (PgInterval::DayToSecond, quote! { PgInterval::DayToSecond }), - ( - PgInterval::HourToMinute, - quote! { PgInterval::HourToMinute }, - ), - ( - PgInterval::HourToSecond, - quote! { PgInterval::HourToSecond }, - ), - ( - PgInterval::MinuteToSecond, - quote! { PgInterval::MinuteToSecond }, - ), - ] { - assert_eq!( - interval_field.into_token_stream().to_string(), - token_stream.to_string() - ); - } -} diff --git a/tests/postgres/mod.rs b/tests/postgres/mod.rs index 42e9ae955..82b85df3b 100644 --- a/tests/postgres/mod.rs +++ b/tests/postgres/mod.rs @@ -2,8 +2,6 @@ use sea_query::{tests_cfg::*, *}; mod foreign_key; mod index; -#[cfg(feature = "postgres-interval")] -mod interval; mod query; mod table; mod types;