All versions since Diesel 2.1.0
Diesel 2.1.0
Diesel 2.1.0 contains the contributions of 42 people. More than 380 commits were submitted over a span of 9 months.
This release contains several new features and improves existing features. It introduces support for generating migrations based on the diff between your schema.rs file and your database via Diesel CLI. Diesel derives now provides a #[derive(MultiConnection)] derive macro that allows to easily combine different database connections into a single enum, which implements Connection on its own. The MySQL backend gets support for upsert queries via the ON DUPLICATE KEYS syntax. Finally we provide new tooling to improve complex error messages generated for common error cases. Check out our changelog for a complete list of changes.
This release wouldn’t be possible without the support of our contributors and sponsors. If you want to support diesels development, consider joining the reviewer team, submitting PR’s, help writing documentation or sponsor the maintainers.
Migration generation
Diesel CLI now includes support for generating migrations based on the difference of your schema.rs file and your local database.
This works as following:
- Start editing your
schema.rsfile, for example by adding your first table:
diesel::table! { users { id -> Integer, name -> Text, }}- Run
diesel migration generate my_first_migration --diff-schema --database-url DATABASE_URL - Checkout, verify and possible modify the generated migration:
-- Your SQL goes hereCREATE TABLE `users`( `id` INTEGER NOT NULL PRIMARY KEY, `name` TEXT NOT NULL);- Run the migration via
diesel migration run --database-url DATABASE_URL
It’s important to note that the generated migrations can only contain information that are part of the schema.rs file. This explicitly excludes default value, custom check constraints and similar SQL features. We expect the generated migrations to be a good starting point for writing the actual migration you need, we do not expect them to include all necessary information in all cases or to provide the perfect solution in each scenario.
MultiConnection support
Diesel now includes a #[derive(MultiConnection)] proc macro derive, which allows to easily support more than one database backend in a single application. It can be applied to an enum of different connections:
#[derive(diesel::MultiConnection)]pub enum AnyConnection { Postgresql(diesel::PgConnection), Mysql(diesel::MysqlConnection), Sqlite(diesel::SqliteConnection),}Afterwards the AnyConnection type can be used as ordinary connection:
fn use_multi(conn: &mut AnyConnection) -> QueryResult<()> { // Use the connection enum as any other connection type // for inserting/updating/loading/… diesel::insert_into(users::table) .values(users::name.eq("Sean")) .execute(conn)?;
let users = users::table.load::<(i32, String)>(conn)?; Ok(())}By default this connection type will only support a subset of SQL that’s supported by all inner connection types. By being an enum it’s easy to fallback to backend specific SQL as soon as required. We provide this feature as derive macro so that it is possible to:
- Select the backends you actually use
- Allow to use third party connections as well (this requires the third party connection to be based at least on diesel 2.1 and to implement the
MultiConnectionHelpertrait in addition to the existingConnectiontrait.
Upsert support for the MySQL backend
Diesel 2.1 adds support for INSERT INTO … ON DUPLICATE KEYS … queries for the MySQL backend using the existing upsert framework. It’s now possible to write such queries using the diesel provided DSL:
diesel::insert_into(users) .values(&user2) .on_conflict(diesel::dsl::DuplicatedKeys) .do_update() .set(name.eq("I DONT KNOW ANYMORE")) .execute(conn)?;Improved error messages
We spend some effort to improve error messages generated by rustc for common diesel issues further.
Consider the following example:
table! { users { id -> Integer, name -> Text, }}
#[derive(Queryable)]struct User { name: String, id: i32,}
users::table.load::<User>(&mut conn)which would generate the following error message:
error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text): load_dsl::private::CompatibleType<User, Mysql>` is not satisfied --> src/main.rs:20:31 |20 | users::table.load::<User>(&mut conn); | ---- ^^^^^^^^^ the trait `load_dsl::private::CompatibleType<User, Mysql>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text)` | | | required by a bound introduced by this call | = help: the following other types implement trait `load_dsl::private::CompatibleType<U, DB>`: (ST0, ST1) (ST0, ST1, ST2) (ST0, ST1, ST2, ST3) (ST0, ST1, ST2, ST3, ST4) (ST0, ST1, ST2, ST3, ST4, ST5) (ST0, ST1, ST2, ST3, ST4, ST5, ST6) (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7) (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8) and 24 others = note: required for `users::table` to implement `LoadQuery<'_, _, User>`note: required by a bound in `diesel::RunQueryDsl::load` --> /home/weiznich/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/ef6252e/diesel/src/query_dsl/mod.rs:1543:15 |1543 | Self: LoadQuery<'query, Conn, U>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`This is caused by an field order mismatch between what your query returns and what your struct expects the query to return.
With diesel 2.0 we introduced the Selectable trait and a corresponding derive. That allows to automatically generate a matching select clause to prevent such issues from happening. While this already solved parts of the problem it does not solve the following case:
#[derive(Queryable, Selectable)]struct User { name: i32, id: i32,}
users::table.select(User::as_select()).load(&mut conn);which generates the following error message:
error[E0277]: the trait bound `expression::select_by::SelectBy<User, _>: load_dsl::private::CompatibleType<_, _>` is not satisfied --> src/main.rs:20:49 |20 | users::table.select(User::as_select()).load(&mut conn); | ---- ^^^^^^^^^ the trait `load_dsl::private::CompatibleType<_, _>` is not implemented for `expression::select_by::SelectBy<User, _>` | | | required by a bound introduced by this call | = help: the trait `load_dsl::private::CompatibleType<U, DB>` is implemented for `expression::select_by::SelectBy<U, DB>` = note: required for `SelectStatement<FromClause<users::table>, query_builder::select_clause::SelectClause<expression::select_by::SelectBy<User, _>>>` to implement `LoadQuery<'_, _, _>`note: required by a bound in `diesel::RunQueryDsl::load` --> /home/weiznich/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/ef6252e/diesel/src/query_dsl/mod.rs:1543:15 |1543 | Self: LoadQuery<'query, Conn, U>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`This is caused by a type mismatch in the name field. With diesel 2.1 we now introduce an additional #[diesel(check_for_backend(diesel::backend::BackendType))] attribute that greatly improves the error messages generated for these cases. This helps pining down which field exactly causes a type mismatch.
By applying this attribute to our example:
#[derive(Queryable, Selectable)]#[diesel(check_for_backend(diesel::mysql::Mysql))]struct User { name: i32, id: i32,}we get the following error message:
error[E0277]: the trait bound `i32: FromSql<diesel::sql_types::Text, Mysql>` is not satisfied --> src/main.rs:13:11 |13 | name: i32, | ^^^ the trait `FromSql<diesel::sql_types::Text, Mysql>` is not implemented for `i32` | = help: the trait `FromSql<diesel::sql_types::Integer, Mysql>` is implemented for `i32` = note: required for `i32` to implement `diesel::Queryable<diesel::sql_types::Text, Mysql>` = note: required for `i32` to implement `FromSqlRow<diesel::sql_types::Text, Mysql>` = help: see issue #48214This error message now points to the exact cause of the issue: You cannot deserialize an Text value into a i32 field. This attribute accepts one or more diesel backend type to check the struct definition against. It requires that the struct is using either both, #[derive(Queryable)] and #[derive(Selectable)] or #[derive(QueryableByName)].
Internal changes
Changes listed here are relevant for crates using the i-implement-a-third-party-backend-and-opt-into-breaking-changes feature flag.
With Diesel 2.1 we have migrated some traits to use GAT. This affects the following traits:
RowGatWorkaroundConnectionGatWorkaroundHasRawValueHasBindCollector
These traits are removed in favour of generic associated types on the corresponding child trait.
Additionally we slightly relaxed one trait bound on BindCollector::push_bound_value to allow unsized values there as well.
Thanks
Thank you to everyone who helped make this release happen through sponsoring, bug reports, and discussion on GitHub and Gitter. While we don’t have a way to collect stats on that form of contribution, it’s greatly appreciated.
In addition to the Diesel core team, 42 people contributed code to this release. A huge thank you to:
- 6293
- Aleksei Orazov
- Alexx Roche
- AndrolGenhald
- AndyJado
- Artemis Livingstone
- czotomo
- Diana
- Elliott Forde
- Elrendio
- Gorg Worgington
- Heliozoa
- Ian
- Jake Goulding
- Jeff Schwab
- Jeremy Lardenois
- johnmai
- Leonardo Yvens
- mikemcdermottredjack
- Moritz Hedtke
- MOZGIII
- Neil Svedberg
- Neo
- Nishant Joshi
- Oliver Cooper
- Omid Rad
- Pablito Labarta
- Pavan Kumar Sunkara
- Peter Todorov
- Rutvik Patel
- Sanchith Hegde
- schlamar
- sebasv
- Silas McCroskey
- Šimon Lukašík
- Steven Chu
- stormofice
- Thomas Sieverding
- Trevor Gross
- Yuki Okushi
- 无穷无尽的爱
- 管唯宇
Diesel 2.1.1
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-schemathat lead to generating invalidtable!macros if both the#[sql_name]and the#[max_lenght]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-schemawith 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-schemanow respects table filters as setup forprint-schemaviadiesel.toml- Fixed a potential breaking change around queries containing
DISTINCT ONandORDER BYclauses consisting of custom sql expressions (e.g.diesel::dsl::sql)
Added
- Support for bigdecimal 0.4
You can support the development of diesel by sponsoring the project on github
Diesel 2.1.2
- Fixed another potential breaking chaneg around queries containing
DISTINCT ONandORDER BYclauses 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
You can support the development of diesel by contributions or by sponsoring the project on Github.
Diesel 2.1.3
- Increased accidentally decreased limit around element count in
DISTINCT ONandORDER BYclauses again as that broke existing code
Diesel 2.1.4
- Update
libsqlite3-systo allow version 0.27 as well
You can support the development of diesel by contributions or by sponsoring the project on Github.
Diesel 2.1.5
- Fix
impl SqlOrdpostgres > postgres_backend feature flag. - Allow
Queryableto be used with multiple table names. - Update
libsqlite3-systo allow version 0.28 as well
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.1.4…v2.1.5
Diesel 2.1.6
- Fix using
BoxableExpressionwith having clauses - Fix using numeric expressions with aliased fields
- Minor documentation fixes
You can support the development of diesel by contributions or by sponsoring the project on Github.
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.1.5…v2.1.6
Diesel 2.2.0
This release wouldn’t be possible without the support of our contributors and sponsors. If you want to support diesels development, consider joining the reviewer team, submitting PR’s, help writing documentation or sponsor the maintainers.
Added
- Support
[print_schema] exclude_custom_type_definitions = ["Vector"]. If acustom typematches one element on the list it’s skipped. - Added automatic usage of all sqlite
rowidaliases when no explicit primary key is defined forprint-schema - Added a
#[dsl::auto_type]attribute macro, allowing to infer type of query fragment functions - Added the same type inference on
Selectablederives, which allows skipping specifyingselect_expression_typemost of the time, in turn enabling most queries to be written using just aSelectablederive. - Added an optional
#[diesel(skip_insertion)]field attribute to theInsertablederive macro, allowing fields which map to generated columns to be skipped during insertion. - Support for connection instrumentation. This allows to inspect any query run by your application
- Logging in diesel-cli
- Support for libsqlite3-sys 0.28
- Add
sqlite-integer-primary-key-is-bigintconfiguration option, usable with SQLite 3.37 or above, allowing to useBigIntforINTEGER PRIMARY KEYcolumns in SQLite for tables without theWITHOUT ROWIDattribute (SQLite doc). - Support for multiple
print_schemaentry indiesel.toml(e.g.[print_schema.user1]), which allows generating multiple schema.rs files - Add support for
COPY TOandCOPY FROMstatements - Add support for mapping
chrono::Durationto postgresql’sINTERVALsql type - Added
serialize_database_to_bufferanddeserialize_readonly_database_from_buffermethods inSqliteConnectionto support serialization/deserialization of SQLite databases to and from byte buffers. - Added
SerializedDatabasewrapper type for a serialized database that is dynamically allocated by callingserialize_database_to_buffer. This RAII wrapper deallocates the memory when it goes out of scope withsqlite3_free.
Changed
- The minimal officially supported rustc version is now 1.78.0
- Deprecated
sql_function!in favour ofdefine_sql_function!which provides compatibility with#[dsl::auto_type] - Deserialization error messages now contain information about the field that failed to deserialize
New Contributors
- @tp-woven made their first contribution in https://github.com/diesel-rs/diesel/pull/3650
- @aumetra made their first contribution in https://github.com/diesel-rs/diesel/pull/3657
- @sintemal made their first contribution in https://github.com/diesel-rs/diesel/pull/3660
- @DannyGoldberg made their first contribution in https://github.com/diesel-rs/diesel/pull/3681
- @ernest-rudnicki made their first contribution in https://github.com/diesel-rs/diesel/pull/3690
- @cr0sh made their first contribution in https://github.com/diesel-rs/diesel/pull/3699
- @dsp made their first contribution in https://github.com/diesel-rs/diesel/pull/3713
- @snf made their first contribution in https://github.com/diesel-rs/diesel/pull/3714
- @moulins made their first contribution in https://github.com/diesel-rs/diesel/pull/3724
- @surban made their first contribution in https://github.com/diesel-rs/diesel/pull/3734
- @gmanninglive made their first contribution in https://github.com/diesel-rs/diesel/pull/3725
- @BlackDex made their first contribution in https://github.com/diesel-rs/diesel/pull/3747
- @retro-git made their first contribution in https://github.com/diesel-rs/diesel/pull/3792
- @moyeah made their first contribution in https://github.com/diesel-rs/diesel/pull/3805
- @kriswuollett made their first contribution in https://github.com/diesel-rs/diesel/pull/3777
- @szepeviktor made their first contribution in https://github.com/diesel-rs/diesel/pull/3821
- @hgzimmerman made their first contribution in https://github.com/diesel-rs/diesel/pull/3841
- @brocaar made their first contribution in https://github.com/diesel-rs/diesel/pull/3854
- @peter-scholtens made their first contribution in https://github.com/diesel-rs/diesel/pull/3855
- @formlogic-kirk made their first contribution in https://github.com/diesel-rs/diesel/pull/3862
- @yagince made their first contribution in https://github.com/diesel-rs/diesel/pull/3888
- @c410-f3r made their first contribution in https://github.com/diesel-rs/diesel/pull/3879
- @dullbananas made their first contribution in https://github.com/diesel-rs/diesel/pull/3904
- @colem213 made their first contribution in https://github.com/diesel-rs/diesel/pull/3908
- @greyblake made their first contribution in https://github.com/diesel-rs/diesel/pull/3917
- @longsleep made their first contribution in https://github.com/diesel-rs/diesel/pull/3926
- @dennybiasiolli made their first contribution in https://github.com/diesel-rs/diesel/pull/3939
- @epompeii made their first contribution in https://github.com/diesel-rs/diesel/pull/3849
- @stormshield-kg made their first contribution in https://github.com/diesel-rs/diesel/pull/3940
- @sabify made their first contribution in https://github.com/diesel-rs/diesel/pull/3943
- @forest1102 made their first contribution in https://github.com/diesel-rs/diesel/pull/3796
- @dvogel made their first contribution in https://github.com/diesel-rs/diesel/pull/3921
- @Tanguille made their first contribution in https://github.com/diesel-rs/diesel/pull/3956
- @ISibboI made their first contribution in https://github.com/diesel-rs/diesel/pull/3751
- @DavisRayM made their first contribution in https://github.com/diesel-rs/diesel/pull/3982
- @kornelski made their first contribution in https://github.com/diesel-rs/diesel/pull/3980
- @momobel made their first contribution in https://github.com/diesel-rs/diesel/pull/3977
- @Sagebati made their first contribution in https://github.com/diesel-rs/diesel/pull/4002
- @MixusMinimax made their first contribution in https://github.com/diesel-rs/diesel/pull/4026
- @tommymcc made their first contribution in https://github.com/diesel-rs/diesel/pull/4021
- @dessalines made their first contribution in https://github.com/diesel-rs/diesel/pull/4019
- @bachmannscode made their first contribution in https://github.com/diesel-rs/diesel/pull/4015
- @McDic made their first contribution in https://github.com/diesel-rs/diesel/pull/4037
- @z33ky made their first contribution in https://github.com/diesel-rs/diesel/pull/4030
- @JonBoyleCoding made their first contribution in https://github.com/diesel-rs/diesel/pull/3944
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.1.0…v2.2.0
Diesel 2.2.1
You can support the development of diesel by contributions or by sponsoring the project on Github.
- Fixed using
#[dsl::auto_type]with functions that accept reference arguments - Fixed using
#[derive(Queryable)]with structs that use a type namedRowas field type - Fixed a regression that prevented using
mysqlclient-sys0.2.x with diesel 2.2 - Fixed connecting to postgres database using the scram-sha-256 authentication method on windows while using the bundled postgres builds
- Improved the error messages in diesel-cli for cases where a file/folder was not found
- Fixed several version detection bugs in mysqlclient-sys to use pre-generated bindings in more situations
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.0…v2.2.1
Diesel 2.2.2
- Support for libsqlite3-sys 0.29.0
- Fixed a potential panic in the sqlite cursor implementation
- Fixed support for rust numeric operators with columns of the type
Numeric - Removed the
SerializedDatabase::newfunction due to unsoundness
You can support the development of diesel by contributions or by sponsoring the project on Github.
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.1…v2.2.2
Diesel 2.2.3
- Support for libsqlite3-sys 0.30.0
- Fixed a possible vulnerability in how Diesel handled protocol level bind parameters. See the SQL Injection isn’t Dead: Smuggling Queries at Protocol Level presentation from DEF CON for details
- Fixed an issue with a possibly ambiguous trait resolution in
#[derive(QueryableByName)]
You can support the development of diesel by contributions or by sponsoring the project on Github.
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.2…v2.2.3
Diesel 2.2.4
Fixed
- Fix an issue where empty queries could trigger undefined behaviour in the sqlite backend
Diesel 2.2.5
- Add a typedef for
ReturningandCountso that#[auto_type]works with such queries - Fixed an issue that allowed to pass non-boolean expressions to
.and()and.or()which would result in queries failing at runtime - Officially deprecating the gitter room
You can support the development of diesel by contributions or by sponsoring the project on Github.
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.4…v2.2.5
Diesel 2.2.6
What’s Changed
- Remove more mentions of gitter from the documentation
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.5…v2.2.6
Diesel 2.2.7
Fixed
- Fixed diesel thinking
a.eq_any(b)was non-nullable even ifaandbwere nullable. - Generate
InstrumentationEvent::BeginTransactionfor immediate and exclusive transactions in SQLite - Minimize the amount of duplicated code generated for
diesel::debug_query - Updated
ipnetworkto allow version 0.21. - Updated
libsqlite3-systo allow version 0.31.0 - Updated
pq-systo allow version 0.7.0 - Add support for numeric operators (+-*/) in
#[diesel::auto_type] - Add support for joins to sub-jons to aliases
You can support the development of diesel by contributions or by sponsoring the project on Github
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.6…v2.2.7
Diesel 2.2.8
Fixed
- Allow
#[diesel(check_for_backend(_))]to check fields with#[diesel(embed)]annotations - Improve custom compile error message around
CompatibleType - Fix a bug that restricted the number of allowed columns in
COPY FROMstatements to 12 - Expose some SqliteValue helper functions
- Use consistent whitespace in
ASC/DESC,DISTINCT ON, andDELETE FROMclauses
You can support the development of diesel by contributions or by sponsoring the project on Github
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.7…v2.2.8
Diesel 2.2.9
Fixed
- Fix an issue where
diesel migration generate --diff-schemaincorrectly uses the primary key of table B as the referenced column rather than the primary key of table A when B has a foreign key pointing to table A. - Bump maximal supported libsqlite3-sys version to 0.32.0 and add explicit feature entries for the
uuidandserde_jsonfeature. - Fixed an issue where diesel generated unnamed prepared statements would fail with an
unanmed prepared statement not founderror with pgbouncer. - Fix an issue with converting
ipnet::Ipnetvalues with an subnet to SQL values
You can support the development of diesel by contributions or by sponsoring the project on Github
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.8…v2.2.9
Diesel 2.2.10
Fixed
- Support for libsqlite3-sys 0.33.0
- Fixed potential ambiguities in code generated by various derives
You can support the development of diesel by contributions or by sponsoring the project on Github
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.9…v2.2.10
Diesel 2.2.11
What’s Changed
- Disallow mixing aggregate and non-aggregate expressions in
DISTINCT ONclauses - Fixed an item referenced by a non-absolute path in
#[derive(MultiConnection)] - Improved compiler errors in some cases
- Improved the documentation for creating SqliteConnections for concurrent applications
You can support the development of Diesel by contributions or by sponsoring the project on Github
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.10…v2.2.11
Diesel 2.2.12
Fixed
- Added support for libsqlite3-sys 0.35.0
- Fixed a wrong oid for the
oid[]type in the PostgreSQL backend - Worked around an issue with broken nullable detection with certain versions of libmysqlclient shipped by ubuntu
- Improved compiler errors in many more cases
You can support the development of Diesel by contributions or by sponsoring the project on GitHub
Call for Input
We are looking for input on a newly designed derive to make constructing queries easier. See here for details.
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.11…v2.2.12
Diesel 2.3.0
This release includes a several large extensions to the query DSL provided by Diesel and also helps increases the number of platforms you can use Diesel on out of the box. Notable changes include:
- Improved query construction via
#[derive(HasQuery)] - Added support for window functions
- Using SQLite with WASM in your browser
- Extended support for various types, functions and operators in the PostgreSQL backend
- Support for
JSONandJSONBin the SQLite backend
See the release blog for the full announcement
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Added
- Added
limit()andoffset()DSL to combination clauses such asUNION - Fixed
#[derive(Identifiable)]ignoring attribute#[diesel(serialize_as)]on primary keys - Added embedded struct support for
AsChangesetvia#[diesel(embed)] - Added a
#[diesel(skip_update)]attribute for theAsChangesetderive to skip updating a field present in the struct - Support for libsqlite3-sys 0.35.0
- Add support for built-in PostgreSQL range operators and functions
- Support for postgres multirange type
- Added
diesel::r2d2::TestCustomizer, which allows users to customize theirdiesel::r2d2::Pools in a way that makes the pools suitable for use in parallel tests. - Added support for built-in PostgreSQL range operators and functions
- Added support for various built-in PostgreSQL array functions
- Added
JsonandJsonbsupport for the SQLite backend. - Added a
#[diesel::declare_sql_function]attribute macro to easily define support for multiple sql functions at once via anextern "SQL"block - Support
[print_schema] allow_tables_to_appear_in_same_query_config = "fk_related_tables"to generate separateallow_tables_to_appear_in_same_query!calls containing only tables that are related through foreign keys. (Default:"all_tables".) It is not possible to build queries using two tables that don’t appear in the sameallow_tables_to_appear_in_same_query!call, but that macro generates O(n²) rust code, so this option may be useful to reduce compilation time. (#4333) - Added
wasm32-unknown-unknowntarget support for sqlite backend. - Add support for the
CASToperator - Support
[print_schema] allow_tables_to_appear_in_same_query_config = "none"to generate noallow_tables_to_appear_in_same_query!calls. (Default:"all_tables".). (#4333) - Add
[print_schema] pg_domains_as_custom_typesparameter to generate custom types for PostgreSQL domains that matches any of the regexes in the given list. (Default:[].) This option allows an application to selectively give special meaning for the serialization/deserialization of these types, avoiding the default behavior of treating the domain as the underlying type. (#4592) - Add support for batch insert and upsert statements with returning for SQLite
- Add support for window functions and aggregate expressions.
Fixed
- Fixed diesel thinking
a.eq_any(b)was non-nullable even ifaandbwere nullable. - Generate
InstrumentationEvent::BeginTransactionfor immediate and exclusive transactions in SQLite - Use a single space instead of two spaces between
DELETE FROM. - Diesel CLI now ensures that migration versions are always unique. If it fails to generate a unique version, it will return an error. The new version format remains compatible with older Diesel versions.
- Updated
ipnetworkto allow version 0.21.
Changed
- Use distinct
DIESEL_LOGlogging filter env variable instead of the defaultRUST_LOGone (#4575) - The minimal supported Rust version is now 1.86.0
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.2.0…v2.3.0
Diesel 2.3.2
Fixed
- Fixed an incompatibility with libmariadb versions shipped by debian
- Fixed docs.rs builds
- Fixed applying patch file schema.rs file with formatting
- Allow to compare DatabaseErrorKind values
(Diesel 2.3.1 did not contain any changes beside the version bump to retrigger the docs.rs build)
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.3.0…v2.3.2
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Diesel 2.3.3
Fixed
- Fix displaying binds in instrumentations for
#[derive(MultiConnection)] - Support artifact attestation for binaries build for releases
- Stop using absolute paths in generated diesel.toml
- Explicitly qualify
Okin code generated by derives to avoid naming conflicts
Starting with Diesel-CLI 2.3.3 you can verify that you downloaded the correct binaries via GitHub’s artifact attestation
gh attestation verify diesel_cli-x86_64-unknown-linux-gnu.tar.xz -R diesel-rs/dieselFull Changelog: https://github.com/diesel-rs/diesel/compare/v2.3.2…v2.3.3
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Diesel 2.3.4
Fixed
- Fix an issue with breaking changes in libmariadb
- Fix documentation links for helper types
- Fix using
#[diesel(embed)]withOption<Inner>types - Fix documentation for concurrent migration runs
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.3.3…v2.3.4
Diesel 2.3.5
Fixes
- Fix another libmariadb related issue with time types
- Improve compile time error messages for
#[derive(Insertable)] - Bump supported version of sqlite-wasm-rs to 0.5.0
- Minor documentation fixes
- Make the
returning_clauses_for_sqlite_3_35feature enable thesqlitefeature by default - Include a fix for a nightly rust name resolution ambiguity
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.3.4…v2.3.5
Diesel 2.3.6 Latest
Fixed
- Added support for mysqlclient-sys 0.5.0
- Fix generating valid schema if a column is named
table - Fixed a regression with
#[derive(Insertable)]if the same field type is used with different lifetime values
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Full Changelog: https://github.com/diesel-rs/diesel/compare/v2.3.5…v2.3.6