Skip to content

Commit

Permalink
Cleanup features and update dependencies
Browse files Browse the repository at this point in the history
* removes `bigdecimal{02|03}` features in favor of `bigdecimal`
* drops bigdecimal v0.2.x support
* drops time v0.2.x support (and removes `time02` feature)
* mekes `derive` the only non-mandatory default feature
  • Loading branch information
blackbeam committed Nov 5, 2024
1 parent 1e86604 commit e9566e9
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 826 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: cargo fmt -- --check
- name: Features subsets
run: |
ruby -e "fs=['bigdecimal02', 'bigdecimal03', 'bigdecimal', 'chrono', 'rust_decimal', 'time02', 'time', 'frunk', 'derive', 'binlog']; \
ruby -e "fs=['bigdecimal', 'chrono', 'rust_decimal', 'time', 'frunk', 'derive', 'binlog']; \
(1..fs.length).each do |n| puts fs.combination(n).to_a.map {|x| x.join(\" \")}.join(\"\n\"); end" \
| while read -r line; do \
echo "$line" && cargo check --quiet --tests --no-default-features --features "flate2/zlib test $line" --profile features-subsets; \
Expand Down
22 changes: 2 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ travis-ci = { repository = "blackbeam/rust_mysql_common" }

[dependencies]
base64 = "0.22"
bigdecimal02 = { package = "bigdecimal", version = "0.2", features = [
"serde",
], optional = true }
bigdecimal03 = { package = "bigdecimal", version = "0.3", optional = true }
bigdecimal = { version = "0.4", optional = true }
bigdecimal = { version = ">=0.3, <0.5", optional = true }
bitflags = "2.3"
bitvec = { version = "1.0", optional = true }
byteorder = "1"
Expand All @@ -56,9 +52,6 @@ rust_decimal = { version = "1.0", optional = true }
sha1 = "0.10"
sha2 = "0.10"
thiserror = "1.0"
time02 = { package = "time", version = "0.2", default-features = false, features = [
"std",
], optional = true }
time = { version = "0.3", default-features = false, features = [
"parsing",
], optional = true }
Expand Down Expand Up @@ -91,15 +84,7 @@ strip = "debuginfo"
incremental = false

[features]
default = [
"flate2/zlib",
"bigdecimal",
"rust_decimal",
"time",
"frunk",
"derive",
"binlog",
]
default = ["flate2/zlib", "derive"]
test = ["derive"]
derive = ["mysql-common-derive"]
binlog = ["bitvec"]
Expand All @@ -110,12 +95,9 @@ rustdoc-args = ["--cfg", "docsrs"]
no-default-features = true
features = [
"flate2/zlib",
"time02",
"time",
"rust_decimal",
"chrono",
"bigdecimal02",
"bigdecimal03",
"bigdecimal",
"derive",
"binlog",
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ column and protocol type correspondence:
| `mysql_common::Deserialized<T : DeserializeOwned>` | MySql bytes parsed using `serde_json::from_str` |
| `Option<T: FromValue>` | Must be used for nullable columns to avoid errors |
| [`decimal::Decimal`] | MySql int, uint or bytes parsed using `Decimal::from_str`.<br>⚠️ Note that this type doesn't support full range of MySql `DECIMAL` type. |
| [`bigdecimal::BigDecimal`] (v0.2.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
| [`bigdecimal::BigDecimal`] (v0.3.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
| [`bigdecimal::BigDecimal`] (v0.4.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
| [`bigdecimal::BigDecimal`] | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
| `num_bigint::{BigInt, BigUint}` | MySql int, uint or bytes parsed using `_::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql integer types but it'll be serialized anyway (as decimal bytes string). |

Also crate provides from-row convertion for the following list of types (see `FromRow` trait):
Expand All @@ -70,16 +68,13 @@ Also crate provides from-row convertion for the following list of types (see `Fr

| Feature | Description | Default |
| -------------- | ---------------------------------------------------- | ------- |
| `bigdecimal02` | Enables `bigdecimal` v0.2.x types support | 🔴 |
| `bigdecimal03` | Enables `bigdecimal` v0.3.x types support | 🔴 |
| `bigdecimal` | Enables `bigdecimal` v0.4.x types support | 🟢 |
| `bigdecimal` | Enables `bigdecimal` >=0.3.x, <0.5.x types support | 🔴 |
| `chrono` | Enables `chrono` types support | 🔴 |
| `rust_decimal` | Enables `rust_decimal` types support | 🟢 |
| `time02` | Enables `time` v0.2.x types support | 🔴 |
| `time` | Enables `time` v0.3.x types support | 🟢 |
| `frunk` | Enables `FromRow` for `frunk::Hlist!` types | 🟢 |
| `rust_decimal` | Enables `rust_decimal` types support | 🔴 |
| `time` | Enables `time` v0.3.x types support | 🔴 |
| `frunk` | Enables `FromRow` for `frunk::Hlist!` types | 🔴 |
| `derive` | Enables [`FromValue` and `FromRow` derive macros][2] | 🟢 |
| `binlog` | Binlog-related functionality | 🟢 |
| `binlog` | Binlog-related functionality | 🔴 |

## Derive Macros

Expand Down
2 changes: 1 addition & 1 deletion derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bench = false

[dependencies]
darling = "0.20.1"
heck = "0.4.0"
heck = "0.5.0"
num-bigint = "0.4.3"
proc-macro-crate = "3"
proc-macro-error2 = "2.0.1"
Expand Down
26 changes: 6 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@
//! | `mysql_common::Deserialized<T : DeserializeOwned>` | MySql bytes parsed using `serde_json::from_str` |
//! | `Option<T: FromValue>` | Must be used for nullable columns to avoid errors |
//! | [`decimal::Decimal`] | MySql int, uint or bytes parsed using `Decimal::from_str`.<br>⚠️ Note that this type doesn't support full range of MySql `DECIMAL` type. |
//! | [`bigdecimal::BigDecimal`] (v0.2.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
//! | [`bigdecimal::BigDecimal`] (v0.3.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
//! | [`bigdecimal::BigDecimal`] (v0.4.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
//! | [`bigdecimal::BigDecimal`] | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
//! | `num_bigint::{BigInt, BigUint}` | MySql int, uint or bytes parsed using `_::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql integer types but it'll be serialized anyway (as decimal bytes string). |
//!
//! Also crate provides from-row convertion for the following list of types (see `FromRow` trait):
Expand All @@ -70,16 +68,13 @@
//!
//! | Feature | Description | Default |
//! | -------------- | ---------------------------------------------------- | ------- |
//! | `bigdecimal02` | Enables `bigdecimal` v0.2.x types support | 🔴 |
//! | `bigdecimal03` | Enables `bigdecimal` v0.3.x types support | 🔴 |
//! | `bigdecimal` | Enables `bigdecimal` v0.4.x types support | 🟢 |
//! | `bigdecimal` | Enables `bigdecimal` >=0.3.x, <0.5.x types support | 🔴 |
//! | `chrono` | Enables `chrono` types support | 🔴 |
//! | `rust_decimal` | Enables `rust_decimal` types support | 🟢 |
//! | `time02` | Enables `time` v0.2.x types support | 🔴 |
//! | `time` | Enables `time` v0.3.x types support | 🟢 |
//! | `frunk` | Enables `FromRow` for `frunk::Hlist!` types | 🟢 |
//! | `rust_decimal` | Enables `rust_decimal` types support | 🔴 |
//! | `time` | Enables `time` v0.3.x types support | 🔴 |
//! | `frunk` | Enables `FromRow` for `frunk::Hlist!` types | 🔴 |
//! | `derive` | Enables [`FromValue` and `FromRow` derive macros][2] | 🟢 |
//! | `binlog` | Binlog-related functionality | 🟢 |
//! | `binlog` | Binlog-related functionality | 🔴 |
//!
//! # Derive Macros
//!
Expand Down Expand Up @@ -343,12 +338,6 @@ extern crate test;
#[macro_use]
pub mod bitflags_ext;

#[cfg(feature = "bigdecimal02")]
pub use bigdecimal02;

#[cfg(feature = "bigdecimal03")]
pub use bigdecimal03;

#[cfg(feature = "bigdecimal")]
pub use bigdecimal;

Expand All @@ -361,9 +350,6 @@ pub use frunk;
#[cfg(feature = "rust_decimal")]
pub use rust_decimal;

#[cfg(feature = "time02")]
pub use time02;

#[cfg(feature = "time")]
pub use time;

Expand Down
105 changes: 0 additions & 105 deletions src/value/convert/bigdecimal02.rs

This file was deleted.

105 changes: 0 additions & 105 deletions src/value/convert/bigdecimal03.rs

This file was deleted.

Loading

0 comments on commit e9566e9

Please sign in to comment.