<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Diesel News</title><description>Release announcements for Diesel, the safe, extensible ORM and query builder for Rust</description><link>https://diesel.rs/</link><item><title>Diesel 2.4.0</title><link>https://diesel.rs/news/2_4_0_release/</link><guid isPermaLink="true">https://diesel.rs/news/2_4_0_release/</guid><pubDate>Fri, 13 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Diesel 2.4.0 includes contributions from 76 people. Over a span of 14 months, more than 1337 commits were submitted.&lt;/p&gt;
&lt;p&gt;This release introduces several large new features to Diesel and also expands the number of platforms on which you can run Diesel out of the box. Notable changes include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_4_0_release/#database-views&quot;&gt;Support for Database Views&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_4_0_release/#better-enum-support&quot;&gt;Improved support for Enums&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_4_0_release/#batch-updates&quot;&gt;Support for batch update statements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_4_0_release/#distinct-mariadb-backend&quot;&gt;Support for a distinct MariaDB backend&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_4_0_release/#extended-sqlite-functionality&quot;&gt;Extended support for SQLite functionality&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_4_0_release/#using-diesel-in-no-std-environment&quot;&gt;Support for using Diesel in no-std Environments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_4_0_release/#rust-migrations&quot;&gt;Rust written migrations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_4_0_release/#derivemulticonnection-support-in-diesel-async&quot;&gt;&lt;code&gt;#[derive(MultiConnection)]&lt;/code&gt; support in diesel-async&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Besides these headline features, a significant amount of work was done to improve the robustness of the existing code. As part of this effort, we started fuzzing parts of Diesel and added support to run several tests using Miri and various sanitizers. This work helped uncover and fix various soundness and correctness issues, as well as bugs that could lead to panics. Most of the relevant fixes have already been backported to the various Diesel 2.3.x releases over the last few months.&lt;/p&gt;
&lt;p&gt;Check out &lt;a href=&quot;https://diesel.rs/news/changelog.html&quot;&gt;the full change log&lt;/a&gt; for a complete list of changes.&lt;/p&gt;
&lt;p&gt;This release would not have been possible without the support of our contributors and sponsors. We would like to especially call out &lt;a href=&quot;https://www.prototypefund.de/projects/diesel-databaseviews&quot;&gt;Prototype Fund&lt;/a&gt; for funding the development of the newly added support for views. We would also like to call out the &lt;a href=&quot;https://rustfoundation.org/&quot;&gt;Rust Foundation&lt;/a&gt; for recently sponsoring maintenance work on Diesel.&lt;/p&gt;
&lt;p&gt;Nevertheless, the Diesel project is always looking for support. You can help by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Contributing Code, Documentation, or Guides.&lt;/li&gt;
&lt;li&gt;Answering questions in our &lt;a href=&quot;https://github.com/diesel-rs/diesel/discussions&quot;&gt;discussion forum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Reporting bugs in our &lt;a href=&quot;https://github.com/diesel-rs/diesel/issues&quot;&gt;issue tracker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Helping to triage issues in our &lt;a href=&quot;https://github.com/diesel-rs/diesel/issues&quot;&gt;issue tracker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/weiznich&quot;&gt;Sponsoring&lt;/a&gt; the maintainers.&lt;/li&gt;
&lt;li&gt;Filling out &lt;a href=&quot;https://cryptpad.fr/form/#/2/form/view/p0lmiZqtL2DIAoraUh-ss+d8k-ABhWH5zn2Q9Ka1nNU/&quot;&gt;this survey&lt;/a&gt; about the current state and future developments of Diesel&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Database Views&lt;/h2&gt;
&lt;p&gt;Diesel 2.4 introduces support for database views. It was already possible to use database views in previous versions of Diesel by manually writing &lt;code&gt;table!&lt;/code&gt; definitions for your views and carefully only using methods that work with a particular view. Diesel 2.4 now introduces a &lt;a href=&quot;https://docs.diesel.rs/main/diesel/prelude/macro.view.html&quot;&gt;&lt;code&gt;view!&lt;/code&gt;&lt;/a&gt; macro that can be used to declare the existence of a database view. The syntax and usage of this macro closely mirror the existing &lt;code&gt;table!&lt;/code&gt; macro, but the generated code prevents usage in any query other than &lt;code&gt;SELECT&lt;/code&gt; statements.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;diesel::view! {
    users {
        name -&amp;gt; Text,
        favorite_color -&amp;gt; Nullable&amp;lt;Text&amp;gt;,
    }
}

// can be used like ordinary tables to query data
users::view.select(users::name)
    .filter(users::favorite_color.eq(&quot;Red&quot;))
    .load::&amp;lt;String&amp;gt;(&amp;amp;mut conn)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Additionally, &lt;code&gt;diesel-cli&lt;/code&gt; has been extended to support generating these &lt;code&gt;view!&lt;/code&gt; definitions when you regenerate your &lt;code&gt;schema.rs&lt;/code&gt; file via &lt;code&gt;diesel print-schema&lt;/code&gt; or by running a new migration. Support for generating &lt;code&gt;view!&lt;/code&gt; macro definitions can be enabled for existing projects by setting &lt;code&gt;print_schema.include_views = true&lt;/code&gt; in your &lt;code&gt;diesel.toml&lt;/code&gt; file. For new projects, this will be the default.&lt;/p&gt;
&lt;p&gt;Finally, there is a new unstable &lt;code&gt;print_schema.experimental_infer_nullable_for_views&lt;/code&gt; boolean configuration that enables inferring whether a view column might contain &lt;code&gt;NULL&lt;/code&gt; values or not in more cases. By default, this configuration is disabled, causing Diesel to assume that most columns might contain &lt;code&gt;NULL&lt;/code&gt; values, as reported by the underlying database system. This configuration enables an additional inference step to parse and verify the structure of relevant views to more accurately report possible null values. See &lt;a href=&quot;https://blog.weiznich.de/blog/diesel-infer-sql-nullablity/&quot;&gt;this blog post&lt;/a&gt; from last year for more details. The underlying functionality is also available via a new &lt;code&gt;diesel_infer_query&lt;/code&gt; crate for third parties. Since we still consider the results of this inference to be non-100% satisfying, this configuration is marked as experimental, meaning results might change in future Diesel versions. If you encounter a case that doesn&apos;t work correctly, please report it in our issue tracker.&lt;/p&gt;
&lt;p&gt;We would like to thank &lt;a href=&quot;https://www.prototypefund.de/projects/diesel-databaseviews&quot;&gt;Prototype Fund&lt;/a&gt; again for funding the development of this feature.&lt;/p&gt;
&lt;h2&gt;Better Enum Support&lt;/h2&gt;
&lt;p&gt;Adding better support for mapping Rust enums to SQL values has been a long-standing request for Diesel. While such a mapping was possible for a long time, it either required significant custom code or the usage of a third-party crate. With Diesel 2.4, we finally introduce a new &lt;a href=&quot;https://docs.diesel.rs/main/diesel/types/derive.Enum.html&quot;&gt;&lt;code&gt;#[derive(Enum)]&lt;/code&gt;&lt;/a&gt; proc-macro to simplify the mapping of field-less Rust enums to SQL values.&lt;/p&gt;
&lt;p&gt;This macro enables mapping a Rust enum to SQL side enum types (PostgreSQL, MySQL, MariaDB), integer fields (all backends), or text fields (all backends), depending on your database backend.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Map to an SQL side enum types

#[derive(Debug, Enum)]
// just give an enum SQL type here
#[diesel(sql_types = schema::sql_types::Color)] 
enum Color {
    Red,
    Green,
    Blue,
}

// map to a text field
#[derive(Debug, Enum)]
#[diesel(sql_type = diesel::sql_types::Text)]
// optionally change the name mapping
#[diesel(rename_all = &quot;SCREAMING_SNAKE_CASE&quot;)] 
enum Color {
    Red,
    Green,
    // you also can just rename a single field
    #[diesel(rename = &quot;otherBlue&quot;)]
    Blue,
}

