Releases: diesel-rs/diesel
1.2.0
This release contains several long awaited features.
We've re-introduced the ability to use bind params with the sql
function, in a way which is harder to mis-use. This functionality was present prior to 1.0, but was removed when sql_function
was added over concerns about its use with the rest of the query builder. Recent developments have proved those concerns to be valid, but this new API fills that niche. Thanks to @notryanb for taking the lead on this feature.
We've also added the ability to insert from a select statement (e.g. queries in the form of INSERT INTO table (...) SELECT ...
. This is a feature request that has come up repeatedly since release, and we're happy to finally bring it to you. We've also added alternate forms of our insert API which feel better when used with select statements. You can find the full details in the CHANGELOG.
Finally, we've rewritten our custom dervies from scratch to take advantage of new diagnostic tools in recent versions of nightly Rust. If you turn on the unstable
feature of Diesel on a nightly compiler, you'll find that you get dramatically improved error messages from our derives. For the best error messages, you should also set RUSTFLAGS="--cfg procmacro2_semver_exempt"
.
Additionally, as of this release, Diesel is now powered by the blockchain. Because it's 2018 and that's how it works now I guess. See the CHANGELOG for full details.
In addition to the headline features, there were a ton of features that we don't have time to mention here. As always, for a full list of changes you can find a full list 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...
In addition to the Diesel core team, 14 people contributed code to this release. A huge thank you to:
- Alex Kitchens
- Andrew Weiss
- Arun Kulshreshtha
- Brandur
- EloD10
- Jacob Chae
- Jordan Petridis
- Josh Leeb-du Toit
- Kerollmops
- Mathias Svensson
- Ryan Blecher
- Sander Maijers
- Seth Larson
- YetAnotherMinion
1.1.1
This release fixes a minor issue with our r2d2 support. In 1.1 we recommend that people access r2d2
via diesel::r2d2
. However, r2d2
has a type called Error
, which was shadowed by our own type called Error
in that same module, making it inaccessible. This release adds an alias PoolError
to point at r2d2::Error
.
Thanks to YetAnotherMinion for working on this release.
1.1.0
Improved Support for Adding New Types
The primary focus of this release was improving the ergonomics of adding support for new types in Diesel.
For implementing new SQL types, we've added #[derive(SqlType)]
which implements many traits that you need to implement for every SQL type. See the documentation for HasSqlType
for details on this derive.
For implementing new mappings, we've added #[derive(FromSqlRow)]
and #[derive(AsExpression)]
. These derives will replace the majority of the boilerplate that was previously required when supporting new types. Adding support for new types in Diesel 1.1 should only require implementing FromSql
and ToSql
. The derives will handle the rest.
We've also provided FromSql
impls for *const str
and *const [u8]
. Due to the design of FromSql
, we can't provide impls for &str
and &[u8]
without a breaking change. However many impls just need to parse a string or some bytes, and don't need the allocation that would come from String
or Vec<u8>
. This will require unsafe code to use, but should make certain implementations more efficient.
Finally, we've restructured how our serialize/deserialize modules are structured, and provided type aliases to make implementations of FromSql
and ToSql
more consise.
r2d2_diesel
is Now Part of Diesel
Finally, this release merges r2d2_diesel
into Diesel itself. The main benefit of doing this is that we can implement Connection
for PooledConnection
, removing the need for explicit &*
when using r2d2. This should also help to prevent version mismatches when changing Diesel versions.
To use the new r2d2 support, remove r2d2
and r2d2_diesel
from your Cargo.toml. Add the r2d2
to your enabled features on diesel
. Replace extern crate r2d2
with pub use diesel::r2d2
. Replace any r2d2_diesel::
with diesel::r2d2::
.
Thanks
In addition to the headline features, there were dozens of smaller additions which should make using Diesel even better! As always, you can check the CHANGELOG for a full list of changes in this release.
In addition to the Diesel core team, 8 people contributed to this release. A huge thank you to:
- Ashe Connor
- Chris Pick
- Evan
- Georg Semmler
- MarcManiez
- Martin Lindhe
- Oliver Schneider
- Ryan Blecher
1.0.0
We didn't quite make it for 2017, but Diesel 1.0 is finally here!
There are no changes between Diesel 1.0 and 1.0.0-rc1.
1.0.0 marks stability for Diesel. While there are many more features
that will be added in the future, there will be no breaking changes from
this point forward without a major version bump (which we do not
anticipate happening for many years).
A lot has happened since Diesel 0.1 was released over 2 years ago. While
it would be impossible to list every major change that has happened
since then, here are a few highlights:
- Expanded from a PostgreSQL specific library to supporting SQLite and MySQL
- Went from nightly-only to nightly-optional to working purely on stable
Rust diesel print-schema
replacedinfer_schema!
as the go-to way to
infer your database schema.- Added support for a significant portion of SQL queries which could not
be represented in 0.1
It's been a great honor to watch this community grow and thrive as this
library has developed. I look forward to continuing to evolve Diesel,
and seeing how far it can go.
In addition to the Diesel core team, 98 people have contributed to
Diesel. A huge thank you to everyone who made this and every prior
release possible:
- Adam Perry
- Adrian Perez de Castro
- Alex Alvarez
- Alex Kitchens
- Alexey Zabelin
- Andrew Lazarus
- Andrew Ryan Lazarus
- Arnar Mar Sig
- Barosl Lee
- Blake Pettersson
- Bob
- Boris-Chengbiao Zhou
- Brandon W Maister
- Cameron Alexander
- Cengiz Can
- Christopher Brickley
- Cyryl Płotnicki
- Daniel Durante
- Danilo Bargen
- David Szotten
- Derek Prior
- Dimiter Petrov
- Dorian Scheidt
- Enether
- Eric Kidd
- Erich Cordoba
- FliegendeWurst
- Flux Xu
- Garrett Squire
- Georg Semmler
- Graham Grochowski
- JD Gonzales
- Jake Goulding
- Jakob Gillich
- James Kominick
- Jethro Beekman
- Jim McGrath
- Jimmy Cuadra
- John Gallagher
- Jordan
- Josh Holmer
- Jovansonlee Cesar
- Katrina Brock
- Kieran
- Konstantinos Sideris
- Lance Carlson
- Lauri Apple
- Maciej
- Maciej Dziardziel
- Mark Catley
- Martijn de Haan
- Mathieu Rochette
- Matt Casper
- Maxime “pep” Buquet
- Michael Macias
- Michael Stock
- Mike Piccolo
- Mrmaxmeier
- Patrick Fernie
- Paul Lange
- Peter Marheine
- Pyry Kontio
- Rasmus Kaj
- Richard Dodd
- Robert Balicki
- Robert Maloney
- Ruben De Smet
- Ryan Blecher
- Sam Phippen
- Sebastian Blei
- Sergio Benitez
- Severen Redwood
- Sharad Chand
- Sid Ngeth
- Stu Black
- Sunrin SHIMURA (keen)
- Tamir Duberstein
- Taryn Hill
- Tess Griffin
- Tim Brooks
- Tobias Schottdorf
- Tom Houlé
- Tshepang Lekhonkhobe
- Will Murphy
- William Murphy
- benaryorg
- bippityboppity
- debris
- derekdreery
- jacob
- jethrogb
- kardeiz
- king6cong
- klieth
- pfernie
- theduke
- wangcong
1.0.0-rc1
Happy holidays!
This release contains no major code changes. There are a handful of minor bug fixes (the most notable being that SQLite no longer panics when we receive SQLITE_BUSY
), but most changes are related to ensuring that our API documentation renders better.
We do not expect any further changes to the codebase of any kind (other than the version number) between this release and 1.0.0. Assuming no critical issues are found with this release candidate, the code as it exists at this point will be released as 1.0.0 on 2017-12-30.
1.0.0 Beta 1
This release contains 2 major changes from 0.99.0. The first is not news, we have removed all deprecated code from the codebase. However, this release also contains some major restructuring of the query_dsl
module.
Traits related to the construction of queries, such as SelectDsl
, FilterDsl
, etc. Have been merged into a single QueryDsl
trait. Traits related to the execution of queries, such as ExecuteDsl
and LoadDsl
have been merged into a single RunQueryDsl
trait. The individual method traits still exist under the query_dsl::methods
module, but they are no longer exported from prelude.
Though we promised there would be no significant changes other than documentation, during our process of documenting this module, it became clear that making this change would make discovering how to use Diesel's query builder dramatically easier. It also gives us a much more centralized place to document these logically grouped methods. While we do not expect this change to break many apps, it is significant enough to warrant an early release.
Most applications should not need to care about this change. Code which is just doing use diesel::prelude::*
and calling these methods will continue to work with no changes (though error messages will be improved if you make a mistake).
However, if you had code that was implementing QueryFragment
or Query
, and expected to be able to call .execute
, .load
, or similar on it (such as the Pagination
helper in crates.io), you will need to add impl<Conn> RunQueryDsl<Conn> for YourType
.
If you have code that is calling query builder methods generically (e.g. if you have where T: FilterDsl<Something>
, you will likely need to explicitly import things from query_dsl::methods
In addition to those changes, there are some minor improvements to #[derive(QueryableByName)]
which we had planned on releasing as 0.99.2.
Stability
With this release, 0.99.x will only receive bug fixes and security patches. No new features will be backported to that branch. However, 0.99 can be considered our first "LTS" release. While we have not yet determined what exactly that means for Diesel, you can be assured that release line will continue to be supported for as long as there is demand.
We do not plan on having a 1.0.0.beta2, but there may be additional minor breaking changes in that release if it is needed. If there are any code changes between now and 1.0.0, even non-breaking ones, we will have a release candidate before the final release.
Looking Ahead
As with 0.99.0, we expect that the only significant change between this release and 1.0.0 will be documentation. We expect that the final release of 1.0.0 will be before the end of the year.
Our only blocker for a final 1.0 release continues to be documentation. There is a lot of work to do before the end of the year. We need help from the community to reach our goal of releasing this year. If you're interested in helping out, join the impl period working group channel.
v0.99.0 (It's basically 1.0 except it's not)
This release is by far the largest Diesel has ever had. It serves 2 purposes. You can consider this release to be a beta for 1.0. However, 1.0 will have an important significant difference. Anything that is deprecated as of this release will not be present in the 1.0 release. This includes functions which were newly deprecated in 0.99. We know this may introduce a migration burden for some people, so we will continue to support the 0.99 line with bug fixes as long as there is demand and it is reasonable to do so.
Headline Features
This release is mainly focused on ergonomics. Our main new feature is the sql_query
function. This is a new API which behaves similarly to sql
, but it is entirely focused on cases where you want to write the entire query yourself. The main difference from sql
is that you do not need to specify the return type of the query, and values are fetched by name rather than by index. This feature is still early, and there's a lot of features still to come (specifically evolving #[derive(QueryableByName)]
, but we think this feature will ease a lot of pains for cases where Diesel doesn't quite do what you need.
Additionally, you can now use tuples for inserts the same as you can for updates. If you've ever wanted to insert a row with just 1 or 2 values, and been annoyed that you needed a struct that you're only using in this one place, this feature will make you happy. We'll have new guides highlighting this feature soon.
Additionally, this release comes with a ton of quality of life features. Many of these changes are focused around making it easier to introduce line breaks naturally in your code. For example, .filter
is now implemented on UpdateStatement
, meaning you can write update(foo).filter(bar)
instead of update(foo.filter(bar))
. We've also introduced new APIs for insert
and PG upsert which will have similar readability improvements.
Breaking Changes
This release includes more deprecations than any release prior. In particular, insert
has been deprecated, along with our entire PG upsert API. All deprecations in this release have direct replacements, which will lead to code which formats much more nicely. It should be a mostly mechanical replacement for most apps. See the CHANGELOG file for details.
Growing the Team
With this release, we'd like to welcome several new members to the Diesel committer team. @weiznich, @notryanb, and @katrinabrock you've all done excellent work and we're very excited to officially welcome you to the team!
Additional Thanks
In addition to the Diesel core and committer teams, 10 people contributed to this release. A huge thank you to:
- Adam Perry
- Alex Kitchens
- Alexey Zabelin
- Arnar Mar Sig
- Bob
- Jordan
- Lauri Apple
- Maxime “pep” Buquet
- William Murphy
- bippityboppity
Our only remaining blockers from this release and 1.0 are documentation changes, and having this tested in the wild. Thank you to every one of our users for your support, and we look forward to Diesel 1.0 by the end of the year!
v0.16.0
This release contains some changes to how joins work with Diesel, which we wanted to release as far in advance of 1.0 as possible. With this release, #[belongs_to]
no longer generates the code required to join between two tables. The macro joinable!
must be invoked instead. However, if you are using infer_schema!
or diesel print-schema
, these invocations will be generated based on the foreign keys in your database.
Also included in this release is the ability to rename columns. This is most useful when your columns conflict with Rust keywords. See the changelog for details.
In addition to the Diesel core team, 11 people contributed to this release. A huge thank you to:
- Alex Alvarez
- Georg Semmler
- Graham Grochowski
- JD Gonzales
- Lance Carlson
- Maciej
- Robert Balicki
- Sharad Chand
- Taryn Hill
- debris
- klieth
v0.15.2
v0.15.0
This is a minor release containing a few quality of life features. We were originally planning to ship these with 1.0, but they're specifically needed by some production users.
The biggest feature here is the ability to manually specify the ON
clause of a join, which is separate from the associations API. You can also use this to join to tables which otherwise have no association between them (but this will also require you to invoke enable_multi_table_joins!
).
In addition to the Diesel core team, 6 people contributed to this release. A huge thank you to:
- Alex Kitchens
- Maciej Dziardziel
- Pyry Kontio
- Sunrin SHIMURA (keen)
- king6cong
- wangcong