Skip to content

Releases: diesel-rs/diesel

Diesel 2.0.0 RC1

22 Jul 08:04
v2.0.0-rc1
10c369e
Compare
Choose a tag to compare
Diesel 2.0.0 RC1 Pre-release
Pre-release

We are happy to announce the release of Diesel 2.0.0 RC1

This release contains a number of fixes and improvements compared to the previous 2.0.0 RC0 release.

Notably the following fixes and improvements are included:

  • A fix for an issue preventing connection reuse with the built-in r2d2 integration
  • Support for types from the ipnet crate
  • Support for loading values via libpq's row by row mode
  • Improvements to error messages generated by #[derive(Insertable)] for the case of type mismatches

This release hopefully marks the last prerelease before a stable 2.0.0 release.
We plan to release the final 2.0.0 soon after this, as long no other blocking issues are found.

Thank you to everyone who helped make this release happen through bug reports, and discussion on 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, 8 people contributed code to this release. A huge thank you to:

  • Chris Eckhardt
  • Emile Fugulin
  • Iban Eguia Moraza
  • Jean SIMARD
  • Martin Nordholts
  • Otto Castle
  • Sean Klein
  • Steven Chu

Diesel 2.0.0-rc.0

22 Apr 15:12
v2.0.0-rc0
5d78e38
Compare
Choose a tag to compare
Diesel 2.0.0-rc.0 Pre-release
Pre-release

Diesel 2.0.0-rc.0

This release marks the first release candidate for the upcoming Diesel 2.0 Release.

Diesel 2.0.0 contains the contributions of more than 130 people. More than 1700 commits were submitted
over a span of 3 years.

As part of this release we introduced numerous new features and rewrote large parts of the internal structure.
Check out our changelog for a complete list of changes. As this is a new major Diesel release it contains a number of breaking changes. Checkout our draft migration guide for details about how to handle those breaking changes.

This release contains the following parts:

  • diesel 2.0.0-rc.0
  • diesel_derives 2.0.0-rc.0
  • diesel_migrations 2.0.0-rc.0
  • diesel_cli 2.0.0-rc.0
  • diesel_dynamic_schema 0.2.0-rc.0

This release marks a first prerelease of the upcoming Diesel 2.0 release. We ask you for your help to finalise the release.
Checkout the "Timeline for a Diesel 2.0 release" section for details about how you can help us finishing the release.

Features

As a highlight Diesel 2.0.0 adds support for the following features:

  • Fully type checked GROUP BY support
  • Support for table aliasing
  • Support for defining select clauses via a corresponding type
  • Support for UNION/INTERSECT queries

Support for GROUP BY clauses

Diesel 2.0 adds support for GROUP BY clauses for select queries.

This means queries like the following one will just work.

 users::table.inner_join(posts::table)
    .group_by(users::id)
    .select((users::name, count(posts::id)))

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 GROUP BY clause is valid for the current query and it will also ensure that expressions appearing inside
of your SELECT clause will match the aggregation rules provided by the current GROUP BY clause.

Support for table aliasing

Diesel 2.0 adds support for table aliasing. This enables users to write queries, where a table appears more than once in the corresponding
FROM clause. For this Diesel provides a Diesel::alias! macro that allows to define new alias for existing tables.

The following query demonstrates the support for this feature:

// 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))

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.

Implied selection via the new Selectable trait

Diesel 2.0 features a new Selectable 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 Queryable. This also works for complex queries involving joins or other kinds of nesting.

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

let first_user = users.select(User::as_select()).first(connection)?;

Diesel enforces at type system level that once you provided such a select clause via User::as_select() 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 User type
twice in the query above.

Support for UNION/INTERSECT/EXCEPT queries

Diesel 2.0 extents the query builder to support query combinations via UNION/INTERSECT/EXCEPT. 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:

 users.select(user_name.nullable())
    .union(animals.select(animal_name).filter(animal_name.is_not_null()))

As always this is checked at compile time to reject invalid queries, like for example that ones containing select
clauses with different fields.

