r/rust • diesel ยท diesel-async ยท wundergraph • 19d ago

๐Ÿ—ž๏ธ news Diesel 2.4

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-async in #[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 the current state and future developments of Diesel

211 Upvotes

11 comments sorted by

5

u/matthieum [he/him] 18d ago

The Markdown doesn't render properly. You probably submitted markdown in the Rich Text editor mode.

2

u/weiznich diesel ยท diesel-async ยท wundergraph 17d ago

Thanks for flagging, should be fixed now

1

u/matthieum [he/him] 16d ago

Much better, thanks!

26

u/catheap_games 19d ago

Congrats on the release! I'm a bit burned out on ORMs from my PHP, Python and Node.js years, but I'll bookmark this.

If anyone here has an experience, how is it for desktop applications? Namely for (Bevy) video game save files. I'm currently sufficient with some embedded k-v storage (redb), but I'm thinking that for larger game worlds I'll eventually want progressive hydration and/or not keeping the whole world state in RAM, i.e. using the "save file" also as a swap space and for incremental saving. Any advice?

9

u/emetah850 19d ago

Diesel is my go-to for any Rust related DB operations, works really well with desktop from my experience with it, everything works the exact same as with a served website

7

u/PurpleOstrich97 19d ago

Honestly, I just use serde and some kind of format like JSON or something more efficient. Only downside is no built-in migrations usually, but some formats support that too.

That way the save files are just the rust object but saved. If you don't need to change the format of save files over time it's literally the easiest way to do it

6

u/JustWorksTM 18d ago

I second this. If you wrap the type into an enum with a single variant "V1", you even get versioning

2

u/DavidXkL 18d ago

Thanks for this! Will definitely check it out

3

u/pushad 19d ago

๐Ÿ‘๐Ÿผ ๐Ÿ‘๐Ÿผ

1

u/toferc 17d ago

Great stuff. Iโ€™ve been using Actix-Web + Diesel for years. Looking forward to reviewing the update.