diff --git a/CHANGELOG.md b/CHANGELOG.md index 21ad992d2b26..5a6fe4c1448a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,21 @@ All user visible changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/), as described for Rust libraries in [RFC #1105](https://github.com/rust-lang/rfcs/blob/master/text/1105-api-evolution.md) -For any named minimal supported Rust version we guarantee that it is possible to build Diesel with the -default features enabled using some set of dependencies. Those set of dependencies is not necessarily -an up to date version of the specific dependency. We check this by using the unstable `-Z minimal-version` cargo flag. +For any named minimal supported Rust version we guarantee that it is possible to build Diesel with the +default features enabled using some set of dependencies. Those set of dependencies is not necessarily +an up to date version of the specific dependency. We check this by using the unstable `-Z minimal-version` cargo flag. Increasing the minimal supported Rust version will always be coupled at least with a minor release. ## Unreleased +## [2.1.5] 2024-03-09 + +* 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. + ## [2.1.4] 2023-11-14 * Update `libsqlite3-sys` to allow version 0.27 as well @@ -23,7 +31,7 @@ Increasing the minimal supported Rust version will always be coupled at least wi ## 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 +* 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 @@ -36,17 +44,16 @@ Increasing the minimal supported Rust version will always be coupled at least wi * 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` +* `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 +## Added * Support for bigdecimal 0.4 - ## [2.1.0] 2023-05-26 -### Changed +### Changed * The minimal officially supported rustc version is now 1.65.0 @@ -66,7 +73,7 @@ Increasing the minimal supported Rust version will always be coupled at least wi ## [2.0.4] 2023-04-18 -## Fixed +## Fixed * Workaround the missing name resolution in rust-analyzer. This should fix type inference for some diesel queries. (It remains broken for queries containing `.filter()`/`.inner_join()`/`.left_join()`. These require fixes in rust-analyzer itself) * Fixed a bug that could lead to inserting null values instead of empty values for custom sqlite types @@ -77,9 +84,9 @@ Increasing the minimal supported Rust version will always be coupled at least wi * Support for `libsqlite3-sys` 0.26 -## [diesel_derives 2.0.2] 2023-03-13 +## [diesel_derives 2.0.2] 2023-03-13 -## Fixed +## Fixed * Fixing the fallout of a breaking change from `quote` by not using their internal API @@ -148,7 +155,7 @@ Increasing the minimal supported Rust version will always be coupled at least wi in such a way to support constructing a dynamic value depending on this type. * Added a `without-deprecated` feature that unconditionally disables deprecated items. - Use this feature flag to verify that none of your dependencies is setting + Use this feature flag to verify that none of your dependencies is setting the `with-deprecated` flag internally. * Added support for PostgreSQL's `SIMILAR TO` and `NOT SIMILAR TO`. @@ -172,7 +179,7 @@ Increasing the minimal supported Rust version will always be coupled at least wi * Diesel CLI will now generate SQL type definitions for SQL types that are not supported by diesel out of the box. It's possible to disable this behavior via the `generate_missing_sql_type_definitions` config option. -* Added an option to `#[derive(Insertable)]` that let you insert `NULL` values instead of `DEFAULT` values for `Option` +* Added an option to `#[derive(Insertable)]` that let you insert `NULL` values instead of `DEFAULT` values for `Option` * Added support for all the derive attributes being inside `#[diesel(...)]` @@ -277,12 +284,12 @@ Increasing the minimal supported Rust version will always be coupled at least wi card implementations for types implementing `Queryable` or `QueryableByName` so non generic code does not require any change. For generic code you likely need to replace a trait bound on `Queryable` with a trait bound on `FromSqlRow` - and a bound to `QueryableByName` with `FromSqlRow`. + and a bound to `QueryableByName` with `FromSqlRow`. * CLI flags of `only-tables` and `except-tables` are now interpreted as regular expressions. Similarly, `only_tabels` and `except_tables` in `diesel.toml` are treated as regular expressions. -* Now you can sort column fields by name with the `column-sorting` option. +* Now you can sort column fields by name with the `column-sorting` option. It can be set to either `ordinal_position` (default) or `name`. This ensures stable sorting even if columns are removed and re-added. @@ -295,25 +302,25 @@ Increasing the minimal supported Rust version will always be coupled at least wi * `TypeMetadata::MetadataLookup` is now `?Sized`. -* Multiple implementations of `Connection` are now possible +* Multiple implementations of `Connection` are now possible because of the new `PgMetadataLookup` trait. * For the `Pg` backend, `TypeMetadata::MetadataLookup` has changed to `dyn PgMetadataLookup`. -* Diesel's migration framework was rewritten from the ground. Existing migrations continue to +* Diesel's migration framework was rewritten from the ground. Existing migrations continue to be compatible with the rewrite, but code calling into `diesel_migrations` requires an update. See the [migration guide](2-0-migration) for details. * `eq_any()` now emits a `= ANY()` expression for the postgresql backend instead of `IN()` * `ne_all()` now emits a `!= ALL()` expression for the postgresql backend instead of `NOT IN()` -* The sqlite backend now uses a single batch insert statement if there are now default values present +* The sqlite backend now uses a single batch insert statement if there are now default values present in the values clause * The MySQL connection is using the CLIENT_FOUND_ROWS from now on. This means that updating rows without changing any values will return the number of matched rows (like most other SQL servers do), as opposed to the number of changed rows. -* The definition of `ToSql::to_sql` and `QueryFragment::walk_ast` has changed to allow serializing values without +* The definition of `ToSql::to_sql` and `QueryFragment::walk_ast` has changed to allow serializing values without copying the value itself. This is useful for database backends like sqlite where you can directly share a buffer - with the database. Beside of the changed signature, existing impls of this trait should remain unchanged in almost + with the database. Beside of the changed signature, existing impls of this trait should remain unchanged in almost all cases. * The `PIPES_AS_CONCAT` sql_mode is no longer set @@ -360,14 +367,14 @@ queries or set `PIPES_AS_CONCAT` manually. * We've refactored our type level representation of nullable values. This allowed us to fix multiple long standing bugs regarding the correct handling of nullable values in some corner cases (#104, #2274) - + * Parenthesis are now inserted around all infix operations provided by diesel's `ExpressionMethods` traits * Queries containing a `distinct on` clause check now on compile time that a compatible order clause was set. * Implementations of custom SQLite SQL functions now check for panics -* `diesel print-schema` now generates `Array>` rather than `Array` for Postgres Array types. Existence of +* `diesel print-schema` now generates `Array>` rather than `Array` for Postgres Array types. Existence of `NULL` values in database arrays would previously result in deserialization errors. Non-nullable arrays are now opt in (by schema patching). @@ -381,10 +388,9 @@ queries or set `PIPES_AS_CONCAT` manually. * `diesel::pg::upsert` has been deprecated to support upsert queries on more than one backend. Please use `diesel::upsert` instead. - -* `diesel::dsl::any` and `diesel::dsl::all` are now deprecated in - favour of `ExpressionMethods::eq_any()` and `ExpressionMethods::ne_all()` +* `diesel::dsl::any` and `diesel::dsl::all` are now deprecated in + favour of `ExpressionMethods::eq_any()` and `ExpressionMethods::ne_all()` [2-0-migration]: https://github.com/diesel-rs/diesel/blob/master/guide_drafts/migration_guide.md @@ -437,7 +443,6 @@ queries or set `PIPES_AS_CONCAT` manually. * Fixed issue where rustdoc failed to build the documentation * `diesel_derives` and `diesel_migrations` are updated to syn 1.0 - ## [1.4.2] - 2019-03-19 ### Fixed @@ -1564,7 +1569,7 @@ queries or set `PIPES_AS_CONCAT` manually. * Added partial support for composite primary keys. * Added support for PostgreSQL `NULLS FIRST` and `NULLS LAST` when sorting. - See https://docs.diesel.rs/diesel/prelude/trait.SortExpressionMethods.html + See for details. * Added support for the `timestamp with time zone` type in PostgreSQL (referred @@ -1634,22 +1639,22 @@ queries or set `PIPES_AS_CONCAT` manually. * The `Insertable!` macro can now be used instead of `#[insertable_into]` for those wishing to avoid syntax extensions from `diesel_codegen`. See - https://docs.diesel.rs/diesel/macro.Insertable!.html for details. + for details. * The `Queryable!` macro can now be used instead of `#[derive(Queryable)]` for those wishing to avoid syntax extensions from `diesel_codegen`. See - https://docs.diesel.rs/diesel/macro.Queryable!.html for details. + for details. * The `Identifiable!` macro can now be used instead of `#[derive(Identifiable)]` for those wishing to avoid syntax extensions from `diesel_codegen`. See - https://docs.diesel.rs/diesel/macro.Identifiable!.html for details. + for details. * The `AsChangeset!` macro can now be used instead of `#[changeset_for(table)]` for those wishing to avoid syntax extensions from `diesel_codegen`. See - https://docs.diesel.rs/diesel/macro.AsChangeset!.html for details. + for details. * Added support for the PostgreSQL `ALL` operator. See - https://docs.diesel.rs/diesel/pg/expression/dsl/fn.all.html for details. + for details. * Added support for `RETURNING` expressions in `DELETE` statements. Implicitly these queries will use `RETURNING *`. @@ -1676,8 +1681,8 @@ queries or set `PIPES_AS_CONCAT` manually. `#[column_name(name)]`. * The structure of `DatabaseError` has changed to hold more information. See - https://docs.diesel.rs/diesel/result/enum.Error.html and - https://docs.diesel.rs/diesel/result/trait.DatabaseErrorInformation.html for + and + for more information * Structs which implement `Identifiable` can now be passed to `update` and diff --git a/diesel/Cargo.toml b/diesel/Cargo.toml index 4939e9c7c182..ccbf86401959 100644 --- a/diesel/Cargo.toml +++ b/diesel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diesel" -version = "2.1.4" +version = "2.1.5" license = "MIT OR Apache-2.0" description = "A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL" readme = "README.md" diff --git a/diesel_compile_tests/Cargo.lock b/diesel_compile_tests/Cargo.lock index 7922e9090c94..21f052998ed4 100644 --- a/diesel_compile_tests/Cargo.lock +++ b/diesel_compile_tests/Cargo.lock @@ -64,7 +64,7 @@ dependencies = [ [[package]] name = "diesel" -version = "2.1.4" +version = "2.1.5" dependencies = [ "bigdecimal", "bitflags 2.2.1", @@ -98,7 +98,7 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.2" +version = "2.1.3" dependencies = [ "diesel_table_macro_syntax", "proc-macro2", diff --git a/diesel_derives/Cargo.toml b/diesel_derives/Cargo.toml index 69ad560d41b2..b2b4fcc8d54f 100644 --- a/diesel_derives/Cargo.toml +++ b/diesel_derives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diesel_derives" -version = "2.1.2" +version = "2.1.3" license = "MIT OR Apache-2.0" description = "You should not use this crate directly, it is internal to Diesel." documentation = "https://diesel.rs/guides/"