I’m happy to announce the release of Diesel 2.4.0, a ORM and query builder for Rust. This release contains the development of the last 14 months, including the contributions of 76 people.
Headline features include:
- Support for database views
- Improved support for enums
- Support for batch update statements
- A distinct backend for MariaDB
- Extended support for SQLite functionality, including hooks, pragmas and BLOB’s
- Support for using Diesel (SQLite) in a no-std environment
- Migrations written in Rust
- Support for
diesel-asyncin#[derive(MultiConnection)]
See the announcement blog post about details to each feature: https://diesel.rs/news/2_4_0_release/
I would like to use this possibility to thank all contributors and sponsors that made this release possible. A special thank goes to Luca for his large contributors to the release, to Prototype Found for funding the development of the Database View support and to RustFoundation for funding the general maintenance.
Nevertheless, the Diesel project is always looking for support. You can help by:
- Contributing Code, Documentation, or Guides.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping to triage issues in our issue tracker
- Sponsoring the maintainers.
- Filling out this survey about about the current state and future developments of Diesel (EDIT: lemmy seems to break that link, please use that one from the blog post instead)
Feel free to answer questions about the release or Diesel in general, I will try to answer them in the next days.


Thanks!
I think part of it is also that I just have to get more familiar with Diesel, but also get over wanting to solve things without Boxing. I do like a good puzzle sometimes :)
I also didn’t see that you posted the original link. Thanks for all your hard work and for being so active in all the communities Diesel is discussed!
I get the want to not use boxes but, in my experience, I got over that by realizing that using boxes is basically just using malloc in C. Once I realized how often we malloc in C, I slowly was able to get over the Box bump. Also there’s some really cool features like dyn types and the type erasure pattern which I only learned a few months ago. It makes a lot of more complicated rust cpdebases make sense once I figured that out.
I also like to approach this by looking at other languages where most things live on the heap anyway. There’s lots of great software written in dynamic GC’d languages, so I treat that as a sort of upper bound in my Rust code.
I mostly allow myself to get distracted by this sort of thing in my personal projects where I have the luxury of not having to complete anything. 😁
At least
#[auto_type]and usingBoxableExpressionas trait bound doesn’t need any boxing at all.That written, as others already pointed out: Boxing and dyn dispatch are sometimes the right solution. You also should keep in mind that in most cases the performance penalty of the allocation or the indirect function call is not significant compared to say a network roundtrip or an io operation. The only situation with Diesel queries where I found that allocations matter are for hot loops of trivial queries on an in memory SQLite database connection. There it costs you around 50% of performance. Otherwise you won’t notice much difference.
Oh for sure! I’m not opposed to allocations. It’s just me being stubborn and getting myself stuck on wanting to see if there is a solution without it. It mostly happens on my personal projects where I can afford to get distracted for hours.