//map to an integer field
#[derive(Debug, Enum)]
// also bigger/smaller integer types are supported
#[diesel(sql_type = diesel::sql_types::Integer)] 
enum Color {
    // explicit discriminants are required for this
    Red = 1,
    Green = 2,
    Blue = 3,
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can also use &lt;code&gt;#[diesel(sql_types)]&lt;/code&gt; multiple times on the same enum to support mapping to several different types.&lt;/p&gt;
&lt;p&gt;As part of this feature, we also added support via the Diesel CLI for automatically generating the corresponding Rust enum definitions for given SQL side enums, including the ability to generate migrations based on these definitions. Support for generating such definitions for existing projects can be enabled by setting &lt;code&gt;print_schema.generate_rust_enum_definitions = true&lt;/code&gt;. For new projects, this will be the default.&lt;/p&gt;
&lt;h2&gt;Batch-Updates&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.diesel.rs/main/diesel/fn.update.html#batch-update&quot;&gt;&lt;code&gt;diesel::update&lt;/code&gt;&lt;/a&gt; now supports updating multiple rows at once. SQL does not natively support this feature in a straightforward way for &lt;code&gt;INSERT&lt;/code&gt; statements. Internally, we translate such an update request into a single &lt;code&gt;UPDATE&lt;/code&gt; statement that assigns the correct values from a joined &lt;code&gt;VALUES&lt;/code&gt; list based on the primary key. To enable this translation, we need to know both the values and the primary key simultaneously, which requires a struct that implements both &lt;code&gt;Identifiable&lt;/code&gt; and &lt;code&gt;AsChangeset&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Using this feature is straightforward by passing a list of values to &lt;code&gt;.set()&lt;/code&gt;, like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// required to use the struct-based API
// as we need to know which field is the primary key
#[derive(Debug, Clone, AsChangeset, Identifiable)]
struct User {
    id: i32,
    name: &amp;amp;&apos;static str,
    surname: &amp;amp;&apos;static str,
}

let users_batch = [
   User { id: 1, name: &quot;James&quot;, surname: &quot;Bond&quot; },
   User { id: 6, name: &quot;Mev&quot;, surname: &quot;Sane&quot; },
   User { id: 3, name: &quot;Kody&quot;, surname: &quot;Pineda&quot; },
];

diesel::update(users::table)
    .set(&amp;amp;users_batch)
    .execute(connection)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Distinct MariaDB backend&lt;/h2&gt;
&lt;p&gt;MariaDB started as a fork of MySQL, so Diesel naturally supported MariaDB through the existing MySQL backend. However, over the last few years, MariaDB has added features and introduced changes to its database server and client that made supporting both systems with the same backend considerably harder. This created the need for a distinct backend and connection type for MariaDB in Diesel. With Diesel 2.4, we finally add a dedicated &lt;a href=&quot;https://docs.diesel.rs/main/diesel/mariadb/struct.Mariadb.html&quot;&gt;backend&lt;/a&gt; and &lt;a href=&quot;https://docs.diesel.rs/main/diesel/mariadb/type.MariadbConnection.html&quot;&gt;connection&lt;/a&gt; type to Diesel. It still shares as much code as possible with the existing MySQL backend, but it allows Diesel to support MariaDB-specific features like &lt;code&gt;RETURNING&lt;/code&gt; clauses more easily. Support for this new backend is exposed via the new &lt;code&gt;mariadb&lt;/code&gt; feature for &lt;code&gt;diesel&lt;/code&gt; and &lt;code&gt;diesel-async&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Usage of this new connection type works like any of the existing connections:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;use diesel::prelude::*;

let mut conn = MariadbConnection::establish(&quot;mariadb://localhost/diesel&quot;)?;

let users = User::query().load(&amp;amp;mut conn)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Support for this new backend exists in all parts of Diesel, including &lt;code&gt;diesel-async&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Extended SQLite functionality&lt;/h2&gt;
&lt;p&gt;Diesel 2.4 adds support for a lot SQLite functionality for managing database connection details. This includes support for the following features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/fn.register_auto_extension.html&quot;&gt;Auto extension callbacks&lt;/a&gt; for setting up a fixed set of functions, collections, or extensions for any SQLite connection created by a given process&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/pragma/index.html&quot;&gt;A typed &lt;code&gt;PRAGMA&lt;/code&gt; interface&lt;/a&gt; for reading and modifying database and connection level settings&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.get_read_only_blob&quot;&gt;Streaming BLOB support&lt;/a&gt; for reading large blob values in an incremental way&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.set_limit&quot;&gt;Support for setting limits&lt;/a&gt; and &lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.set_views_enabled&quot;&gt;various&lt;/a&gt; &lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.is_writable_schema&quot;&gt;other&lt;/a&gt; &lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.set_fts3_tokenizer_enabled&quot;&gt;features&lt;/a&gt; to restrict what can be done with a specific connection&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.on_authorize&quot;&gt;Support&lt;/a&gt; &lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.on_busy&quot;&gt;for&lt;/a&gt; &lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.on_collation_needed&quot;&gt;various&lt;/a&gt; &lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.on_commit&quot;&gt;hooks&lt;/a&gt; to interact with events sent by SQLite internally&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.diesel.rs/main/diesel/sqlite/struct.SqliteConnection.html#method.attach_database&quot;&gt;Attaching additional databases&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Using Diesel in no-std Environment&lt;/h2&gt;
&lt;p&gt;Diesel 2.4 adds support for using the SQLite backend (via the new &lt;code&gt;sqlite-no-std&lt;/code&gt; feature) with Rust targets that lack a standard library. This enables using Diesel with a SQLite database on embedded targets.&lt;/p&gt;
&lt;p&gt;Such targets often have specific requirements for setting up the runtime. Please consult the documentation for the target you plan to use. Diesel and SQLite still require the usage of an allocator. Additionally, you need to supply a custom SQLite VFS to work with your environment. See the &lt;a href=&quot;https://docs.rs/rsqlite-vfs/latest/rsqlite_vfs/&quot;&gt;&lt;code&gt;rsqlite_vfs&lt;/code&gt;&lt;/a&gt; for a Rust abstraction for building custom VFS, as well as a default in-memory VFS that works well with embedded targets.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&quot;https://github.com/diesel-rs/diesel/tree/main/examples/sqlite/embedded&quot;&gt;the complete example for more details&lt;/a&gt; on how to compile and use Diesel on an esp32-c6 with a bare-metal target.&lt;/p&gt;
&lt;h2&gt;Rust migrations&lt;/h2&gt;
&lt;p&gt;Up until now, Diesel primarily expected users to write their database migrations using plain SQL, as that is often the most flexible solution for evolving your data requirements. Nevertheless, there was a long-running desire to also allow writing database migrations in Rust. With this release, we introduce &lt;a href=&quot;https://docs.diesel.rs/main/diesel_migrations/struct.RustMigrationSource.html&quot;&gt;&lt;code&gt;RustMigrationSource&lt;/code&gt;&lt;/a&gt;, which easily allows registering migrations written in Rust. This type allows you to register migrations via callbacks, functions, typed migration builders, and custom types.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
fn migration_function(conn: &amp;amp;mut SqliteConnection) -&amp;gt; QueryResult&amp;lt;()&amp;gt; {
    diesel::sql_query(&quot;SELECT &apos;EXECUTE YOUR MIGRATION HERE&apos;&quot;).execute(conn)?;
    Ok(())
}

struct CustomMigration(&amp;amp;&apos;static str);

impl TypedMigration&amp;lt;SqliteConnection&amp;gt; for CustomMigration {
    fn up(&amp;amp;self, conn: &amp;amp;mut SqliteConnection) -&amp;gt; QueryResult&amp;lt;()&amp;gt; {
        diesel::sql_query(&quot;SELECT &apos;YOUR MIGRATION&apos;, ?&quot;)
            .bind::&amp;lt;diesel::sql_types::Text, _&amp;gt;(self.0)
            .execute(conn)?;
        Ok(())
    }
}

let mut rust_migrations = RustMigrationSource::&amp;lt;SqliteConnection&amp;gt;::new();

// register migrations callback
rust_migrations.add_migration(
    &quot;2026-01-30-121720&quot;,
    &quot;callback&quot;,
    |conn: &amp;amp;mut SqliteConnection| {
        diesel::sql_query(&quot;SELECT &apos;EXECUTE YOUR MIGRATION HERE&apos;&quot;).execute(conn)?;
        Ok(())
    },
);

// register a migration as function
rust_migrations.add_migration(&quot;2026-01-30-122420&quot;, &quot;function&quot;, migration_function);

// register a RustMigration
let migration = RustMigration::new(|conn| {
    diesel::sql_query(&quot;SELECT &apos;EXECUTE YOUR MIGRATION HERE&apos;&quot;).execute(conn)?;
    Ok(())
})
.with_down(|conn| {
    diesel::sql_query(&quot;SELECT &apos;REVERT YOUR MIGRATION HERE&apos;&quot;).execute(conn)?;
    Ok(())
});
rust_migrations.add_migration(&quot;2026-01-30-122520&quot;, &quot;rust_migration&quot;, migration);

// register a custom migration type
rust_migrations.add_migration(
    &quot;2026-01-30-122920&quot;, &quot;custom_type&quot;,
    CustomMigration(&quot;your custom args&quot;),
);

// run the migrations
let mut conn = SqliteConnection::establish(&amp;amp;connection_url)?;
conn.run_pending_migrations(rust_migrations)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Diesel will then only execute migrations that have not yet been applied to the database, consistent with the existing migration framework. While we do not yet expose any query DSL constructs for the data definition part of SQL, this is planned for a future release.&lt;/p&gt;
&lt;p&gt;As a secondary feature, we also introduced a &lt;a href=&quot;https://docs.diesel.rs/main/diesel_migrations/struct.CombinedMigrationSource.html&quot;&gt;&lt;code&gt;CombinedMigrationSource&lt;/code&gt;&lt;/a&gt; type that allows you to mix migrations from different sources (e.g., plain SQL migrations and Rust-written migrations) in a straightforward way.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pub const SQLITE_MIGRATIONS: EmbeddedMigrations = embed_migrations!(&quot;../migrations/sqlite&quot;);

let mut rust_migrations = RustMigrationSource::&amp;lt;SqliteConnection&amp;gt;::new();
rust_migrations.add_migration(&quot;2026-11-06-122920&quot;, &quot;rust_migration&quot;, my_migration_function);

// Create a new empty combined source
let mut combined_sources = CombinedMigrationSource::default();

combined_sources.add_source(SQLITE_MIGRATIONS);
combined_sources.add_source(rust_migrations);

// run migrations on a connection
let res = connection.run_pending_migrations(combined_sources);
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;code&gt;#[derive(MultiConnection)]&lt;/code&gt; support in diesel-async&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://diesel.rs/news/2_1_0_release#multiconnection-support&quot;&gt;Diesel 2.1&lt;/a&gt; introduced a &lt;a href=&quot;https://docs.diesel.rs/main/diesel/derive.MultiConnection.html&quot;&gt;&lt;code&gt;#[derive(MultiConnection)]&lt;/code&gt;&lt;/a&gt; macro to Diesel, which allows an application to precisely describe which database backends it supports. Previously, this macro lacked support for &lt;code&gt;diesel-async&lt;/code&gt;, making it difficult to write multi-backend applications using &lt;code&gt;diesel-async&lt;/code&gt;. With this release, we introduce support for &lt;code&gt;diesel-async&lt;/code&gt; within the &lt;code&gt;#[derive(MultiConnection)]&lt;/code&gt; proc-macro, enabling its use with asynchronous connections.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[derive(MultiConnection)]
#[diesel_async]
enum AnyConnection {
    Postgresql(diesel_async::AsyncPgConnection),
    Mariadb(diesel_async::AsyncMariadbConnection),
}

let mut conn = AnyConnection::establish(&quot;postgres://localhost/database&quot;).await?;

let users = User::query().load(&amp;amp;mut conn).await?;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Thanks&lt;/h2&gt;
&lt;p&gt;Thank you to everyone who helped make this release happen through sponsoring, bug reports, and discussions on GitHub. While we lack a way to automatically track contributions this way, your help is greatly appreciated.&lt;/p&gt;
&lt;p&gt;In addition to the Diesel core team, 76 people contributed code to this release. A huge thank you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Luca Cappelletti&lt;/li&gt;
&lt;li&gt;Luca&lt;/li&gt;
&lt;li&gt;Julian Raffeiner&lt;/li&gt;
&lt;li&gt;Elrendio&lt;/li&gt;
&lt;li&gt;Pavan K Sunkara&lt;/li&gt;
&lt;li&gt;elbaro&lt;/li&gt;
&lt;li&gt;Alex Yarotsky&lt;/li&gt;
&lt;li&gt;judy&lt;/li&gt;
&lt;li&gt;sim-hash&lt;/li&gt;
&lt;li&gt;Ananth Prathap&lt;/li&gt;
&lt;li&gt;Ali Tariq&lt;/li&gt;
&lt;li&gt;Tobias Bieniek&lt;/li&gt;
&lt;li&gt;mevsane&lt;/li&gt;
&lt;li&gt;Samyra312007&lt;/li&gt;
&lt;li&gt;jraffeiner&lt;/li&gt;
&lt;li&gt;Tommaso Fontana&lt;/li&gt;
&lt;li&gt;Wesley-Arizio&lt;/li&gt;
&lt;li&gt;Alexi24601&lt;/li&gt;
&lt;li&gt;Caio&lt;/li&gt;
&lt;li&gt;Chris Rudd&lt;/li&gt;
&lt;li&gt;Dumindu Madunuwan&lt;/li&gt;
&lt;li&gt;Kevin GRONDIN&lt;/li&gt;
&lt;li&gt;Konstantinos Vasilopoulos&lt;/li&gt;
&lt;li&gt;Oscar Walter&lt;/li&gt;
&lt;li&gt;Spxg&lt;/li&gt;
&lt;li&gt;henyanagar&lt;/li&gt;
&lt;li&gt;thenlevy&lt;/li&gt;
&lt;li&gt;Samuel Batissou&lt;/li&gt;
&lt;li&gt;Zacherina&lt;/li&gt;
&lt;li&gt;be-mevsane&lt;/li&gt;
&lt;li&gt;Andreas Hartmann&lt;/li&gt;
&lt;li&gt;Anthony Pastrana&lt;/li&gt;
&lt;li&gt;Samran Asif&lt;/li&gt;
&lt;li&gt;SickleFire&lt;/li&gt;
&lt;li&gt;Thomas B&lt;/li&gt;
&lt;li&gt;Tibo Ulens&lt;/li&gt;
&lt;li&gt;WaterWhisperer&lt;/li&gt;
&lt;li&gt;ahmadalguydi&lt;/li&gt;
&lt;li&gt;clonejo&lt;/li&gt;
&lt;li&gt;jusax23&lt;/li&gt;
&lt;li&gt;zaveshaa&lt;/li&gt;
&lt;li&gt;0x4nud33p&lt;/li&gt;
&lt;li&gt;Ahmed Said&lt;/li&gt;
&lt;li&gt;Alex Steele&lt;/li&gt;
&lt;li&gt;Alexi&lt;/li&gt;
&lt;li&gt;Ariel Eli&lt;/li&gt;
&lt;li&gt;DavidMei&lt;/li&gt;
&lt;li&gt;Eyüp Can Akman&lt;/li&gt;
&lt;li&gt;Jaume Delclòs Coll&lt;/li&gt;
&lt;li&gt;Kenny&lt;/li&gt;
&lt;li&gt;Leon Blakey&lt;/li&gt;
&lt;li&gt;Lynnesbian&lt;/li&gt;
&lt;li&gt;Martin Geisler&lt;/li&gt;
&lt;li&gt;Matthias Beyer&lt;/li&gt;
&lt;li&gt;Miikka Salminen&lt;/li&gt;
&lt;li&gt;Mora&lt;/li&gt;
&lt;li&gt;Noz Wu&lt;/li&gt;
&lt;li&gt;Paolo Barbolini&lt;/li&gt;
&lt;li&gt;Patrick Schneider&lt;/li&gt;
&lt;li&gt;Pierre-Marie Allard&lt;/li&gt;
&lt;li&gt;Samuel Batissou Tiburcio&lt;/li&gt;
&lt;li&gt;Terry Chen&lt;/li&gt;
&lt;li&gt;ThunderComplex&lt;/li&gt;
&lt;li&gt;Tommy Volk&lt;/li&gt;
&lt;li&gt;Vadim Petrochenkov&lt;/li&gt;
&lt;li&gt;Weixie Cui&lt;/li&gt;
&lt;li&gt;Will Buckner&lt;/li&gt;
&lt;li&gt;Zach&lt;/li&gt;
&lt;li&gt;arieleli01212&lt;/li&gt;
&lt;li&gt;barry3406&lt;/li&gt;
&lt;li&gt;ea935&lt;/li&gt;
&lt;li&gt;gr1zer1&lt;/li&gt;
&lt;li&gt;kvasi&lt;/li&gt;
&lt;li&gt;majiayu000&lt;/li&gt;
&lt;li&gt;malandrina&lt;/li&gt;
&lt;li&gt;simonzkl&lt;/li&gt;
&lt;li&gt;sjwang05&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Diesel 2.3.0</title><link>https://diesel.rs/news/2_3_0_release/</link><guid isPermaLink="true">https://diesel.rs/news/2_3_0_release/</guid><pubDate>Fri, 12 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Diesel 2.3.0 contains the contributions of 95 people. More than 1142 commits were submitted
over a span of 16 months.&lt;/p&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_3_0_release/#hasquery-derive-for-easier-query-construction&quot;&gt;Improved query construction via &lt;code&gt;#[derive(HasQuery)]&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_3_0_release/#support-for-window-functions&quot;&gt;Added support for window functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_3_0_release/#using-sqlite-with-wasm&quot;&gt;Using SQLite with WASM in your browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_3_0_release/#extended-support-for-various-types-functions-and-operators-in-the-postgresql-backend&quot;&gt;Extended support for various types, functions and operators in the PostgreSQL backend&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/news/2_3_0_release/#support-for-jsonjsonb-types-and-functions-for-sqlite&quot;&gt;Support for &lt;code&gt;JSON&lt;/code&gt; and &lt;code&gt;JSONB&lt;/code&gt; in the SQLite backend&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Checkout &lt;a href=&quot;https://diesel.rs/news/changelog.html&quot;&gt;the full change log&lt;/a&gt; for a complete list of changes.&lt;/p&gt;
&lt;p&gt;This release wouldn&apos;t be possible without the support of our contributors and sponsors. We would like to especially call out NLNet Foundation which funded the development of the newly added support for window functions via their &lt;a href=&quot;https://nlnet.nl/project/Diesel/&quot;&gt;NGI Zero Core&lt;/a&gt; initiative. We would also like to call out GitHub for providing additional training security and resources for the Diesel project as part of their &lt;a href=&quot;https://github.blog/open-source/maintainers/securing-the-supply-chain-at-scale-starting-with-71-important-open-source-projects/&quot;&gt;GitHub Secure Open Source Fund&lt;/a&gt; initiative.&lt;/p&gt;
&lt;p&gt;Nevertheless is the Diesel project always looking for support. You can help by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Contributing Code, Documentation or Guides. Checkout the planing for &lt;a href=&quot;https://github.com/orgs/diesel-rs/projects/1&quot;&gt;Diesel 2.4&lt;/a&gt; for open tasks.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;Answering questions in our &lt;a href=&quot;https://github.com/diesel-rs/diesel/discussions&quot;&gt;discussion forum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Reporting bugs in our &lt;a href=&quot;https://github.com/diesel-rs/diesel/issues&quot;&gt;issue tracker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Helping triaging issues in our &lt;a href=&quot;https://github.com/diesel-rs/diesel/issues&quot;&gt;issue tracker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/weiznich&quot;&gt;Sponsoring&lt;/a&gt; the maintainers.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;HasQuery derive for easier query construction&lt;/h2&gt;
&lt;p&gt;Diesel 2.3 provides a new &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/prelude/derive.HasQuery.html&quot;&gt;&lt;code&gt;#[derive(HasQuery)]&lt;/code&gt;&lt;/a&gt; attribute to construct query more directly from a Rust struct. This new derives extends the existing abilities of &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/expression/derive.Selectable.html&quot;&gt;&lt;code&gt;#[derive(Selectable)]&lt;/code&gt;&lt;/a&gt; by associating a specific &lt;code&gt;FROM&lt;/code&gt; clause and possible other clauses with the given struct. This derive also ensures that the query result can actually be loaded into this specific Rust type.&lt;/p&gt;
&lt;p&gt;For the most simple case you can use this derive as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;use crate::schema::users;

#[derive(HasQuery)]
struct User {
    id: i32,
    name: String,
}

let users = User::query().load(connection)?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which would be equivalent to deriving &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/deserialize/derive.Queryable.html&quot;&gt;&lt;code&gt;#[derive(Queryable)]&lt;/code&gt;&lt;/a&gt; + &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/expression/derive.Selectable.html&quot;&gt;&lt;code&gt;#[derive(Selectable)]&lt;/code&gt;&lt;/a&gt; and constructing the query via &lt;code&gt;users::table.select(User::as_select())&lt;/code&gt; in older Diesel versions.&lt;/p&gt;
&lt;p&gt;For more advanced usages you can also specify custom select expressions and &lt;code&gt;FROM&lt;/code&gt; clauses as part of the derive like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;use crate::schema::{employees, departments};

#[derive(HasQuery)]
#[diesel(base_query = employees::table.inner_join(departments::table))]
struct Employe {
    name: String,
    #[diesel(select_expression = departments::name)]
    department: String,
    salary: f64,
    #[diesel(select_expression = dsl::avg(employees::salary).partition_by(department::name))]
    avg_salary_per_department: f64,
}

let employees_with_salary = Employe::query()
    .filter(departments::name.eq_any([&quot;Developers&quot;, &quot;Maintainers&quot;]))
    .load(connection)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which would be equivalent to the following query:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;employees::table
    .inner_join(departments::table)
    .filter(departments::name.eq_any([&quot;Developers&quot;, &quot;Maintainers&quot;]))
    .select(Employe::as_select())
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The idea behind this feature is to provide an easier query entry point and also make it easier to share the same base query between different query construction sides all returning the same data structure.&lt;/p&gt;
&lt;h2&gt;Support for Window Functions&lt;/h2&gt;
&lt;p&gt;Diesel 2.3 introduces support for constructing &lt;a href=&quot;https://www.postgresql.org/docs/current/tutorial-window.html&quot;&gt;Window function expressions&lt;/a&gt; via the built-in DSL. This feature is supported on all built-in backends and allows to construct complex analytical queries using the provided DSL.&lt;/p&gt;
&lt;p&gt;Diesel provides a set of &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/dsl/index.html&quot;&gt;built-in Window&lt;/a&gt; functions and also allows to use most of the built-in aggregate functions as window functions. To construct a Window function call it is required to chain at least one &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/expression_methods/trait.WindowExpressionMethods.html&quot;&gt;&lt;code&gt;WindowExpressionMethods&lt;/code&gt;&lt;/a&gt; method after the actual function call. For example&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;employees::table
    .select(
        dsl::rank()
            .partition_by(employees::department)
            .window_order(employees::salary.desc())
            .frame_by(dsl::frame::Rows.frame_starts_with(dsl::frame::UnboundedPreceding))
    )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;corresponds to the following SQL query:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT
   RANK() OVER(PARTITION BY department ORDER BY salary DESC ROWS UNBOUNDED PRECEDING
FROM 
   employees
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Diesel ensures at compile time that the formed query is valid by restricting that window only function are used with an actual WINDOW clause, by restricting locations where you can use window functions and by restricting which constructs are supported by which backends.&lt;/p&gt;
&lt;p&gt;Finally you can also define your own window functions via the &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/expression/functions/attr.declare_sql_function.html&quot;&gt;&lt;code&gt;#[declare_sql_function]&lt;/code&gt;&lt;/a&gt; procedural macro like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[declare_sql_function]
extern &quot;SQL&quot; {
    #[window]
    fn row_number() -&amp;gt; BigInt;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We would like to thank the NLNet Foundation again for funding the development of this feature as part of their &lt;a href=&quot;https://nlnet.nl/project/Diesel&quot;&gt;NGI Zero Core&lt;/a&gt; initiative.&lt;/p&gt;
&lt;h2&gt;Using SQLite with WASM&lt;/h2&gt;
&lt;p&gt;Diesel 2.3 adds support for using the SQLite target with a &lt;code&gt;wasm32-unknown-unknown&lt;/code&gt; compilation target. This enables using Diesel in a web browser or in any other WASM-runtime.&lt;/p&gt;
&lt;p&gt;This functionality works out of the box by just switching the compilation target to &lt;code&gt;wasm32-unknown-unknown&lt;/code&gt;, although you might want to consider using a special VFS for actually store data in your web browser.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&quot;https://github.com/diesel-rs/diesel/tree/main/examples/sqlite/wasm&quot;&gt;the complete example for more details&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Extended support for various types, functions and operators in the PostgreSQL backend&lt;/h2&gt;
&lt;p&gt;We extended Diesel to provide support for the PostgreSQL specific &lt;a href=&quot;https://www.postgresql.org/docs/current/rangetypes.html&quot;&gt;&lt;code&gt;MULTIRANGE&lt;/code&gt;&lt;/a&gt; type and also to provide support for a large number of &lt;code&gt;RANGE&lt;/code&gt; and &lt;code&gt;MULTIRANGE&lt;/code&gt; specific operators and functions. This feature allows you to construct queries like these:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;diesel::select(dsl::int4range(1, 5, RangeBound::LowerBoundInclusiveUpperBoundExclusive).contains(4))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which would be equivalent to the following SQL:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT int4range(1,5) @&amp;gt; 4;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can find a list of all supported functions in the documentation of the &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/expression_methods/trait.PgRangeExpressionMethods.html&quot;&gt;&lt;code&gt;PgRangeExpressionMethods&lt;/code&gt;&lt;/a&gt; and a list of supported type mappings for the &lt;code&gt;MULTIRANGE&lt;/code&gt; types in the documentation of the corresponding &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/pg/sql_types/struct.Multirange.html&quot;&gt;SQL type&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In addition to the extended support for &lt;code&gt;RANGE&lt;/code&gt; and &lt;code&gt;MULTIRANGE&lt;/code&gt; types we also worked on adding a lot new functions for working with &lt;code&gt;ARRAY&lt;/code&gt;, &lt;code&gt;JSON&lt;/code&gt; and &lt;code&gt;JSONB&lt;/code&gt; types. This now covers the majority of functions provided by default by PostgreSQL for these types. See the &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/pg/expression/dsl/index.html&quot;&gt;documentation&lt;/a&gt; for a complete list.&lt;/p&gt;
&lt;h2&gt;Support for &lt;code&gt;JSON&lt;/code&gt;/&lt;code&gt;JSONB&lt;/code&gt; types and functions for SQLite&lt;/h2&gt;
&lt;p&gt;Finally we worked on extending the SQLite backend to support &lt;a href=&quot;https://sqlite.org/json1.html&quot;&gt;their built-in JSON types and functions&lt;/a&gt;. As a result both the &lt;code&gt;Json&lt;/code&gt; and &lt;code&gt;Jsonb&lt;/code&gt; SQL types provided by Diesel are now supported in the SQLite backend. The SQLite backend does not support these types as &lt;em&gt;column&lt;/em&gt; types, but requires you to use either the &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/sqlite/expression/functions/fn.json.html&quot;&gt;&lt;code&gt;json&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/sqlite/expression/functions/fn.jsonb.html&quot;&gt;&lt;code&gt;jsonb&lt;/code&gt;&lt;/a&gt; function to turn a &lt;code&gt;TEXT&lt;/code&gt; or &lt;code&gt;BINARY&lt;/code&gt; value into a JSON value. The later value then can be used for manipulating the content of the JSON value, constructing filters or loading values from the database.&lt;/p&gt;
&lt;p&gt;You can use this functionality like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let value = diesel::select(jsonb::&amp;lt;Binary, _&amp;gt;(br#&quot;{&quot;this&quot;:&quot;is&quot;,&quot;a&quot;:[&quot;test&quot;]}&quot;#))
    .get_result::&amp;lt;serde_json::Value&amp;gt;(connection)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to load JSON values from the database.&lt;/p&gt;
&lt;p&gt;See the &lt;a href=&quot;https://docs.diesel.rs/2.3.x/diesel/sqlite/expression/functions/index.html&quot;&gt;documentation&lt;/a&gt; for a list of supported functions and detailed examples.&lt;/p&gt;
&lt;h2&gt;Thanks&lt;/h2&gt;
&lt;p&gt;Thank you to everyone who helped to make this release happen through sponsoring, bug reports, and discussion on GitHub. While we don&apos;t have a way to collect stats on that form of contribution, it&apos;s greatly appreciated.&lt;/p&gt;
&lt;p&gt;In addition to the Diesel core team, 95 people contributed code to this release. A huge thank you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Abhishek Chanda&lt;/li&gt;
&lt;li&gt;accestfromim&lt;/li&gt;
&lt;li&gt;Albert Oudompheng&lt;/li&gt;
&lt;li&gt;Alex Steele&lt;/li&gt;
&lt;li&gt;Ali Tariq&lt;/li&gt;
&lt;li&gt;Ananth Prathap&lt;/li&gt;
&lt;li&gt;André&lt;/li&gt;
&lt;li&gt;Andrew Plaza&lt;/li&gt;
&lt;li&gt;Anna Ahmed&lt;/li&gt;
&lt;li&gt;Anton Vella&lt;/li&gt;
&lt;li&gt;Arpad Müller&lt;/li&gt;
&lt;li&gt;Azan Ali&lt;/li&gt;
&lt;li&gt;BlackDex&lt;/li&gt;
&lt;li&gt;bwqr&lt;/li&gt;
&lt;li&gt;Caio&lt;/li&gt;
&lt;li&gt;Caleb Bourg&lt;/li&gt;
&lt;li&gt;Carlos Carral C.&lt;/li&gt;
&lt;li&gt;Cole&lt;/li&gt;
&lt;li&gt;Daniele&lt;/li&gt;
&lt;li&gt;danila-b&lt;/li&gt;
&lt;li&gt;Delfi Sehidic&lt;/li&gt;
&lt;li&gt;Dhiren Serai&lt;/li&gt;
&lt;li&gt;Diana Alazzam&lt;/li&gt;
&lt;li&gt;Ed Cradock&lt;/li&gt;
&lt;li&gt;edwinlzs&lt;/li&gt;
&lt;li&gt;Elrendio&lt;/li&gt;
&lt;li&gt;Everett Pompeii&lt;/li&gt;
&lt;li&gt;Gary Coady&lt;/li&gt;
&lt;li&gt;Geoffroy Jaffa Planquart&lt;/li&gt;
&lt;li&gt;Guilherme Salustiano&lt;/li&gt;
&lt;li&gt;Hamir Mahal&lt;/li&gt;
&lt;li&gt;insky7&lt;/li&gt;
&lt;li&gt;Jakob K&lt;/li&gt;
&lt;li&gt;Jason White&lt;/li&gt;
&lt;li&gt;Jean-Marc Le Roux&lt;/li&gt;
&lt;li&gt;Jonas Schäfer&lt;/li&gt;
&lt;li&gt;Jonathan Alter&lt;/li&gt;
&lt;li&gt;Joona Brückner&lt;/li&gt;
&lt;li&gt;Julien Rouhaud&lt;/li&gt;
&lt;li&gt;Kevin GRONDIN&lt;/li&gt;
&lt;li&gt;Konrad Pagacz&lt;/li&gt;
&lt;li&gt;Kristof Mattei&lt;/li&gt;
&lt;li&gt;Kristopher Wuollett&lt;/li&gt;
&lt;li&gt;liamw1&lt;/li&gt;
&lt;li&gt;Logan Grosz&lt;/li&gt;
&lt;li&gt;LucaCappelletti94&lt;/li&gt;
&lt;li&gt;Lucas Sunsi Abreu&lt;/li&gt;
&lt;li&gt;Ludea&lt;/li&gt;
&lt;li&gt;Marvin Hansen&lt;/li&gt;
&lt;li&gt;meeshal&lt;/li&gt;
&lt;li&gt;mertwole&lt;/li&gt;
&lt;li&gt;Milo Moisson&lt;/li&gt;
&lt;li&gt;Mindaugas Vinkelis&lt;/li&gt;
&lt;li&gt;Moritz Pflanzer&lt;/li&gt;
&lt;li&gt;Nur&lt;/li&gt;
&lt;li&gt;Oleg Gushul&lt;/li&gt;
&lt;li&gt;Oliver Cooper&lt;/li&gt;
&lt;li&gt;Paolo Barbolini&lt;/li&gt;
&lt;li&gt;Pavan K Sunkara&lt;/li&gt;
&lt;li&gt;Pavan Kumar Sunkara&lt;/li&gt;
&lt;li&gt;philippuryas&lt;/li&gt;
&lt;li&gt;Pierre Fenoll&lt;/li&gt;
&lt;li&gt;Pratik Fandade&lt;/li&gt;
&lt;li&gt;Ramzi Sabra&lt;/li&gt;
&lt;li&gt;Randolf J.&lt;/li&gt;
&lt;li&gt;Renato Lochetti&lt;/li&gt;
&lt;li&gt;Saber Haj Rabiee&lt;/li&gt;
&lt;li&gt;Samuel Batissou&lt;/li&gt;
&lt;li&gt;schitcrafter&lt;/li&gt;
&lt;li&gt;Sebastian Goll&lt;/li&gt;
&lt;li&gt;Sebastian Thiel&lt;/li&gt;
&lt;li&gt;shray sharma&lt;/li&gt;
&lt;li&gt;Sindbad-Walter&lt;/li&gt;
&lt;li&gt;Sofía Aritz&lt;/li&gt;
&lt;li&gt;Spxg&lt;/li&gt;
&lt;li&gt;Stephen Thomas-Dorin&lt;/li&gt;
&lt;li&gt;Sugar&lt;/li&gt;
&lt;li&gt;Tanguille&lt;/li&gt;
&lt;li&gt;Tatounee&lt;/li&gt;
&lt;li&gt;Teoh Han Hui&lt;/li&gt;
&lt;li&gt;Thomas ARCHAMBEAU&lt;/li&gt;
&lt;li&gt;Thomas B&lt;/li&gt;
&lt;li&gt;Thomas Koch&lt;/li&gt;
&lt;li&gt;Tobias Bieniek&lt;/li&gt;
&lt;li&gt;VicVerevita&lt;/li&gt;
&lt;li&gt;vijair&lt;/li&gt;
&lt;li&gt;Vitaly Miniakhmetov&lt;/li&gt;
&lt;li&gt;Vladislav Dyachenko&lt;/li&gt;
&lt;li&gt;Vo Van Nghia&lt;/li&gt;
&lt;li&gt;Willow &quot;Wolveric&quot; Catkin&lt;/li&gt;
&lt;li&gt;Wolveric&lt;/li&gt;
&lt;li&gt;wowinter13&lt;/li&gt;
&lt;li&gt;xanonid&lt;/li&gt;
&lt;li&gt;Xue Haonan&lt;/li&gt;
&lt;li&gt;Zaira Bibi&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Diesel 2.2.0</title><link>https://diesel.rs/news/2_2_0_release/</link><guid isPermaLink="true">https://diesel.rs/news/2_2_0_release/</guid><pubDate>Fri, 31 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Diesel 2.2.0 contains the contributions of 42 people. More than 560 commits were submitted
over a span of 12 months.&lt;/p&gt;
&lt;p&gt;This release contains several new features and improves existing features. Diesel now provides a procedural macro attribute that infers the correct return type for your query. It&apos;s now possible to instrument connection implementations provided by diesel to perform logging and performance measurements. We added support for PostgreSQL&apos;s &lt;code&gt;COPY FROM&lt;/code&gt; and &lt;code&gt;COPY TO&lt;/code&gt; syntax which can be used to send and receive large amounts of data efficiently. Our dependencies wrapping the native database drivers support now all building the database driver as part of your &lt;code&gt;cargo build&lt;/code&gt;. This enables us to distribute static precompiled versions of diesel-cli easily. Finally we worked with the &lt;a href=&quot;https://blog.weiznich.de/blog/diagnostic-namespace-10-23/&quot;&gt;Rust team to stabilize&lt;/a&gt; attributes to customize error messages emitted by the compiler. This is now used by diesel to improve the quality of certain otherwise hard to understand error messages. Check out our &lt;a href=&quot;https://diesel.rs/changelog.html&quot;&gt;changelog for a complete list of changes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This release wouldn&apos;t be possible without the support of our contributors and sponsors. If you want to support diesels development, consider &lt;a href=&quot;https://github.com/diesel-rs/diesel/issues/1186&quot;&gt;joining the reviewer team&lt;/a&gt;, submitting &lt;a href=&quot;https://github.com/diesel-rs/diesel/issues?q=is%3Aissue+is%3Aopen++label%3A%22help+wanted%22+&quot;&gt;PR&apos;s&lt;/a&gt;, help writing documentation or &lt;a href=&quot;https://github.com/sponsors/weiznich&quot;&gt;sponsor the maintainers&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Automatic return type inference for QueryDSL types&lt;/h2&gt;
&lt;p&gt;Diesel&apos;s QueryDSL is designed to be composable through several functions since even before diesel 1.0. This enables you to move common parts of your query into a function and reuse that function from several places.&lt;/p&gt;
&lt;p&gt;In practice that requires specifying the return type of your query part, which is a complex composed highly nested type for anything that&apos;s not a trivial query. That made it hard for users to refactor their code to move common query parts into shared functions. Diesel 2.2 introduces the &lt;a href=&quot;https://docs.diesel.rs/2.2.x/diesel/dsl/attr.auto_type.html&quot;&gt;&lt;code&gt;#[diesel::dsl::auto_type]&lt;/code&gt;&lt;/a&gt; procedural macro attribute, which infers the correct return type for you.&lt;/p&gt;
&lt;p&gt;Without this attribute you would need to write code like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fn users_filtered_by_name(name: &amp;amp;str) -&amp;gt; dsl::Filter&amp;lt;users::table, dsl::Eq&amp;lt;users::name, &amp;amp;str&amp;gt;&amp;gt; {
    users::table.filter(users::name.eq(name))
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The new attribute enables you to write just:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[dsl::auto_type]
fn users_filtered_by_name(name: &amp;amp;str) -&amp;gt; _ {
    users::table.filter(users::name.eq(name))
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;#[dsl::auto_type]&lt;/code&gt; attribute macro replace the &lt;code&gt;_&lt;/code&gt; placeholder with the correct return type. See the &lt;a href=&quot;https://docs.diesel.rs/2.2.x/diesel/dsl/attr.auto_type.html&quot;&gt;documentation&lt;/a&gt; for more advanced examples and limitations.&lt;/p&gt;
&lt;h2&gt;Instrumentation Support&lt;/h2&gt;
&lt;p&gt;Diesel now provides support for instrumenting the built-in connections. This enables users to customize logging for these connection types. Diesel provides the &lt;a href=&quot;https://docs.diesel.rs/2.2.x/diesel/connection/trait.Connection.html#tymethod.set_instrumentation&quot;&gt;&lt;code&gt;Connection::set_instrumentation&lt;/code&gt;&lt;/a&gt; method that allows to set connection specific instrumentations. It also provides a global &lt;a href=&quot;https://docs.diesel.rs/2.2.x/diesel/connection/fn.set_default_instrumentation.html&quot;&gt;&lt;code&gt;diesel::connection::set_global_instrumentation&lt;/code&gt;&lt;/a&gt; that allows to set an instrumentation constructor that is used by all supported connection types.&lt;/p&gt;
&lt;p&gt;An &lt;a href=&quot;https://docs.diesel.rs/2.2.x/diesel/connection/trait.Instrumentation.html&quot;&gt;&lt;code&gt;Instrumentation&lt;/code&gt;&lt;/a&gt; is a user defined hook that allows to get notified for certain &lt;a href=&quot;https://docs.diesel.rs/2.2.x/diesel/connection/enum.InstrumentationEvent.html&quot;&gt;&lt;code&gt;InstrumentationEvent&lt;/code&gt;&lt;/a&gt;. By default the &lt;code&gt;Instrumentation&lt;/code&gt; trait is implemented for closures with a single &lt;code&gt;InstrumentationEvent&lt;/code&gt; argument, but it is possible to provide custom implementations for this trait. This enables our users to customize logging based on their preferences in terms of used logging crate, log levels and similar preferences.&lt;/p&gt;
&lt;p&gt;Example of a simple &lt;code&gt;println!&lt;/code&gt; based instrumentation that just logs everything to the standard output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let mut connection = PgConnection::establish(&quot;postgres://localhost/diesel&quot;)?;
connection.set_instrumentation(|event: InstrumentationEvent&amp;lt;&apos;_&amp;gt;| println!(&quot;{event:?}&quot;));
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;PostgreSQL COPY FROM/TO Support&lt;/h2&gt;
&lt;p&gt;Diesel now supports &lt;a href=&quot;https://www.postgresql.org/docs/current/sql-copy.html&quot;&gt;PostgreSQL&apos;s &lt;code&gt;COPY FROM STDIN&lt;/code&gt; and &lt;code&gt;COPY TO STDOUT&lt;/code&gt;&lt;/a&gt; syntax. This allows to efficiently transfer large amounts of data between the database and your application. Diesel supports two ways to use these commands, one for using the Diesel model structs as source or target for an optimised binary transfer and one that allows you to configure the low level statement in detail and provide your own input/output stream.&lt;/p&gt;
&lt;p&gt;Example &lt;code&gt;COPY FROM&lt;/code&gt; statement using an &lt;code&gt;Insertable&lt;/code&gt; struct:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[derive(Insertable)]
#[diesel(table_name = users)]
#[diesel(treat_none_as_default_value = false)]
struct NewUser {
    name: &amp;amp;&apos;static str,
}


let data = vec![
    NewUser { name: &quot;Diva Plavalaguna&quot; },
    NewUser { name: &quot;Father Vito Cornelius&quot; },
];

let count = diesel::copy_from(users::table)
    .from_insertable(&amp;amp;data)
    .execute(connection)?;

assert_eq!(count, 2);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Example &lt;code&gt;COPY FROM&lt;/code&gt; statement using the low level interface to provide a CSV stream:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;use diesel::pg::CopyFormat;
let count = diesel::copy_from(users::table)
    .from_raw_data(users::table, |copy| {
        writeln!(copy, &quot;3,Diva Plavalaguna&quot;).unwrap();
        writeln!(copy, &quot;4,Father Vito Cornelius&quot;).unwrap();
        diesel::QueryResult::Ok(())
    })
    .with_format(CopyFormat::Csv)
    .execute(connection)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;See the documentation of &lt;a href=&quot;https://docs.diesel.rs/2.2.x/diesel/fn.copy_to.html&quot;&gt;&lt;code&gt;diesel::copy_to&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://docs.diesel.rs/2.2.x/diesel/fn.copy_from.html&quot;&gt;&lt;code&gt;diesel::copy_from&lt;/code&gt;&lt;/a&gt; for more details.&lt;/p&gt;
&lt;h2&gt;Bundling support for all native drives and perbuild binaries for diesel-cli&lt;/h2&gt;
&lt;p&gt;We updated the &lt;a href=&quot;https://blog.weiznich.de/blog/pq-sys-05/&quot;&gt;pq-sys&lt;/a&gt; and &lt;a href=&quot;https://blog.weiznich.de/blog/mysqlclient-sys-03/&quot;&gt;mysqlclient-sys&lt;/a&gt; crates to provide a feature that allows to build both libraries as part of your local &lt;code&gt;cargo build&lt;/code&gt; command. This simplifies the setup of diesel in new environments and also makes it easier to cross compile applications using diesel. As with the existing bundling support for the SQLite backend you need to add the relevant crate to your &lt;code&gt;Cargo.toml&lt;/code&gt; and enable the &lt;code&gt;bundled&lt;/code&gt; feature for this crate. For &lt;code&gt;diesel-cli&lt;/code&gt; we now provide a &lt;code&gt;postgres-bundled&lt;/code&gt; and a &lt;code&gt;mysql-bundled&lt;/code&gt; feature flag as well.&lt;/p&gt;
&lt;p&gt;As a result of this work we are now able to build fully static binaries for &lt;code&gt;diesel-cli&lt;/code&gt;. Such builds are now provided as part of each release as prebuild binaries. This hopefully streamlines the setup process for new users, although you can continue to use &lt;code&gt;cargo install diesel_cli&lt;/code&gt; to locally build your version of diesel-cli.&lt;/p&gt;
&lt;h2&gt;Improved Error Messages&lt;/h2&gt;
&lt;p&gt;We worked with the &lt;a href=&quot;https://blog.weiznich.de/blog/diagnostic-namespace-10-23/&quot;&gt;Rust team to stabilize&lt;/a&gt; attributes to customize error messages emitted by the compiler. This allows us to include custom messages directly in the compiler error message to hint possible solutions.&lt;/p&gt;
&lt;p&gt;The following two examples demonstrate the new error messages:&lt;/p&gt;
&lt;p&gt;For type mismatches between your query and the result type we now include explicit hints to use &lt;code&gt;#[derive(Selectable)]&lt;/code&gt; + &lt;code&gt;#[diesel(check_for_backend(…))]&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text): load_dsl::private::CompatibleType&amp;lt;User, _&amp;gt;` is not satisfied
  --&amp;gt; tests/fail/queryable_with_typemismatch.rs:21:31
   |
21 |     users::table.load::&amp;lt;User&amp;gt;(&amp;amp;mut conn).unwrap();
   |                  ----         ^^^^^^^^^ the trait `load_dsl::private::CompatibleType&amp;lt;User, _&amp;gt;` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text)`, which is required by `users::table: LoadQuery&amp;lt;&apos;_, _, User&amp;gt;`
   |                  |
   |                  required by a bound introduced by this call
   |
   = note: this is a mismatch between what your query returns and what your type expects the query to return
   = note: the fields in your struct need to match the fields returned by your query in count, order and type
   = note: consider using `#[derive(Selectable)]` + `#[diesel(check_for_backend(_))]` on your struct `User` and
           in your query `.select(UserWithToManyFields::as_select())` to get a better error message
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For field type mismatches rustc now explicitly tells you that this mapping is not supported:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;error[E0277]: cannot deserialize a value of the database type `diesel::sql_types::Integer` as `*const str`
  --&amp;gt; tests/fail/broken_queryable_by_name.rs:16:5
   |
16 |     id: String,
   |     ^^^^^^^^^^ the trait `FromSql&amp;lt;diesel::sql_types::Integer, Pg&amp;gt;` is not implemented for `*const str`, which is required by `std::string::String: FromSqlRow&amp;lt;diesel::sql_types::Integer, Pg&amp;gt;`
   |
   = note: double check your type mappings via the documentation of `diesel::sql_types::Integer`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Diesel 2.2 includes similar improvements for many more error messages. Improving hard to understand error messages is still an ongoing project so please reach out with examples if you hit a particular bad error message. This enables us to further improve the messages by either adding the new attribute there as well or by working with the Rust team to introduce additional attributes to cover more cases.&lt;/p&gt;
&lt;h2&gt;Thanks&lt;/h2&gt;
&lt;p&gt;Thank you to everyone who helped to make this release happen through sponsoring, bug reports, and discussion on GitHub and Gitter. While we don&apos;t have a way to collect stats on that form of contribution, it&apos;s greatly appreciated.&lt;/p&gt;
&lt;p&gt;In addition to the Diesel core team, 60 people contributed code to this release. A huge thank you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Alexander &apos;z33ky&apos; Hirsch&lt;/li&gt;
&lt;li&gt;aumetra&lt;/li&gt;
&lt;li&gt;BlackDex&lt;/li&gt;
&lt;li&gt;Caio&lt;/li&gt;
&lt;li&gt;Daniel Sousa&lt;/li&gt;
&lt;li&gt;Danilo Bargen&lt;/li&gt;
&lt;li&gt;Danny Goldberg&lt;/li&gt;
&lt;li&gt;David Soria Parra&lt;/li&gt;
&lt;li&gt;Davis Muro&lt;/li&gt;
&lt;li&gt;Denny Biasiolli&lt;/li&gt;
&lt;li&gt;Dessalines&lt;/li&gt;
&lt;li&gt;Drew Vogel&lt;/li&gt;
&lt;li&gt;dullbananas&lt;/li&gt;
&lt;li&gt;Elrendio&lt;/li&gt;
&lt;li&gt;Emile Fugulin&lt;/li&gt;
&lt;li&gt;Ernest Rudnicki&lt;/li&gt;
&lt;li&gt;Everett Pompeii&lt;/li&gt;
&lt;li&gt;forest1102&lt;/li&gt;
&lt;li&gt;George Manning&lt;/li&gt;
&lt;li&gt;hasezoey&lt;/li&gt;
&lt;li&gt;Henry Zimmerman&lt;/li&gt;
&lt;li&gt;ISibboI&lt;/li&gt;
&lt;li&gt;Jonathan Boyle&lt;/li&gt;
&lt;li&gt;Junghyun Nam&lt;/li&gt;
&lt;li&gt;Kevin GRONDIN&lt;/li&gt;
&lt;li&gt;kirk&lt;/li&gt;
&lt;li&gt;Kornel&lt;/li&gt;
&lt;li&gt;Kristopher Wuollett&lt;/li&gt;
&lt;li&gt;Marc Coleman&lt;/li&gt;
&lt;li&gt;Maxi Barmetler&lt;/li&gt;
&lt;li&gt;Michael Bachmann&lt;/li&gt;
&lt;li&gt;Minsung Kim&lt;/li&gt;
&lt;li&gt;Mohamed Belaouad&lt;/li&gt;
&lt;li&gt;Moulins&lt;/li&gt;
&lt;li&gt;obsoleszenz&lt;/li&gt;
&lt;li&gt;Omid Rad&lt;/li&gt;
&lt;li&gt;Orne Brocaar&lt;/li&gt;
&lt;li&gt;Paolo Barbolini&lt;/li&gt;
&lt;li&gt;Pavan Kumar Sunkara&lt;/li&gt;
&lt;li&gt;Peter C. S. Scholtens&lt;/li&gt;
&lt;li&gt;retro&lt;/li&gt;
&lt;li&gt;sabati&lt;/li&gt;
&lt;li&gt;Saber Haj Rabiee&lt;/li&gt;
&lt;li&gt;Samuel Batissou&lt;/li&gt;
&lt;li&gt;Sean Klein&lt;/li&gt;
&lt;li&gt;Sebastian Fritsch&lt;/li&gt;
&lt;li&gt;Sebastian N. Fernandez&lt;/li&gt;
&lt;li&gt;Sebastian Schmidt&lt;/li&gt;
&lt;li&gt;Sebastian Urban&lt;/li&gt;
&lt;li&gt;Serhii Potapov&lt;/li&gt;
&lt;li&gt;Simon Eisenmann&lt;/li&gt;
&lt;li&gt;snf&lt;/li&gt;
&lt;li&gt;Tal Pressman&lt;/li&gt;
&lt;li&gt;Tanguille&lt;/li&gt;
&lt;li&gt;Thomas Constantine Moore&lt;/li&gt;
&lt;li&gt;Tommy McCallig&lt;/li&gt;
&lt;li&gt;Viktor Szépe&lt;/li&gt;
&lt;li&gt;yagince&lt;/li&gt;
&lt;li&gt;Zhai Xiang&lt;/li&gt;
&lt;li&gt;森田一世&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Diesel 2.1.0</title><link>https://diesel.rs/news/2_1_0_release/</link><guid isPermaLink="true">https://diesel.rs/news/2_1_0_release/</guid><pubDate>Fri, 26 May 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Diesel 2.1.0 contains the contributions of 42 people. More than 380 commits were submitted
over a span of 9 months.&lt;/p&gt;
&lt;p&gt;This release contains several new features and improves existing features. It introduces support for generating migrations based on the diff between your &lt;code&gt;schema.rs&lt;/code&gt; file and your database via Diesel CLI. Diesel derives now provides a &lt;code&gt;#[derive(MultiConnection)]&lt;/code&gt; derive macro that allows to easily combine different database connections into a single enum, which implements &lt;code&gt;Connection&lt;/code&gt; on its own. The MySQL backend gets support for &lt;code&gt;upsert&lt;/code&gt; queries via the &lt;code&gt;ON DUPLICATE KEYS&lt;/code&gt; syntax. Finally we provide new tooling to improve complex error messages generated for common error cases. Check out our &lt;a href=&quot;https://diesel.rs/changelog.html&quot;&gt;changelog for a complete list of changes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This release wouldn&apos;t be possible without the support of our contributors and sponsors. If you want to support diesels development, consider &lt;a href=&quot;https://github.com/diesel-rs/diesel/issues?q=reviewer+is%3Aopen&quot;&gt;joining the reviewer team&lt;/a&gt;, submitting &lt;a href=&quot;https://github.com/diesel-rs/diesel/issues?q=is%3Aissue+is%3Aopen++label%3A%22help+wanted%22+&quot;&gt;PR&apos;s&lt;/a&gt;, help writing documentation or &lt;a href=&quot;https://github.com/sponsors/weiznich&quot;&gt;sponsor the maintainers&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Migration generation&lt;/h2&gt;
&lt;p&gt;Diesel CLI now includes support for generating migrations based on the difference of your &lt;code&gt;schema.rs&lt;/code&gt; file and your local database.
This works as following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start editing your &lt;code&gt;schema.rs&lt;/code&gt; file, for example by adding your first table:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;diesel::table! {
    users {
        id -&amp;gt; Integer,
        name -&amp;gt; Text,
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;diesel migration generate my_first_migration --diff-schema --database-url DATABASE_URL&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Checkout, verify and possible modify the generated migration:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;-- Your SQL goes here
CREATE TABLE `users`(
	`id` INTEGER NOT NULL PRIMARY KEY,
	`name` TEXT NOT NULL
);
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Run the migration via &lt;code&gt;diesel migration run --database-url DATABASE_URL&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It&apos;s important to note that the generated migrations can only contain information that are part of the &lt;code&gt;schema.rs&lt;/code&gt; 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.&lt;/p&gt;
&lt;h2&gt;&lt;code&gt;MultiConnection&lt;/code&gt; support&lt;/h2&gt;
&lt;p&gt;Diesel now includes a &lt;a href=&quot;https://docs.diesel.rs/2.1.x/diesel/derive.MultiConnection.html&quot;&gt;&lt;code&gt;#[derive(MultiConnection)]&lt;/code&gt;&lt;/a&gt; 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:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[derive(diesel::MultiConnection)]
pub enum AnyConnection {
    Postgresql(diesel::PgConnection),
    Mysql(diesel::MysqlConnection),
    Sqlite(diesel::SqliteConnection),
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Afterwards the &lt;code&gt;AnyConnection&lt;/code&gt; type can be used as ordinary connection:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fn use_multi(conn: &amp;amp;mut AnyConnection) -&amp;gt; QueryResult&amp;lt;()&amp;gt; {
   // Use the connection enum as any other connection type
   // for inserting/updating/loading/…
   diesel::insert_into(users::table)
       .values(users::name.eq(&quot;Sean&quot;))
       .execute(conn)?;

   let users = users::table.load::&amp;lt;(i32, String)&amp;gt;(conn)?;
   Ok(())
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By default this connection type will only support a subset of SQL that&apos;s supported by all inner connection types. By being an enum it&apos;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:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select the backends you actually use&lt;/li&gt;
&lt;li&gt;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 &lt;a href=&quot;https://docs.diesel.rs/2.1.x/diesel/connection/trait.MultiConnectionHelper.html&quot;&gt;&lt;code&gt;MultiConnectionHelper&lt;/code&gt;&lt;/a&gt; trait in addition to the existing &lt;code&gt;Connection&lt;/code&gt; trait.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Upsert support for the MySQL backend&lt;/h2&gt;
&lt;p&gt;Diesel 2.1 adds support for &lt;code&gt;INSERT INTO … ON DUPLICATE KEYS …&lt;/code&gt; queries for the MySQL backend using the existing &lt;a href=&quot;https://docs.diesel.rs/2.1.x/diesel/query_builder/struct.InsertStatement.html#on-duplicate-key&quot;&gt;&lt;code&gt;upsert&lt;/code&gt;&lt;/a&gt; framework. It&apos;s now possible to write such queries using the diesel provided DSL:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;diesel::insert_into(users)
    .values(&amp;amp;user2)
    .on_conflict(diesel::dsl::DuplicatedKeys)
    .do_update()
    .set(name.eq(&quot;I DONT KNOW ANYMORE&quot;))
    .execute(conn)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Improved error messages&lt;/h2&gt;
&lt;p&gt;We spend some effort to improve error messages generated by rustc for common diesel issues further.&lt;/p&gt;
&lt;p&gt;Consider the following example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;table! {
    users {
        id -&amp;gt; Integer,
        name -&amp;gt; Text,
    }
}

#[derive(Queryable)]
struct User {
    name: String,
    id: i32,
}


users::table.load::&amp;lt;User&amp;gt;(&amp;amp;mut conn)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which would generate the following error message:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text): load_dsl::private::CompatibleType&amp;lt;User, Mysql&amp;gt;` is not satisfied
    --&amp;gt; src/main.rs:20:31
     |
20   |     users::table.load::&amp;lt;User&amp;gt;(&amp;amp;mut conn);
     |                  ----         ^^^^^^^^^ the trait `load_dsl::private::CompatibleType&amp;lt;User, Mysql&amp;gt;` 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&amp;lt;U, DB&amp;gt;`:
               (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&amp;lt;&apos;_, _, User&amp;gt;`
note: required by a bound in `diesel::RunQueryDsl::load`
    --&amp;gt; /home/weiznich/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/ef6252e/diesel/src/query_dsl/mod.rs:1543:15
     |
1543 |         Self: LoadQuery&amp;lt;&apos;query, Conn, U&amp;gt;,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is caused by an field order mismatch between what your query returns and what your struct expects the query to return.&lt;/p&gt;
&lt;p&gt;With diesel 2.0 we introduced the &lt;code&gt;Selectable&lt;/code&gt; 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:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[derive(Queryable, Selectable)]
struct User {
    name: i32,
    id: i32,
}

users::table.select(User::as_select()).load(&amp;amp;mut conn);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which generates the following error message:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;error[E0277]: the trait bound `expression::select_by::SelectBy&amp;lt;User, _&amp;gt;: load_dsl::private::CompatibleType&amp;lt;_, _&amp;gt;` is not satisfied
    --&amp;gt; src/main.rs:20:49
     |
20   |     users::table.select(User::as_select()).load(&amp;amp;mut conn);
     |                                            ---- ^^^^^^^^^ the trait `load_dsl::private::CompatibleType&amp;lt;_, _&amp;gt;` is not implemented for `expression::select_by::SelectBy&amp;lt;User, _&amp;gt;`
     |                                            |
     |                                            required by a bound introduced by this call
     |
     = help: the trait `load_dsl::private::CompatibleType&amp;lt;U, DB&amp;gt;` is implemented for `expression::select_by::SelectBy&amp;lt;U, DB&amp;gt;`
     = note: required for `SelectStatement&amp;lt;FromClause&amp;lt;users::table&amp;gt;, query_builder::select_clause::SelectClause&amp;lt;expression::select_by::SelectBy&amp;lt;User, _&amp;gt;&amp;gt;&amp;gt;` to implement `LoadQuery&amp;lt;&apos;_, _, _&amp;gt;`
note: required by a bound in `diesel::RunQueryDsl::load`
    --&amp;gt; /home/weiznich/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/ef6252e/diesel/src/query_dsl/mod.rs:1543:15
     |
1543 |         Self: LoadQuery&amp;lt;&apos;query, Conn, U&amp;gt;,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is caused by a type mismatch in the &lt;code&gt;name&lt;/code&gt; field. With diesel 2.1 we now introduce an additional &lt;a href=&quot;https://docs.diesel.rs/2.1.x/diesel/expression/derive.Selectable.html#optional-type-attributes&quot;&gt;&lt;code&gt;#[diesel(check_for_backend(diesel::backend::BackendType))]&lt;/code&gt;&lt;/a&gt; attribute that greatly improves the error messages generated for these cases. This helps pining down which field exactly causes a type mismatch.&lt;/p&gt;
&lt;p&gt;By applying this attribute to our example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[derive(Queryable, Selectable)]
#[diesel(check_for_backend(diesel::mysql::Mysql))]
struct User {
    name: i32,
    id: i32,
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;we get the following error message:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;error[E0277]: the trait bound `i32: FromSql&amp;lt;diesel::sql_types::Text, Mysql&amp;gt;` is not satisfied
  --&amp;gt; src/main.rs:13:11
   |
13 |     name: i32,
   |           ^^^ the trait `FromSql&amp;lt;diesel::sql_types::Text, Mysql&amp;gt;` is not implemented for `i32`
   |
   = help: the trait `FromSql&amp;lt;diesel::sql_types::Integer, Mysql&amp;gt;` is implemented for `i32`
   = note: required for `i32` to implement `diesel::Queryable&amp;lt;diesel::sql_types::Text, Mysql&amp;gt;`
   = note: required for `i32` to implement `FromSqlRow&amp;lt;diesel::sql_types::Text, Mysql&amp;gt;`
   = help: see issue #48214
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This error message now points to the exact cause of the issue: You cannot deserialize an &lt;code&gt;Text&lt;/code&gt; value into a &lt;code&gt;i32&lt;/code&gt; 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, &lt;code&gt;#[derive(Queryable)]&lt;/code&gt; and &lt;code&gt;#[derive(Selectable)]&lt;/code&gt; or &lt;code&gt;#[derive(QueryableByName)]&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Internal changes&lt;/h2&gt;
&lt;p&gt;Changes listed here are relevant for crates using the &lt;code&gt;i-implement-a-third-party-backend-and-opt-into-breaking-changes&lt;/code&gt; feature flag.
With Diesel 2.1 we have migrated some traits to use GAT. This affects the following traits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;RowGatWorkaround&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ConnectionGatWorkaround&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HasRawValue&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HasBindCollector&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These traits are removed in favour of generic associated types on the corresponding child trait.&lt;/p&gt;
&lt;p&gt;Additionally we slightly relaxed one trait bound on &lt;code&gt;BindCollector::push_bound_value&lt;/code&gt; to allow unsized values there as well.&lt;/p&gt;
&lt;h2&gt;Thanks&lt;/h2&gt;
&lt;p&gt;Thank you to everyone who helped make this release happen through sponsoring, bug reports, and discussion on GitHub and Gitter. While we don&apos;t have a way to collect stats on that form of contribution, it&apos;s greatly appreciated.&lt;/p&gt;
&lt;p&gt;In addition to the Diesel core team, 42 people contributed code to this release. A huge thank you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;6293&lt;/li&gt;
&lt;li&gt;Aleksei Orazov&lt;/li&gt;
&lt;li&gt;Alexx Roche&lt;/li&gt;
&lt;li&gt;AndrolGenhald&lt;/li&gt;
&lt;li&gt;AndyJado&lt;/li&gt;
&lt;li&gt;Artemis Livingstone&lt;/li&gt;
&lt;li&gt;czotomo&lt;/li&gt;
&lt;li&gt;Diana&lt;/li&gt;
&lt;li&gt;Elliott Forde&lt;/li&gt;
&lt;li&gt;Elrendio&lt;/li&gt;
&lt;li&gt;Gorg Worgington&lt;/li&gt;
&lt;li&gt;Heliozoa&lt;/li&gt;
&lt;li&gt;Ian&lt;/li&gt;
&lt;li&gt;Jake Goulding&lt;/li&gt;
&lt;li&gt;Jeff Schwab&lt;/li&gt;
&lt;li&gt;Jeremy Lardenois&lt;/li&gt;
&lt;li&gt;johnmai&lt;/li&gt;
&lt;li&gt;Leonardo Yvens&lt;/li&gt;
&lt;li&gt;mikemcdermottredjack&lt;/li&gt;
&lt;li&gt;Moritz Hedtke&lt;/li&gt;
&lt;li&gt;MOZGIII&lt;/li&gt;
&lt;li&gt;Neil Svedberg&lt;/li&gt;
&lt;li&gt;Neo&lt;/li&gt;
&lt;li&gt;Nishant Joshi&lt;/li&gt;
&lt;li&gt;Oliver Cooper&lt;/li&gt;
&lt;li&gt;Omid Rad&lt;/li&gt;
&lt;li&gt;Pablito Labarta&lt;/li&gt;
&lt;li&gt;Pavan Kumar Sunkara&lt;/li&gt;
&lt;li&gt;Peter Todorov&lt;/li&gt;
&lt;li&gt;Rutvik Patel&lt;/li&gt;
&lt;li&gt;Sanchith Hegde&lt;/li&gt;
&lt;li&gt;schlamar&lt;/li&gt;
&lt;li&gt;sebasv&lt;/li&gt;
&lt;li&gt;Silas McCroskey&lt;/li&gt;
&lt;li&gt;Šimon Lukašík&lt;/li&gt;
&lt;li&gt;Steven Chu&lt;/li&gt;
&lt;li&gt;stormofice&lt;/li&gt;
&lt;li&gt;Thomas Sieverding&lt;/li&gt;
&lt;li&gt;Trevor Gross&lt;/li&gt;
&lt;li&gt;Yuki Okushi&lt;/li&gt;
&lt;li&gt;无穷无尽的爱&lt;/li&gt;
&lt;li&gt;管唯宇&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Diesel 2.0.0</title><link>https://diesel.rs/news/2_0_0_release/</link><guid isPermaLink="true">https://diesel.rs/news/2_0_0_release/</guid><pubDate>Mon, 29 Aug 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Diesel 2.0.0 contains the contributions of more than 130 people. More than 1700 commits were submitted
over a span of 3 years.&lt;/p&gt;
&lt;p&gt;As part of this release we introduced numerous new features and rewrote large parts of the internal structure.
Check out our &lt;a href=&quot;https://diesel.rs/changelog.html&quot;&gt;changelog for a complete list of changes&lt;/a&gt;. As this is a new major Diesel release it contains a number of breaking changes. Checkout our &lt;a href=&quot;https://diesel.rs/guides/migration-guide/&quot;&gt;migration guide&lt;/a&gt; for details about how to handle those breaking changes.&lt;/p&gt;
&lt;p&gt;This release contains the following parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;diesel 2.0.0&lt;/li&gt;
&lt;li&gt;diesel_derives 2.0.0&lt;/li&gt;
&lt;li&gt;diesel_migrations 2.0.0&lt;/li&gt;
&lt;li&gt;diesel_cli 2.0.0&lt;/li&gt;
&lt;li&gt;diesel_dynamic_schema 0.2.0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Support the development of Diesel by &lt;a href=&quot;https://github.com/diesel-rs/diesel&quot;&gt;sponsoring our work on GitHub&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Features&lt;/h2&gt;
&lt;p&gt;As a highlight Diesel 2.0.0 adds support for the following features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fully type checked &lt;code&gt;GROUP BY&lt;/code&gt; support&lt;/li&gt;
&lt;li&gt;Support for table aliasing&lt;/li&gt;
&lt;li&gt;Support for defining select clauses via a corresponding type&lt;/li&gt;
&lt;li&gt;Support for &lt;code&gt;UNION&lt;/code&gt;/&lt;code&gt;INTERSECT&lt;/code&gt; queries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition to the highlighted features Diesel 2.0.0 fixes several issues in our type level SQL representation such that it now correctly handles the following cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mixed nested &lt;code&gt;LEFT JOINS&lt;/code&gt; and &lt;code&gt;INNER JOINS&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Chaining mixed nullable expressions via &lt;code&gt;AND&lt;/code&gt;, &lt;code&gt;OR&lt;/code&gt; and similar operators&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Support for &lt;code&gt;GROUP BY&lt;/code&gt; clauses&lt;/h3&gt;
&lt;p&gt;Diesel 2.0 adds support for &lt;code&gt;GROUP BY&lt;/code&gt; clauses for select queries.&lt;/p&gt;
&lt;p&gt;This means queries like the following one will just work.&lt;/p&gt;
&lt;p&gt;&lt;a&gt;Example&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; users::table.inner_join(posts::table)
    .group_by(users::id)
    .select((users::name, count(posts::id)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As this is the case for all other Diesel built-in query dsl, this construct is fully checked at compile time. This means Diesel
will ensure that the &lt;code&gt;GROUP BY&lt;/code&gt; clause is valid for the current query and it will also ensure that expressions appearing inside
of your &lt;code&gt;SELECT&lt;/code&gt; clause will match the aggregation rules provided by the current &lt;code&gt;GROUP BY&lt;/code&gt; clause. Checkout the documentation of &lt;a href=&quot;https://docs.diesel.rs/2.0.x/diesel/prelude/trait.QueryDsl.html#method.group_by&quot;&gt;&lt;code&gt;QueryDsl::group_by&lt;/code&gt;&lt;/a&gt; for examples.&lt;/p&gt;
&lt;h3&gt;Support for table aliasing&lt;/h3&gt;
&lt;p&gt;Diesel 2.0 adds support for table aliasing. This enables users to write queries, where a table appears more than once in the corresponding
&lt;code&gt;FROM&lt;/code&gt; clause. For this Diesel provides a &lt;a href=&quot;https://docs.diesel.rs/2.0.x/diesel/macro.alias.html&quot;&gt;&lt;code&gt;diesel::alias!&lt;/code&gt;&lt;/a&gt; macro that allows to define new alias for existing tables.&lt;/p&gt;
&lt;p&gt;The following query demonstrates the support for this feature:&lt;/p&gt;
&lt;p&gt;&lt;a&gt;Example&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Define new table alias for the existing `users` table
let users1 = diesel::alias!(schema::users as user1);

// Use the corresponding alias inside any existing query
users::table
    .inner_join(users1.on(users::id).eq(users1.field(users::id))))
    .select((users::id, users::name, users1.field(users::name)))
    .order_by(users1.field(users::id))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Again all of this is checked at compile time. So similar to a normal table, columns from aliases are only allowed to appear if
the corresponding query actually uses the alias.&lt;/p&gt;
&lt;h3&gt;Implied selection via the new &lt;code&gt;Selectable&lt;/code&gt; trait&lt;/h3&gt;
&lt;p&gt;Diesel 2.0 features a new &lt;a href=&quot;https://docs.diesel.rs/2.0.x/diesel/expression/trait.Selectable.html&quot;&gt;&lt;code&gt;Selectable&lt;/code&gt;&lt;/a&gt; trait and derive that lets users declare that a type expects a certain kind of select clause.
The major use case for this feature is to ensure that columns from a specific query are always requested in the right order
for a corresponding type implementing &lt;code&gt;Queryable&lt;/code&gt;. This also works for complex queries involving joins or other kinds of nesting.&lt;/p&gt;
&lt;p&gt;&lt;a&gt;Example&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[derive(Queryable, Selectable)]
struct User {
    id: i32,
    name: String,
}

let first_user = users.select(User::as_select()).first(connection)?;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Diesel enforces at type system level that once you provided such a select clause via &lt;code&gt;User::as_select()&lt;/code&gt; you are only allowed
to construct this type from the returned result of the corresponding query. This means there is no need to specify the &lt;code&gt;User&lt;/code&gt; type
twice in the query above.&lt;/p&gt;
&lt;h3&gt;Support for &lt;code&gt;UNION&lt;/code&gt;/&lt;code&gt;INTERSECT&lt;/code&gt;/&lt;code&gt;EXCEPT&lt;/code&gt; queries&lt;/h3&gt;
&lt;p&gt;Diesel 2.0 extents the query builder to support query combinations via &lt;code&gt;UNION&lt;/code&gt;/&lt;code&gt;INTERSECT&lt;/code&gt;/&lt;code&gt;EXCEPT&lt;/code&gt;. This allows you
to easily chain multiple queries together as long as they return fields of the same type. Queries like the following
one are now supported:&lt;/p&gt;
&lt;p&gt;&lt;a&gt;Example&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; users.select(user_name.nullable())
    .union(animals.select(animal_name).filter(animal_name.is_not_null()))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As always this is checked at compile time to reject invalid queries, like for example that ones containing select
clauses with different fields. Checkout the documentation of &lt;a href=&quot;https://docs.diesel.rs/2.0.x/diesel/prelude/trait.CombineDsl.html&quot;&gt;&lt;code&gt;CombineDsl&lt;/code&gt;&lt;/a&gt; for details.&lt;/p&gt;
&lt;h2&gt;Call for Participation&lt;/h2&gt;
&lt;p&gt;The release of Diesel 2.0 does not only include the features listed above, but also marks the
point where the following things can be provided by third party crates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Custom &lt;code&gt;QueryDsl&lt;/code&gt; extensions to support previously unsupported SQL features. Checkout
&lt;a href=&quot;https://github.com/diesel-rs/diesel_full_text_search&quot;&gt;&lt;code&gt;diesel_full_text_search&lt;/code&gt;&lt;/a&gt; for an example&lt;/li&gt;
&lt;li&gt;Alternative query dsl implementations reusing the existing &lt;code&gt;Connection&lt;/code&gt; infrastructure&lt;/li&gt;
&lt;li&gt;Custom &lt;a href=&quot;https://docs.diesel.rs/2.0.x/diesel/connection/trait.Connection.html#provide-a-new-connection-implementation-for-an-existing-backend&quot;&gt;&lt;code&gt;Connection&lt;/code&gt;&lt;/a&gt; implementations for existing backends&lt;/li&gt;
&lt;li&gt;Custom &lt;a href=&quot;https://docs.diesel.rs/2.0.x/diesel/connection/trait.Connection.html#implement-support-for-an-unsupported-database-system&quot;&gt;&lt;code&gt;Connection&lt;/code&gt;&lt;/a&gt;
and &lt;a href=&quot;https://docs.diesel.rs/2.0.x/diesel/backend/trait.Backend.html#implementing-a-custom-backend&quot;&gt;&lt;code&gt;Backend&lt;/code&gt;&lt;/a&gt; implementations for previously unsupported backends. Checkout &lt;a href=&quot;https://github.com/GiGainfosystems/diesel-oci&quot;&gt;diesel-oci&lt;/a&gt; for an example.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We encourage our community to try out those features. Especially we would like to see experimentation around:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Previously unsupported database backends&lt;/li&gt;
&lt;li&gt;Pure rust implementations of existing backend implementations. Checkout &lt;a href=&quot;https://github.com/sfackler/rust-postgres/issues/890&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;https://github.com/blackbeam/rust-mysql-simple/discussions/320&quot;&gt;this&lt;/a&gt; discussion for starting points.&lt;/li&gt;
&lt;li&gt;Alternative query dsl implementations. Checkout &lt;a href=&quot;https://github.com/SeaQL/sea-query/discussions/168&quot;&gt;this discussion&lt;/a&gt; as starting point.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please get in touch with us for pointers, help and details.&lt;/p&gt;
&lt;h2&gt;Input for Future Roadmap&lt;/h2&gt;
&lt;p&gt;With the release of Diesel 2.0 the planing for our next releases start. Hopefully they will not take as long as Diesel 2.0. We are looking for input on which features are wanted by our community. Please open a discussion thread with your idea in our &lt;a href=&quot;https://github.com/diesel-rs/diesel/discussions/categories/ideas&quot;&gt;discussion forum&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Weiznich will work on improving error messages for trait heavy crates based on a Rust Foundation Project Grant. This work will hopefully improve error messages for Diesel as well. If you are aware of bad error messages please submit a
minimal example &lt;a href=&quot;https://github.com/weiznich/rust-foundation-community-grant&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Update considerations&lt;/h2&gt;
&lt;p&gt;Diesel 2.0 introduces substantial changes to Diesel&apos;s inner workings.
In some cases this impacts code written using Diesel 1.4.x.
This document outlines notable changes and presents potential update strategies.
We recommend to start the upgrade by removing the usage of all items that
are marked as deprecated in Diesel 1.4.x.&lt;/p&gt;
&lt;p&gt;Any code base migrating from Diesel 1.4.x to Diesel 2.0 is expected to be affected at least by
the following changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-mutable-connection&quot;&gt;Diesel now requires a mutable reference to the connection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-derive-attributes&quot;&gt;Changed derive attributes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users of &lt;code&gt;diesel_migration&lt;/code&gt; are additionally affected by the following change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-upgrade-migrations&quot;&gt;&lt;code&gt;diesel_migration&lt;/code&gt; rewrite&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users of &lt;code&gt;BoxableExpression&lt;/code&gt; might be affected by the following change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-nullability-ops&quot;&gt;Changed nullability of operators&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users of tables containing a column of the type &lt;code&gt;Array&amp;lt;T&amp;gt;&lt;/code&gt; are affected by the following change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-nullability-of-array-elements&quot;&gt;Changed nullability of array elements&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users that implement support for their SQL types or type mappings are affected
by the following changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-custom-type-implementation&quot;&gt;Changed required traits for custom SQL types&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-to-sql&quot;&gt;Changed &lt;code&gt;ToSql&lt;/code&gt; implementations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-from-sql&quot;&gt;Changed &lt;code&gt;FromSql&lt;/code&gt; implementations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;no_arg_sql_function!&lt;/code&gt; macro is now pending deprecation.
Users of the macro are advised to consider &lt;code&gt;sql_function!&lt;/code&gt; macro.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-no_arg_sql_function&quot;&gt;Deprecated usage of &lt;code&gt;no_arg_sql_function!&lt;/code&gt; macro&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users of &lt;code&gt;eq_any&lt;/code&gt; on the PostgreSQL backend might hit type rejection error in rare cases.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-changed_eq_any&quot;&gt;Changed accepted argument to &lt;code&gt;eq_any()&lt;/code&gt; for the PostgreSQL backend&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users that update generic Diesel code will also be affected by the following changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-upgrade-non-aggregate&quot;&gt;Removing &lt;code&gt;NonAggregate&lt;/code&gt; in favor of &lt;code&gt;ValidGrouping&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://diesel.rs/guides/migration-guide#2-0-0-generic-changes&quot;&gt;Changed generic bounds&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally this release contains many changes for users that implemented a custom backend/connection.
We do not provide explicit migration steps but we encourage users to reach out with questions pertaining to these changes.&lt;/p&gt;
&lt;h2&gt;Thanks&lt;/h2&gt;
&lt;p&gt;As part of this release we would like to welcome @Ten0 as part of the
diesel core team.&lt;/p&gt;
&lt;p&gt;Thank you to everyone who helped make this release happen through sponsoring, bug reports, and discussion on GitHub and Gitter. While we don&apos;t have a way to collect stats on that form of contribution, it&apos;s greatly appreciated.&lt;/p&gt;
&lt;p&gt;In addition to the Diesel core team, 141 people contributed code to this release. A huge thank you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Alessandro Menezes&lt;/li&gt;
&lt;li&gt;Alexander &apos;z33ky&apos; Hirsch&lt;/li&gt;
&lt;li&gt;Alexei Pastuchov&lt;/li&gt;
&lt;li&gt;Alice Ryhl&lt;/li&gt;
&lt;li&gt;Amila Welihinda&lt;/li&gt;
&lt;li&gt;Andre Braga Reis&lt;/li&gt;
&lt;li&gt;Andreas Runfalk&lt;/li&gt;
&lt;li&gt;Andrew Safigan&lt;/li&gt;
&lt;li&gt;Andrew Speed&lt;/li&gt;
&lt;li&gt;Andy Russell&lt;/li&gt;
&lt;li&gt;Artem Vorotnikov&lt;/li&gt;
&lt;li&gt;Arve Seljebu&lt;/li&gt;
&lt;li&gt;Billy Chan&lt;/li&gt;
&lt;li&gt;Blas Rodriguez Irizar&lt;/li&gt;
&lt;li&gt;Bryan Henry&lt;/li&gt;
&lt;li&gt;Callym&lt;/li&gt;
&lt;li&gt;Caroline Glassberg-Powell&lt;/li&gt;
&lt;li&gt;Cassie Jones&lt;/li&gt;
&lt;li&gt;Chenxi Yuan&lt;/li&gt;
&lt;li&gt;Chris Eckhardt&lt;/li&gt;
&lt;li&gt;Chris Hanks&lt;/li&gt;
&lt;li&gt;Chris Maddox&lt;/li&gt;
&lt;li&gt;Chris West (Faux)&lt;/li&gt;
&lt;li&gt;Clouds Flowing&lt;/li&gt;
&lt;li&gt;Corentin Henry&lt;/li&gt;
&lt;li&gt;Daniel Buse&lt;/li&gt;
&lt;li&gt;Danilo Bargen&lt;/li&gt;
&lt;li&gt;David Teller&lt;/li&gt;
&lt;li&gt;David Tulig&lt;/li&gt;
&lt;li&gt;DebugSteven&lt;/li&gt;
&lt;li&gt;Diggory Blake&lt;/li&gt;
&lt;li&gt;Dmitriy Pleshevskiy&lt;/li&gt;
&lt;li&gt;Dusty Mabe&lt;/li&gt;
&lt;li&gt;DrVilepis&lt;/li&gt;
&lt;li&gt;EclipsedSolari&lt;/li&gt;
&lt;li&gt;Emile Fugulin&lt;/li&gt;
&lt;li&gt;Emm&lt;/li&gt;
&lt;li&gt;Emmanuel Surleau&lt;/li&gt;
&lt;li&gt;Erlend Langseth&lt;/li&gt;
&lt;li&gt;Felix Watts&lt;/li&gt;
&lt;li&gt;Filip Gospodinov&lt;/li&gt;
&lt;li&gt;Garrett Thornburg&lt;/li&gt;
&lt;li&gt;Giorgio Gambino&lt;/li&gt;
&lt;li&gt;Grégory Obanos&lt;/li&gt;
&lt;li&gt;Hal Gentz&lt;/li&gt;
&lt;li&gt;Han Xu&lt;/li&gt;
&lt;li&gt;Heliozoa&lt;/li&gt;
&lt;li&gt;Henk van der Laan&lt;/li&gt;
&lt;li&gt;Henry Boisdequin&lt;/li&gt;
&lt;li&gt;Hirokazu Hata&lt;/li&gt;
&lt;li&gt;Iban Eguia (Razican)&lt;/li&gt;
&lt;li&gt;Igor Raits&lt;/li&gt;
&lt;li&gt;Ivan Tham&lt;/li&gt;
&lt;li&gt;JR Heard&lt;/li&gt;
&lt;li&gt;Jean SIMARD&lt;/li&gt;
&lt;li&gt;Jeremy Stucki&lt;/li&gt;
&lt;li&gt;Jiří Sejkora&lt;/li&gt;
&lt;li&gt;jigaoqiang&lt;/li&gt;
&lt;li&gt;Joel Parker Henderson&lt;/li&gt;
&lt;li&gt;John Brandt&lt;/li&gt;
&lt;li&gt;Jonas Platte&lt;/li&gt;
&lt;li&gt;Jonas Schievink&lt;/li&gt;
&lt;li&gt;Joshua Koudys&lt;/li&gt;
&lt;li&gt;Juhasz Sandor&lt;/li&gt;
&lt;li&gt;Justice4Joffrey&lt;/li&gt;
&lt;li&gt;Katharina Fey&lt;/li&gt;
&lt;li&gt;Kevin King&lt;/li&gt;
&lt;li&gt;Kevin Kirchner&lt;/li&gt;
&lt;li&gt;Khionu Sybiern&lt;/li&gt;
&lt;li&gt;Kitsu&lt;/li&gt;
&lt;li&gt;Koisell&lt;/li&gt;
&lt;li&gt;Kononnable&lt;/li&gt;
&lt;li&gt;Leonardo Yvens&lt;/li&gt;
&lt;li&gt;Lukas Markeffsky&lt;/li&gt;
&lt;li&gt;Maccesch&lt;/li&gt;
&lt;li&gt;Marc-Stefan Cassola&lt;/li&gt;
&lt;li&gt;Martell Malone&lt;/li&gt;
&lt;li&gt;Martijn Groeneveldt&lt;/li&gt;
&lt;li&gt;Martin Nordholts&lt;/li&gt;
&lt;li&gt;Matthew Kuo&lt;/li&gt;
&lt;li&gt;Matthieu Guillemot&lt;/li&gt;
&lt;li&gt;Mcat12&lt;/li&gt;
&lt;li&gt;Meven&lt;/li&gt;
&lt;li&gt;Mike Cronce&lt;/li&gt;
&lt;li&gt;Mr Ceperka&lt;/li&gt;
&lt;li&gt;Nafiul Islam&lt;/li&gt;
&lt;li&gt;Nathan Papapietro&lt;/li&gt;
&lt;li&gt;Nicholas Yang&lt;/li&gt;
&lt;li&gt;Oliver Cooper&lt;/li&gt;
&lt;li&gt;Otto Castle&lt;/li&gt;
&lt;li&gt;Pankaj Jangid&lt;/li&gt;
&lt;li&gt;Paolo Barbolini&lt;/li&gt;
&lt;li&gt;Paul Le Corre&lt;/li&gt;
&lt;li&gt;Paul Martensen&lt;/li&gt;
&lt;li&gt;Pavan Kumar Sunkara&lt;/li&gt;
&lt;li&gt;Paweł Przeniczny&lt;/li&gt;
&lt;li&gt;Philip Trauner&lt;/li&gt;
&lt;li&gt;Raphael Arias&lt;/li&gt;
&lt;li&gt;Roman&lt;/li&gt;
&lt;li&gt;Ryan Leckey&lt;/li&gt;
&lt;li&gt;Sarthak Singh&lt;/li&gt;
&lt;li&gt;Scott Driggers&lt;/li&gt;
&lt;li&gt;Sean Klein&lt;/li&gt;
&lt;li&gt;Simon Ertl&lt;/li&gt;
&lt;li&gt;Spencer Taylor&lt;/li&gt;
&lt;li&gt;Steven Chu&lt;/li&gt;
&lt;li&gt;Storm Timmermans&lt;/li&gt;
&lt;li&gt;Sébastien Santoro&lt;/li&gt;
&lt;li&gt;Takayuki Maeda&lt;/li&gt;
&lt;li&gt;Thomas Constantine Moore&lt;/li&gt;
&lt;li&gt;Thomas Eizinger&lt;/li&gt;
&lt;li&gt;Thomas Etter&lt;/li&gt;
&lt;li&gt;Tom MacWright&lt;/li&gt;
&lt;li&gt;Tuetuopay&lt;/li&gt;
&lt;li&gt;Urhengulas&lt;/li&gt;
&lt;li&gt;Vanio Begic&lt;/li&gt;
&lt;li&gt;WebeWizard&lt;/li&gt;
&lt;li&gt;William Myers&lt;/li&gt;
&lt;li&gt;Yin Jifeng&lt;/li&gt;
&lt;li&gt;Yuki Okushi&lt;/li&gt;
&lt;li&gt;Zane Duffield&lt;/li&gt;
&lt;li&gt;blackghost1987&lt;/li&gt;
&lt;li&gt;czotomo&lt;/li&gt;
&lt;li&gt;dchenk&lt;/li&gt;
&lt;li&gt;ejc Drobnič&lt;/li&gt;
&lt;li&gt;gorbit99&lt;/li&gt;
&lt;li&gt;hasezoey&lt;/li&gt;
&lt;li&gt;hi-rustin&lt;/li&gt;
&lt;li&gt;kevinpoitra&lt;/li&gt;
&lt;li&gt;kpcyrd&lt;/li&gt;
&lt;li&gt;matthew-dowdell&lt;/li&gt;
&lt;li&gt;ode79&lt;/li&gt;
&lt;li&gt;ropottnik&lt;/li&gt;
&lt;li&gt;telios&lt;/li&gt;
&lt;li&gt;theredfish&lt;/li&gt;
&lt;li&gt;zoewithabang&lt;/li&gt;
&lt;li&gt;Zhenhui Xie&lt;/li&gt;
&lt;li&gt;Émile Fugulin&lt;/li&gt;
&lt;li&gt;κeen&lt;/li&gt;
&lt;li&gt;二手掉包工程师&lt;/li&gt;
&lt;li&gt;棒棒彬_Binboy&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item></channel></rss>