SQL and Rust

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

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

    (Ab)using technology for fun & profit. Programming, Hacking & Entrepreneurship @ https://kerkour.com

  • There are plenty: - diesel - famous example of what the Rust type system can get you beyond just "memory safety". My go-to choice for most projects. Having autocomplete for my database DSL is something I find it hard to go without. But it comes at a fairly high cost of confusing, generic-heavy code. - sqlx - also a very solid choice. You write SQL queries, which are optionally checked against a database instance at compile-time. A downside I've heard repeated a lot (by some fairly reputably figures) is that sqlx adds a fairly significant overhead to queries, and according to this issue is 7-70x slower than diesel. If the performance of your database is important to you, run some benchmarks and see if it's an issue - seaorm - a relatively new ORM, and I haven't used it much, but my initial impressions were that it was a little too "magic". Maybe it just reminded me too much of Spring Boot. I'm not sure. It's probably a totally fine library - postgres (or equivalent) - you can always just skip the ORM and use the database driver directly. Pretty nice for smaller projects, but totally viable for big projects too. Just a matter of personal preference

  • diesel

    A safe, extensible ORM and Query Builder for Rust

  • It's not even a libpq issue, but an issue with a specific libpq distribution. You just need to use a not broken version of libpq or ask the vendor of that specific libpq version to fix their binary. See here for a in depth discussion. Calling diesel or libpq to be responsible for this is rather strange.

  • 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
  • todo_rotomy

    CRUD example with Rocket, Toql and MySQL

  • To check, if it meets your use case see the todo example or guide.

  • metrics

  • The cited 7-70x factor is for sqlite, it's not that serve for other backends. I would guess for sqlite the overhead is partially caused by forcing an async interface on top of a internally sync API. See here for some numbers.

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