Timeline for Diesel 2.0

We consider this release candidate of Diesel 2.0 as feature complete.
Before finally releasing a stable 2.0 release we want to address the following points:

  • Updating the guides on our web page to use the new Diesel 2.0 release
  • Improve the migration guide to cover missed details or changes
  • Improve our documentation to include more details on new features

You can help us rounding up this release by:

  • Updating your code to the RC release and report problems here
  • Help us improving the documentation by submitting reports and improvements
  • Help us porting our guides to the new release by submitting a PR here

Thanks

As part of this release we would like to welcome @Ten0 as part of the
diesel core team.

Thank you to everyone who helped make this release happen through bug reports, and discussion on 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, 134 people contributed code to this release. A huge thank you to:

  • Alessandro Menezes
  • Alexander 'z33ky' Hirsch
  • Alexei Pastuchov
  • Alice Ryhl
  • Amila Welihinda
  • Andre Braga Reis
  • Andreas Runfalk
  • Andrew Safigan
  • Andrew Speed
  • Andy Russell
  • Artem Vorotnikov
  • Arve Seljebu
  • Billy Chan
  • Blas Rodriguez Irizar
  • Bryan Henry
  • Callym
  • Caroline Glassberg-Powell
  • Cassie Jones
  • Chenxi Yuan
  • Chris Hanks
  • Chris Maddox
  • Chris West (Faux)
  • Clouds Flowing
  • Corentin Henry
  • Daniel Buse
  • Danilo Bargen
  • David Teller
  • David Tulig
  • DebugSteven
  • Diggory Blake
  • Dmitriy Pleshevskiy
  • Dusty Mabe
  • EclipsedSolari
  • Emile Fugulin
  • Emm
  • Emmanuel Surleau
  • Erlend Langseth
  • Felix Watts
  • Filip Gospodinov
  • Garrett Thornburg
  • Giorgio Gambino
  • Grégory Obanos
  • Hal Gentz
  • Han Xu
  • Henk van der Laan
  • Henry Boisdequin
  • Hirokazu Hata
  • Iban Eguia (Razican)
  • Igor Raits
  • Ivan Tham
  • JR Heard
  • Jeremy Stucki
  • Jiří Sejkora
  • Joel Parker Henderson
  • John Brandt
  • Jonas Platte
  • Jonas Schievink
  • Joshua Koudys
  • Juhasz Sandor
  • Justice4Joffrey
  • Katharina Fey
  • Kevin King
  • Kevin Kirchner
  • Khionu Sybiern
  • Kitsu
  • Koisell
  • Kononnable
  • Leonardo Yvens
  • Lukas Markeffsky
  • Maccesch
  • Marc-Stefan Cassola
  • Martell Malone
  • Martijn Groeneveldt
  • Matthew Kuo
  • Matthieu Guillemot
  • Mcat12
  • Meven
  • Mike Cronce
  • Mr Ceperka
  • Nafiul Islam
  • Nathan Papapietro
  • Nicholas Yang
  • Oliver Cooper
  • Otto Castle
  • Pankaj Jangid
  • Paolo Barbolini
  • Paul Le Corre
  • Paul Martensen
  • Pavan Kumar Sunkara
  • Paweł Przeniczny
  • Philip Trauner
  • Raphael Arias
  • Roman
  • Ryan Leckey
  • Sarthak Singh
  • Scott Driggers
  • Sean Klein
  • Simon Ertl
  • Spencer Taylor
  • Steven Chu
  • Storm Timmermans
  • Sébastien Santoro
  • Takayuki Maeda
  • Thomas Constantine Moore
  • Thomas Eizinger
  • Thomas Etter
  • Tom MacWright
  • Tuetuopay
  • Urhengulas
  • Vanio Begic
  • WebeWizard
  • William Myers
  • Yin Jifeng
  • Yuki Okushi
  • Zane Duffield
  • blackghost1987
  • czotomo
  • dchenk
  • ejc Drobnič
  • gorbit99
  • hasezoey
  • hi-rustin
  • kevinpoitra
  • kpcyrd
  • matthew-dowdell
  • ode79
  • ropottnik
  • telios
  • theredfish
  • zoewithabang
  • Émile Fugulin
  • κeen
  • 二手掉包工程师
  • 棒棒彬_Binboy

1.4.8

20 Sep 07:45
v1.4.8
09f8bcd
Compare
Choose a tag to compare

This release fixes an incompatibility between features passed to diesel and diesel_migrations while using cargos new resolver feature (resolver = "2") which will become the new default with the upcoming Rust 2021 edition

1.4.7

08 Jun 07:45
Compare
Choose a tag to compare
  • Updated libsqlite3-sys to allow version 0.22
  • Updated ipnetwork to allow version 0.18

1.4.6

05 Mar 11:12
v1.4.6
b0c8e99
Compare
Choose a tag to compare

Fixed

  • Fixed a use-after-free issue in the QueryableByName implementation
    of our Sqlite backend
  • Updated several dependencies

1.4.5

09 Jun 11:28
v1.4.5
bec389a
Compare
Choose a tag to compare

Fixed

  • Update several dependencies
  • Fixed an issue where transactions that would fail to commit would leave the connection
    in a broken non-committed non-rolled-back state.
  • Fix a bug that result in leaking sockets/file descriptors on failed connection attempts
    for postgresql
  • Fix an incompatibility with newer libmysqlclient versions
  • Remove some potential harmful usages of mem::uninitialized

1.4.4

23 Mar 10:06
v1.4.4
51dd13b
Compare
Choose a tag to compare

Fixed

  • Update several dependencies
  • Fixed a bug with printing embedded migrations

As part of this release also updated versions of migration_internals and migration_macros are published.

1.4.3

11 Oct 20:30
v1.4.3
066bc41
Compare
Choose a tag to compare

Fixed

  • Updated several dependencies
  • Fixed an issue where the postgresql backend exploits implementation defined behaviour
  • Fixed issue where rustdoc failed to build the documentation
  • diesel_derives and diesel_migrations are updated to syn 1.0

v1.4.0

21 Jan 09:52
v1.4.0
c55c72a
Compare
Choose a tag to compare

New Features

In contrast to the last release most changes in this release are minor or internal. We've added support for newer versions of some dependency crates (libsqlite-sys, uuid, ipnetwork).

Diesel CLI got a command line flag to check if a generated schema matches the already existing one. This is useful for CI setups to check there if the committed generated schema file matches the committed migrations.

We've added support for the diesel_mange_updated_at('table_name') SQL function on SQLite. This function handles the setup of an trigger that automatically updates the updated_at column on update operations.

Additionally several helpers were added to support the deserialisation of tuples and composite types on PostgreSQL.

As always, a full list of changes can be found it in the changelog

Thanks

Thank you to everyone who helped make this release happen through bug reports, and discussion on 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, 29 people contributed code to this release. A huge thank you to:

  • Aleksey Ivanov
  • Andrew Speed
  • Carlos Diaz-Padron
  • Daniel Silverstone
  • Dirkjan Ochtman
  • Dominik Sander
  • Eyal Kalderon
  • Galuh Sahid
  • Hirokazu Hata
  • Jake Goulding
  • Jo Liss
  • Josh Leeb-du Toit
  • Kevin Stenerson
  • kpcyrd
  • Marcus Stollsteimer
  • Matej Stuchlik
  • Nikita Sivakov
  • notryanb
  • Rasmus Kaj
  • Richard Petrie
  • Rotem Yaari
  • Ryan Leckey
  • Sergio Benitez
  • Simon Heath
  • Stephen Muss
  • Trinh Hoang Anh

1.3.3

12 Sep 15:51
Compare
Choose a tag to compare

This is a small bugfix release, addressing an issue with MySQL 8.0. The
behavior of the C API in libmysqlclient changed in this version of
MySQL, causing problems when a connection pool was used with Diesel.

If you are not using MySQL, or are on a version older than 8.0, this
release does not affect you.