From 3590611cc92386209cf78b2c670ed34300c85fbe Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Fri, 24 May 2024 14:50:25 +0200 Subject: [PATCH] Prepare a diesel 2.2 release --- .github/workflows/ci.yml | 10 ++- CHANGELOG.md | 64 ++++++++++++++++++- diesel/Cargo.toml | 31 +++++---- .../expression/functions/aggregate_folding.rs | 2 +- diesel/src/mysql/connection/bind.rs | 2 +- diesel/src/mysql/types/numeric.rs | 6 +- diesel/src/pg/types/mod.rs | 62 +++++++++++++----- diesel/src/pg/types/numeric.rs | 14 ++-- diesel/src/sqlite/types/numeric.rs | 4 +- diesel/src/type_impls/decimal.rs | 2 +- diesel_cli/Cargo.toml | 16 ++--- diesel_compile_tests/Cargo.lock | 10 +-- diesel_derives/Cargo.toml | 6 +- diesel_derives/src/lib.rs | 2 +- diesel_dynamic_schema/Cargo.toml | 6 +- diesel_migrations/Cargo.toml | 10 +-- .../migrations_internals/Cargo.toml | 6 +- .../migrations_macros/Cargo.toml | 5 +- diesel_table_macro_syntax/Cargo.toml | 4 +- diesel_tests/Cargo.toml | 6 +- dsl_auto_type/Cargo.toml | 3 +- 21 files changed, 186 insertions(+), 85 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef46d26be975..4d16478ee15f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ concurrency: jobs: check_and_test: name: Check - needs: [sqlite_bundled, rustfmt_and_clippy, postgres_bundled] + needs: [sqlite_bundled, rustfmt_and_clippy, postgres_bundled, mysql_bundled, typos] strategy: fail-fast: false matrix: @@ -449,7 +449,7 @@ jobs: RUSTDOCFLAGS: -Zsanitizer=address RUSTFLAGS: -Zsanitizer=address ASAN_OPTIONS: detect_stack_use_after_return=1 - run: cargo +stable -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "sqlite extras libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan" --target x86_64-unknown-linux-gnu + run: cargo +stable -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "sqlite extras __with_asan_tests" --target x86_64-unknown-linux-gnu postgres_bundled: name: Check postgres bundled + Postgres with asan @@ -491,7 +491,7 @@ jobs: RUSTDOCFLAGS: -Zsanitizer=address RUSTFLAGS: -Zsanitizer=address ASAN_OPTIONS: detect_stack_use_after_return=1 - run: cargo +stable -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "postgres pq-sys pq-sys/bundled pq-src/with-asan" --target x86_64-unknown-linux-gnu + run: cargo +stable -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "postgres extras __with_asan_tests" --target x86_64-unknown-linux-gnu mysql_bundled: name: Check mysql bundled + Mysql with asan @@ -543,7 +543,7 @@ jobs: LSAN_OPTIONS: suppressions=/tmp/suppr.txt run: | echo "leak:mysql_server_init" > /tmp/suppr.txt - cargo +stable -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "mysql mysqlclient-sys mysqlclient-sys/bundled mysqlclient-src/with-asan" --target x86_64-unknown-linux-gnu + cargo +stable -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "mysql extras __with_asan_tests" --target x86_64-unknown-linux-gnu minimal_rust_version: name: Check Minimal supported rust version (1.78.0) @@ -576,8 +576,6 @@ jobs: typos: name: Spell Check with Typos runs-on: ubuntu-latest - if: github.event_name == 'push' || !github.event.pull_request.draft - steps: - name: Checkout Actions Repository uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 703c2064adb3..a8183b1e4b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,11 @@ Increasing the minimal supported Rust version will always be coupled at least wi ## Unreleased +## [2.2.0] 2024-05-31 + ### Added -* Support `[print_schema] exclude_custom_type_definitions=["Vector"]`. If a `custom type` matches one element on the list it's skipped. +* Support `[print_schema] exclude_custom_type_definitions = ["Vector"]`. If a `custom type` matches one element on the list it's skipped. * Added automatic usage of all sqlite `rowid` aliases when no explicit primary key is defined for `print-schema` * Added a `#[dsl::auto_type]` attribute macro, allowing to infer type of query fragment functions * Added the same type inference on `Selectable` derives, which allows skipping specifying `select_expression_type` most of the time, in turn enabling most queries to be written using just a `Selectable` derive. @@ -23,6 +25,9 @@ Increasing the minimal supported Rust version will always be coupled at least wi * Add `sqlite-integer-primary-key-is-bigint` configuration option, usable with SQLite 3.37 or above, allowing to use `BigInt` for `INTEGER PRIMARY KEY` columns in SQLite for tables without the `WITHOUT ROWID` attribute ([SQLite doc](https://www.sqlite.org/lang_createtable.html#rowid)). * Support for multiple `print_schema` entry in `diesel.toml` (e.g. `[print_schema.user1]`), which allows generating multiple schema.rs files * Add support for `COPY TO` and `COPY FROM` statements +* Add support for mapping `chrono::Duration` to postgresql's `INTERVAL` sql type +* Added `serialize_database_to_buffer` and `deserialize_readonly_database_from_buffer` methods in `SqliteConnection` to support serialization/deserialization of SQLite databases to and from byte buffers. +* Added `SerializedDatabase` wrapper type for a serialized database that is dynamically allocated by calling `serialize_database_to_buffer`. This RAII wrapper deallocates the memory when it goes out of scope with `sqlite3_free`. ### Changed @@ -30,6 +35,54 @@ Increasing the minimal supported Rust version will always be coupled at least wi * Deprecated `sql_function!` in favour of `define_sql_function!` which provides compatibility with `#[dsl::auto_type]` * Deserialization error messages now contain information about the field that failed to deserialize +## [2.1.6] 2024-04-19 + +* Fix using `BoxableExpression` with having clauses +* Fix using numeric expressions with aliased fields +* Minor documentation fixes + +## [2.1.5] 2024-03-15 + +* Fix `impl SqlOrd` postgres > postgres_backend feature flag. +* Allow `Queryable` to be used with multiple table names. +* Fix an inconsistent unit test +* Fix a clippy lint +* Fix ./bin/test feature flag calls. +* Update `libsqlite3-sys` to allow version 0.28 as well + +## [2.1.4] 2023-11-14 + +* Update `libsqlite3-sys` to allow version 0.27 as well + +## [2.1.3] 2023-10-05 + +* Increased accidently decreased limit around element count in `DISTINCT ON` and `ORDER BY` clauses again as that broke existing code + +## [2.1.2] 2023-09-25 + +## Fixed + +* Fixed another potential breaking chaneg around queries containing `DISTINCT ON` and `ORDER BY` clauses consisting of custom sql expressions (e.g. `.nullable()`) +* Fixed an issue where `#[derive(Selectable)]` and `#[diesel(check_for_backend)]` generates invalid rust code if the struct contains lifetimes/generic types + +## [2.1.1] 2023-08-25 + +## Fixed + +* Fixed an issue in diesel-cli that lead to using unquoted table names in one of the internal queries +* Fixed a bug in `diesel print-schema` that lead to generating invalid `table!` macros if both the `#[sql_name]` and the `#[max_length]` attribute are present +* Fixed an issue in diesel-cli that lead to ignoring certain foreign key constraints for postgresql +* Fixed an crash while using `diesel print-schema` with really old sqlite versions +* Fixed an issue where `#[diesel(check_for_backend)]` ignored `#[diesel(deserialize_as)]` attributes +* Fixed several issues with the new `#[derive(MultiConnection)]` feature +* Fixed some edge cases in our sqlite timestamp parsing behaviour +* `diesel migration generate --diff-schema` now respects table filters as setup for `print-schema` via `diesel.toml` +* Fixed a potential breaking change around queries containing `DISTINCT ON` and `ORDER BY` clauses consisting of custom sql expressions (e.g. `diesel::dsl::sql`) + +## Added + +* Support for bigdecimal 0.4 + ## [2.1.0] 2023-05-26 ### Changed @@ -38,8 +91,6 @@ Increasing the minimal supported Rust version will always be coupled at least wi ### Added -* Added `serialize_database_to_buffer` and `deserialize_readonly_database_from_buffer` methods in `SqliteConnection` to support serialization/deserialization of SQLite databases to and from byte buffers. -* Added `SerializedDatabase` wrapper type for a serialized database that is dynamically allocated by calling `serialize_database_to_buffer`. This RAII wrapper deallocates the memory when it goes out of scope with `sqlite3_free`. * Added the `custom_type_derives` config option to customize the derives for SQL type definitions automatically generated by Diesel CLI. * Add a `#[derive(MultiConnection)]` proc-macro that lets you easily implement `diesel::Connection` @@ -2047,3 +2098,10 @@ queries or set `PIPES_AS_CONCAT` manually. [2.0.3]: https://github.com/diesel-rs/diesel/compare/v.2.0.2...v2.0.3 [2.0.4]: https://github.com/diesel-rs/diesel/compare/v.2.0.3...v2.0.4 [2.1.0]: https://github.com/diesel-rs/diesel/compare/v.2.0.0...v2.1.0 +[2.1.1]: https://github.com/diesel-rs/diesel/compare/v.2.1.0...v2.1.1 +[2.1.2]: https://github.com/diesel-rs/diesel/compare/v.2.1.1...v2.1.2 +[2.1.3]: https://github.com/diesel-rs/diesel/compare/v.2.1.2...v2.1.3 +[2.1.4]: https://github.com/diesel-rs/diesel/compare/v.2.1.3...v2.1.4 +[2.1.5]: https://github.com/diesel-rs/diesel/compare/v.2.1.4...v2.1.5 +[2.1.6]: https://github.com/diesel-rs/diesel/compare/v.2.1.5...v2.1.6 +[2.2.0]: https://github.com/diesel-rs/diesel/compare/v.2.1.0...v2.2.0 diff --git a/diesel/Cargo.toml b/diesel/Cargo.toml index e7041477669a..decfaa2b76c8 100644 --- a/diesel/Cargo.toml +++ b/diesel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diesel" -version = "2.1.4" +version = "2.2.0" license = "MIT OR Apache-2.0" description = "A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL" readme = "README.md" @@ -11,6 +11,7 @@ keywords = ["orm", "database", "sql"] categories = ["database"] edition = "2021" rust-version.workspace = true +include = ["src/**.rs", "tests/**.rs", "LICENSE-*", "README.md"] [dependencies] byteorder = { version = "1.0", optional = true } @@ -20,7 +21,7 @@ libsqlite3-sys = { version = ">=0.17.2, <0.29.0", optional = true, features = [" mysqlclient-sys = { version = ">=0.2.5, <0.4.0", optional = true } mysqlclient-src = { version = "0.1.0", optional = true } pq-sys = { version = ">=0.4.0, <0.7.0", optional = true } -pq-src = { version = "0.1", optional = true } +pq-src = { version = "0.2", optional = true } quickcheck = { version = "1.0.3", optional = true } serde_json = { version = ">=0.8.0, <2.0", optional = true } url = { version = "2.1.0", optional = true } @@ -38,7 +39,7 @@ itoa = { version = "1.0.0", optional = true } time = { version = "0.3.9", optional = true, features = ["macros"] } [dependencies.diesel_derives] -version = "~2.1.0" +version = "~2.2.0" path = "../diesel_derives" [dev-dependencies] @@ -56,21 +57,29 @@ huge-tables = ["64-column-tables"] 32-column-tables = ["diesel_derives/32-column-tables"] 64-column-tables = ["32-column-tables", "diesel_derives/64-column-tables"] 128-column-tables = ["64-column-tables", "diesel_derives/128-column-tables"] -postgres = ["pq-sys", "postgres_backend"] -sqlite = ["libsqlite3-sys", "diesel_derives/sqlite", "time?/formatting", "time?/parsing"] -mysql = ["mysqlclient-sys", "url", "percent-encoding", "bitflags", "mysql_backend"] +postgres = ["dep:pq-sys", "postgres_backend"] +sqlite = ["dep:libsqlite3-sys", "diesel_derives/sqlite", "time?/formatting", "time?/parsing"] +mysql = ["dep:mysqlclient-sys", "dep:url", "dep:percent-encoding", "dep:bitflags", "mysql_backend"] without-deprecated = ["diesel_derives/without-deprecated"] with-deprecated = ["diesel_derives/with-deprecated"] -network-address = ["ipnetwork", "libc"] -ipnet-address = ["ipnet", "libc"] -numeric = ["num-bigint", "bigdecimal", "num-traits", "num-integer"] -postgres_backend = ["diesel_derives/postgres", "bitflags", "byteorder", "itoa"] -mysql_backend = ["diesel_derives/mysql", "byteorder"] +network-address = ["dep:ipnetwork", "dep:libc"] +ipnet-address = ["dep:ipnet", "dep:libc"] +numeric = ["dep:num-bigint", "dep:bigdecimal", "dep:num-traits", "dep:num-integer"] +postgres_backend = ["diesel_derives/postgres", "dep:bitflags", "dep:byteorder", "dep:itoa"] +mysql_backend = ["diesel_derives/mysql", "dep:byteorder"] returning_clauses_for_sqlite_3_35 = [] i-implement-a-third-party-backend-and-opt-into-breaking-changes = [] r2d2 = ["diesel_derives/r2d2", "dep:r2d2"] chrono = ["diesel_derives/chrono", "dep:chrono"] time = ["diesel_derives/time", "dep:time"] +__with_asan_tests = [ + "libsqlite3-sys?/bundled", + "libsqlite3-sys?/with-asan", + "pq-sys?/bundled", + "pq-src?/with-asan", + "mysqlclient-sys?/bundled", + "mysqlclient-src?/with-asan", +] [package.metadata.docs.rs] features = ["postgres", "mysql", "sqlite", "extras"] diff --git a/diesel/src/expression/functions/aggregate_folding.rs b/diesel/src/expression/functions/aggregate_folding.rs index 7d0f3732072e..ae1b06ff5627 100644 --- a/diesel/src/expression/functions/aggregate_folding.rs +++ b/diesel/src/expression/functions/aggregate_folding.rs @@ -30,7 +30,7 @@ define_sql_function! { /// ```rust /// # include!("../../doctest_setup.rs"); /// # use diesel::dsl::*; - /// # #[cfg(feature = "bigdecimal")] + /// # #[cfg(feature = "numeric")] /// # extern crate bigdecimal; /// # /// # fn main() { diff --git a/diesel/src/mysql/connection/bind.rs b/diesel/src/mysql/connection/bind.rs index 39a6038bdce2..3b85c7665351 100644 --- a/diesel/src/mysql/connection/bind.rs +++ b/diesel/src/mysql/connection/bind.rs @@ -747,7 +747,7 @@ mod tests { use crate::mysql::connection::stmt::Statement; use crate::prelude::*; use crate::sql_types::*; - #[cfg(feature = "bigdecimal")] + #[cfg(feature = "numeric")] use std::str::FromStr; fn to_value( diff --git a/diesel/src/mysql/types/numeric.rs b/diesel/src/mysql/types/numeric.rs index c15b39ad6d69..8e72bf82c27e 100644 --- a/diesel/src/mysql/types/numeric.rs +++ b/diesel/src/mysql/types/numeric.rs @@ -1,4 +1,4 @@ -#[cfg(feature = "bigdecimal")] +#[cfg(feature = "numeric")] mod bigdecimal { use bigdecimal::{BigDecimal, FromPrimitive}; use std::io::prelude::*; @@ -8,7 +8,7 @@ mod bigdecimal { use crate::serialize::{self, IsNull, Output, ToSql}; use crate::sql_types::Numeric; - #[cfg(all(feature = "mysql_backend", feature = "bigdecimal"))] + #[cfg(all(feature = "mysql_backend", feature = "numeric"))] impl ToSql for BigDecimal { fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> serialize::Result { write!(out, "{}", *self) @@ -17,7 +17,7 @@ mod bigdecimal { } } - #[cfg(all(feature = "mysql_backend", feature = "bigdecimal"))] + #[cfg(all(feature = "mysql_backend", feature = "numeric"))] impl FromSql for BigDecimal { fn from_sql(value: MysqlValue<'_>) -> deserialize::Result { match value.numeric_value()? { diff --git a/diesel/src/pg/types/mod.rs b/diesel/src/pg/types/mod.rs index 2ccafccd9335..aa02b011deff 100644 --- a/diesel/src/pg/types/mod.rs +++ b/diesel/src/pg/types/mod.rs @@ -428,20 +428,35 @@ pub mod sql_types { /// /// ### [`ToSql`] impls /// - #[cfg_attr(feature = "ipnetwork", doc = " - [`ipnetwork::IpNetwork`][IpNetwork]")] - #[cfg_attr(feature = "ipnet", doc = " - [`ipnet::IpNet`][IpNet]")] - #[cfg_attr(not(any(feature = "ipnetwork", feature = "ipnet")), doc = "N/A")] + #[cfg_attr( + feature = "network-address", + doc = " - [`ipnetwork::IpNetwork`][IpNetwork]" + )] + #[cfg_attr(feature = "ipnet-address", doc = " - [`ipnet::IpNet`][IpNet]")] + #[cfg_attr( + not(any(feature = "network-address", feature = "ipnet-address")), + doc = "N/A" + )] /// /// ### [`FromSql`] impls /// - #[cfg_attr(feature = "ipnetwork", doc = " - [`ipnetwork::IpNetwork`][IpNetwork]")] - #[cfg_attr(feature = "ipnet", doc = " - [`ipnet::IpNet`][IpNet]")] - #[cfg_attr(not(any(feature = "ipnetwork", feature = "ipnet")), doc = "N/A")] + #[cfg_attr( + feature = "network-address", + doc = " - [`ipnetwork::IpNetwork`][IpNetwork]" + )] + #[cfg_attr(feature = "ipnet-address", doc = " - [`ipnet::IpNet`][IpNet]")] + #[cfg_attr( + not(any(feature = "network-address", feature = "ipnet-address")), + doc = "N/A" + )] /// /// [`ToSql`]: crate::serialize::ToSql /// [`FromSql`]: crate::deserialize::FromSql - #[cfg_attr(feature = "ipnetwork", doc = " [IpNetwork]: ipnetwork::IpNetwork")] - #[cfg_attr(feature = "ipnet", doc = " [IpNet]: ipnet::IpNet")] + #[cfg_attr( + feature = "network-address", + doc = " [IpNetwork]: ipnetwork::IpNetwork" + )] + #[cfg_attr(feature = "ipnet-address", doc = " [IpNet]: ipnet::IpNet")] /// /// # Examples /// @@ -487,20 +502,35 @@ pub mod sql_types { /// /// ### [`ToSql`] impls /// - #[cfg_attr(feature = "ipnetwork", doc = " - [`ipnetwork::IpNetwork`][IpNetwork]")] - #[cfg_attr(feature = "ipnet", doc = " - [`ipnet::IpNet`][IpNet]")] - #[cfg_attr(not(any(feature = "ipnetwork", feature = "ipnet")), doc = "N/A")] + #[cfg_attr( + feature = "network-address", + doc = " - [`ipnetwork::IpNetwork`][IpNetwork]" + )] + #[cfg_attr(feature = "ipnet-address", doc = " - [`ipnet::IpNet`][IpNet]")] + #[cfg_attr( + not(any(feature = "network-address", feature = "ipnet-address")), + doc = "N/A" + )] /// /// ### [`FromSql`] impls /// - #[cfg_attr(feature = "ipnetwork", doc = " - [`ipnetwork::IpNetwork`][IpNetwork]")] - #[cfg_attr(feature = "ipnet", doc = " - [`ipnet::IpNet`][IpNet]")] - #[cfg_attr(not(any(feature = "ipnetwork", feature = "ipnet")), doc = "N/A")] + #[cfg_attr( + feature = "network-address", + doc = " - [`ipnetwork::IpNetwork`][IpNetwork]" + )] + #[cfg_attr(feature = "ipnet-address", doc = " - [`ipnet::IpNet`][IpNet]")] + #[cfg_attr( + not(any(feature = "network-address", feature = "ipnet-address")), + doc = "N/A" + )] /// /// [`ToSql`]: crate::serialize::ToSql /// [`FromSql`]: crate::deserialize::FromSql - #[cfg_attr(feature = "ipnetwork", doc = " [IpNetwork]: ipnetwork::IpNetwork")] - #[cfg_attr(feature = "ipnet", doc = " [IpNet]: ipnet::IpNet")] + #[cfg_attr( + feature = "network-address", + doc = " [IpNetwork]: ipnetwork::IpNetwork" + )] + #[cfg_attr(feature = "ipnet-address", doc = " [IpNet]: ipnet::IpNet")] /// /// # Examples /// diff --git a/diesel/src/pg/types/numeric.rs b/diesel/src/pg/types/numeric.rs index e4f0e177fbc2..7530b5917b8a 100644 --- a/diesel/src/pg/types/numeric.rs +++ b/diesel/src/pg/types/numeric.rs @@ -1,4 +1,4 @@ -#[cfg(feature = "bigdecimal")] +#[cfg(feature = "numeric")] mod bigdecimal { extern crate bigdecimal; extern crate num_bigint; @@ -36,7 +36,7 @@ mod bigdecimal { } } - #[cfg(all(feature = "postgres_backend", feature = "bigdecimal"))] + #[cfg(all(feature = "postgres_backend", feature = "numeric"))] impl<'a> TryFrom<&'a PgNumeric> for BigDecimal { type Error = Box; @@ -71,7 +71,7 @@ mod bigdecimal { } } - #[cfg(all(feature = "postgres_backend", feature = "bigdecimal"))] + #[cfg(all(feature = "postgres_backend", feature = "numeric"))] impl TryFrom for BigDecimal { type Error = Box; @@ -80,7 +80,7 @@ mod bigdecimal { } } - #[cfg(all(feature = "postgres_backend", feature = "bigdecimal"))] + #[cfg(all(feature = "postgres_backend", feature = "numeric"))] impl<'a> From<&'a BigDecimal> for PgNumeric { // NOTE(clippy): No `std::ops::MulAssign` impl for `BigInt` // NOTE(clippy): Clippy suggests to replace the `.take_while(|i| i.is_zero())` @@ -139,14 +139,14 @@ mod bigdecimal { } } - #[cfg(all(feature = "postgres_backend", feature = "bigdecimal"))] + #[cfg(all(feature = "postgres_backend", feature = "numeric"))] impl From for PgNumeric { fn from(bigdecimal: BigDecimal) -> Self { (&bigdecimal).into() } } - #[cfg(all(feature = "postgres_backend", feature = "bigdecimal"))] + #[cfg(all(feature = "postgres_backend", feature = "numeric"))] impl ToSql for BigDecimal { fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> serialize::Result { let numeric = PgNumeric::from(self); @@ -154,7 +154,7 @@ mod bigdecimal { } } - #[cfg(all(feature = "postgres_backend", feature = "bigdecimal"))] + #[cfg(all(feature = "postgres_backend", feature = "numeric"))] impl FromSql for BigDecimal { fn from_sql(numeric: PgValue<'_>) -> deserialize::Result { PgNumeric::from_sql(numeric)?.try_into() diff --git a/diesel/src/sqlite/types/numeric.rs b/diesel/src/sqlite/types/numeric.rs index 65ac3b5cd9c4..15b9b15513c7 100644 --- a/diesel/src/sqlite/types/numeric.rs +++ b/diesel/src/sqlite/types/numeric.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "bigdecimal")] +#![cfg(feature = "numeric")] use bigdecimal::{BigDecimal, FromPrimitive}; @@ -7,7 +7,7 @@ use crate::sql_types::{Double, Numeric}; use crate::sqlite::connection::SqliteValue; use crate::sqlite::Sqlite; -#[cfg(all(feature = "sqlite", feature = "bigdecimal"))] +#[cfg(all(feature = "sqlite", feature = "numeric"))] impl FromSql for BigDecimal { fn from_sql(bytes: SqliteValue<'_, '_, '_>) -> deserialize::Result { let x = >::from_sql(bytes)?; diff --git a/diesel/src/type_impls/decimal.rs b/diesel/src/type_impls/decimal.rs index 5507fb272cac..f346ae60eafb 100644 --- a/diesel/src/type_impls/decimal.rs +++ b/diesel/src/type_impls/decimal.rs @@ -1,6 +1,6 @@ #![allow(dead_code)] -#[cfg(feature = "bigdecimal")] +#[cfg(feature = "numeric")] mod bigdecimal { extern crate bigdecimal; use self::bigdecimal::BigDecimal; diff --git a/diesel_cli/Cargo.toml b/diesel_cli/Cargo.toml index 78585e1ab3db..2ce4a0c2c306 100644 --- a/diesel_cli/Cargo.toml +++ b/diesel_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diesel_cli" -version = "2.1.0" +version = "2.2.0" license = "MIT OR Apache-2.0" description = "Provides the CLI for the Diesel crate" readme = "README.md" @@ -10,7 +10,7 @@ repository = "https://github.com/diesel-rs/diesel" keywords = ["diesel", "migrations", "cli"] autotests = false edition = "2021" -include = ["src/**/*", "LICENSE-*", "README.md"] +include = ["src/**.rs", "tests/**.rs", "LICENSE-*", "README.md"] rust-version.workspace = true [package.metadata.wix] @@ -41,19 +41,19 @@ mysqlclient-sys = { version = ">=0.2.5, <0.4.0", optional = true } diffy = "0.3.0" regex = "1.0.6" serde_regex = "1.1" -diesel_table_macro_syntax = { version = "0.1", path = "../diesel_table_macro_syntax" } +diesel_table_macro_syntax = { version = "0.2", path = "../diesel_table_macro_syntax" } syn = { version = "2", features = ["visit"] } tracing = "0.1" tracing-subscriber = { version = "0.3.10", features = ["env-filter"] } thiserror = "1.0.10" [dependencies.diesel] -version = "~2.1.0" +version = "~2.2.0" path = "../diesel" default-features = false [dependencies.diesel_migrations] -version = "~2.1.0" +version = "~2.2.0" path = "../diesel_migrations/" [dev-dependencies] @@ -66,9 +66,9 @@ default = ["postgres", "sqlite", "mysql"] postgres = ["diesel/postgres", "uses_information_schema"] sqlite = ["diesel/sqlite"] mysql = ["diesel/mysql", "uses_information_schema"] -sqlite-bundled = ["sqlite", "libsqlite3-sys/bundled"] -postgres-bundled = ["postgres", "pq-sys/bundled"] -mysql-bundled = ["mysql", "mysqlclient-sys/bundled"] +sqlite-bundled = ["sqlite", "dep:libsqlite3-sys", "libsqlite3-sys/bundled"] +postgres-bundled = ["postgres", "dep:pq-sys", "pq-sys/bundled", "dep:openssl-sys"] +mysql-bundled = ["mysql", "dep:mysqlclient-sys", "mysqlclient-sys/bundled"] uses_information_schema = [] [[test]] diff --git a/diesel_compile_tests/Cargo.lock b/diesel_compile_tests/Cargo.lock index f1e606195d87..f0856d0eee0b 100644 --- a/diesel_compile_tests/Cargo.lock +++ b/diesel_compile_tests/Cargo.lock @@ -130,7 +130,7 @@ dependencies = [ [[package]] name = "diesel" -version = "2.1.4" +version = "2.2.0" dependencies = [ "bigdecimal", "bitflags", @@ -164,7 +164,7 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.0" +version = "2.2.0" dependencies = [ "diesel_table_macro_syntax", "dsl_auto_type", @@ -175,7 +175,7 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.1.0" +version = "0.2.0" dependencies = [ "syn", ] @@ -233,9 +233,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "iana-time-zone" diff --git a/diesel_derives/Cargo.toml b/diesel_derives/Cargo.toml index 3a3ab48d7049..dfd671aeb8e8 100644 --- a/diesel_derives/Cargo.toml +++ b/diesel_derives/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "diesel_derives" -version = "2.1.0" +version = "2.2.0" license = "MIT OR Apache-2.0" description = "You should not use this crate directly, it is internal to Diesel." documentation = "https://diesel.rs/guides/" homepage = "https://diesel.rs" repository = "https://github.com/diesel-rs/diesel/" autotests = false -include = ["src/**/*", "LICENSE-*"] +include = ["src/**.rs", "tests/**.rs", "LICENSE-*", "README.md"] rust-version.workspace = true edition = "2021" @@ -15,7 +15,7 @@ edition = "2021" syn = { version = "2.0", features = ["derive", "fold", "full"] } quote = "1.0.9" proc-macro2 = "1.0.27" -diesel_table_macro_syntax = {version = "0.1", path = "../diesel_table_macro_syntax"} +diesel_table_macro_syntax = {version = "0.2", path = "../diesel_table_macro_syntax"} dsl_auto_type = { version = "0.1", path = "../dsl_auto_type" } [dev-dependencies] diff --git a/diesel_derives/src/lib.rs b/diesel_derives/src/lib.rs index 2a803bd52dbf..2c909941de92 100644 --- a/diesel_derives/src/lib.rs +++ b/diesel_derives/src/lib.rs @@ -1786,7 +1786,7 @@ pub fn derive_multiconnection(input: TokenStream) -> TokenStream { /// * Query constructed by `diesel::sql_query` /// * Expressions using `diesel::dsl::sql` /// -/// For this cases a manual type annotation is required. See the "Annotating Types" section below +/// For these cases a manual type annotation is required. See the "Annotating Types" section below /// for details. /// /// diff --git a/diesel_dynamic_schema/Cargo.toml b/diesel_dynamic_schema/Cargo.toml index e5762169f72e..97fb0a7dec77 100644 --- a/diesel_dynamic_schema/Cargo.toml +++ b/diesel_dynamic_schema/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diesel-dynamic-schema" -version = "0.2.1" +version = "0.2.2" license = "MIT OR Apache-2.0" edition = "2018" autotests = false @@ -10,11 +10,11 @@ homepage = "https://diesel.rs" repository = "https://github.com/diesel-rs/diesel" keywords = ["orm", "database", "sql"] categories = ["database"] -include = ["src/**/*", "LICENSE-*", "README.md"] +include = ["src/**.rs", "tests/**.rs", "LICENSE-*", "README.md"] rust-version.workspace = true [dependencies.diesel] -version = "~2.1.0" +version = "~2.2.0" path = "../diesel/" default-features = false diff --git a/diesel_migrations/Cargo.toml b/diesel_migrations/Cargo.toml index 7eab8bf19a58..195124109909 100644 --- a/diesel_migrations/Cargo.toml +++ b/diesel_migrations/Cargo.toml @@ -1,20 +1,22 @@ [package] name = "diesel_migrations" -version = "2.1.0" +version = "2.2.0" license = "MIT OR Apache-2.0" description = "Migration management for diesel" documentation = "https://docs.rs/crate/diesel_migrations" homepage = "https://diesel.rs" repository = "https://github.com/diesel-rs/diesel" edition = "2021" +include = ["src/**.rs", "tests/**.rs", "LICENSE-*", "README.md"] rust-version.workspace = true +categories = ["database"] [dependencies.migrations_internals] -version = "~2.1.0" +version = "~2.2.0" path = "migrations_internals" [dependencies.migrations_macros] -version = "~2.1.0" +version = "~2.2.0" path = "migrations_macros" [dev-dependencies] @@ -23,7 +25,7 @@ cfg-if = "1.0.0" tempfile = "3.2" [dependencies.diesel] -version = "~2.1.0" +version = "~2.2.0" path = "../diesel" default-features = false diff --git a/diesel_migrations/migrations_internals/Cargo.toml b/diesel_migrations/migrations_internals/Cargo.toml index 11e11f7cfb12..63ceb55d3fc8 100644 --- a/diesel_migrations/migrations_internals/Cargo.toml +++ b/diesel_migrations/migrations_internals/Cargo.toml @@ -1,13 +1,15 @@ [package] name = "migrations_internals" -version = "2.1.0" +version = "2.2.0" license = "MIT OR Apache-2.0" description = "Internal implementation of diesels migration mechanism" homepage = "https://diesel.rs" repository = "https://github.com/diesel-rs/diesel" rust-version.workspace = true +include = ["src/**.rs", "tests/**.rs", "LICENSE-*"] edition = "2021" +keywords = ["diesel", "internal"] [dependencies] -serde = {version = "1", features = ["derive"]} +serde = {version = "1.0.0", features = ["derive"]} toml = "0.8" diff --git a/diesel_migrations/migrations_macros/Cargo.toml b/diesel_migrations/migrations_macros/Cargo.toml index 57d242137636..0fcb63b43aa5 100644 --- a/diesel_migrations/migrations_macros/Cargo.toml +++ b/diesel_migrations/migrations_macros/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "migrations_macros" -version = "2.1.0" +version = "2.2.0" license = "MIT OR Apache-2.0" description = "Codegeneration macros for diesels embedded migrations" homepage = "https://diesel.rs" repository = "https://github.com/diesel-rs/diesel" edition = "2021" +include = ["src/**.rs", "tests/**.rs", "LICENSE-*"] rust-version.workspace = true [dependencies] @@ -13,7 +14,7 @@ quote = "1" proc-macro2 = "1" [dependencies.migrations_internals] -version = "~2.1.0" +version = "~2.2.0" path = "../migrations_internals" [dev-dependencies] diff --git a/diesel_table_macro_syntax/Cargo.toml b/diesel_table_macro_syntax/Cargo.toml index 1d0ab1485284..811dadedca9a 100644 --- a/diesel_table_macro_syntax/Cargo.toml +++ b/diesel_table_macro_syntax/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "diesel_table_macro_syntax" -version = "0.1.0" +version = "0.2.0" description = "Internal diesel crate" license = "MIT OR Apache-2.0" documentation = "https://diesel.rs/guides/" homepage = "https://diesel.rs" repository = "https://github.com/diesel-rs/diesel/" autotests = false -include = ["src/**/*", "LICENSE-*"] +include = ["src/**.rs", "tests/**.rs", "LICENSE-*"] rust-version.workspace = true edition = "2021" diff --git a/diesel_tests/Cargo.toml b/diesel_tests/Cargo.toml index a36f76bab118..512d6d712100 100644 --- a/diesel_tests/Cargo.toml +++ b/diesel_tests/Cargo.toml @@ -22,9 +22,9 @@ ipnetwork = ">=0.12.2, <0.21.0" bigdecimal = ">= 0.0.13, < 0.5.0" rand = "0.8.4" libsqlite3-sys = { version = "0.28", optional = true } -pq-sys = { version = "0.5", optional = true } -pq-src = { version = "0.1.1", optional = true } -mysqlclient-sys = { version = ">=0.2.5, <0.4.0", optional = true } +pq-sys = { version = "0.6", optional = true } +pq-src = { version = "0.2", optional = true } +mysqlclient-sys = { version = "0.3", optional = true } mysqlclient-src = { version = "0.1.0", optional = true } [features] diff --git a/dsl_auto_type/Cargo.toml b/dsl_auto_type/Cargo.toml index 591a99d39781..257ba1e72339 100644 --- a/dsl_auto_type/Cargo.toml +++ b/dsl_auto_type/Cargo.toml @@ -7,11 +7,12 @@ documentation = "https://docs.rs/crate/diesel_migrations" homepage = "https://diesel.rs" edition = "2021" rust-version.workspace = true +include = ["src/**.rs", "tests/**.rs", "LICENSE-*"] [dependencies] darling = "0.20" either = "1" -heck = "0.4" +heck = "0.5" proc-macro2 = "1" quote = "1" syn = { version = "2", features = ["extra-traits", "full", "derive", "parsing"] }