Diesel 2.0.0 RC1

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • diesel

    A safe, extensible ORM and Query Builder for Rust

  • You are right. The mysql crate existed back then. As I was not that involved in the development of diesel back in those days I've just diged in our github repository for some reasoning. This is the PR that introduced the initial support for the mysql backend. The reasoning there is that the mysql backend back then had an API that was incompatible with that one expected by diesel. The API exposed by libmysqlclient seemed to be much more in line with what diesel expected back then.

  • rust-mysql-simple

    Mysql client library implemented in rust.

  • We use libmysqlclient mostly for historic reasons. The mysql crate did just not exist back then when diesel started and rewriting all the internal code now is just something that we did not have the time nor motivation for. That written: Diesel is designed in such a way that connections can be provided by third party crates, even for existing backends. Diesel 2.0 adds explicit documentation for this as part of the connection trait and we are definitively interested to see pure rust implementations for the postges and mysql backend there. Also there is this discussion in the rust-mysql crate repository about a potential diesel integration. If someone is interested in working on this (or the equivalent implementation for postgresql), please reach out to us. We definitively can provide some pointers where to look for stuff and how to generally approach such an implementation. It's likely nothing that's really hard, it just requires someone to spend some work on it.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • This change is hopefully only the starting point to a number of future improvements. I've got a project grant as part of the rust foundation community grant program to work on improving the error messages for trait heavy crates like diesel. Hopefully this will result in other improvements as well. I track this work here. If you hit bad error messages with diesel or any other trait heavy crate, please fill an issue there.

  • diesel_async

    Diesel async connection implementation

  • The already linked discussion from last time already contains a lot of information about this. Diesel itself does not provide async operations and that will likely remain that way for a foreseeable future. At least my preferred solution is to keep async support in a separate crate. A prototype for this is currently available here. Keep in mind that this is not released yet, so there might be bugs everywhere. I plan to cut a first release of this crate after the final release of diesel 2.0, which means hopefully soon. As for ETA's: I generally do not give any ETA's for releases, as this is currently a free time project for me.

  • tokio-diesel

    Integrate Diesel into Tokio cleanly and efficiently.

  • An issue I see is that diesel is already quite usable in async contexts using spawn_blocking or block_in_place (that's what tokio-diesel and async-bb8-diesel does), it's just somewhat inefficient. How much money is worth the extra efficiency of diesel-async?

  • async-bb8-diesel

    Safe asynchronous access to Diesel and the bb8 connection manager

  • An issue I see is that diesel is already quite usable in async contexts using spawn_blocking or block_in_place (that's what tokio-diesel and async-bb8-diesel does), it's just somewhat inefficient. How much money is worth the extra efficiency of diesel-async?

  • Cargo

    The Rust package manager

  • I took the route of using docker buildx for cross-compiling, which kind of works, but everything not equal to the host architecture is emulated by qemu, which makes it very slow. As well, you run in all kind of weird issues. I never managed to compile successfully to armv7 for example (see this issue: https://github.com/rust-lang/cargo/issues/8719). There are workarounds, but at some point I gave up because it was too time consuming.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • metrics

  • Well at least in terms of performance diesel (the non-async) seems to be faster than sqlx. We have some benchmark results of commonly used rust database crates here. The corresponding code is part of the diesel repository.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts