Our great sponsors
-
kerkour.com
(Ab)using technology for fun & profit. Programming, Hacking & Entrepreneurship @ https://kerkour.com
-
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.
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
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.
To check, if it meets your use case see the todo example or guide.
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.
Related posts
- People who use rust and postgres in production along with RDS proxy, what do you do?
- The diesel project is looking for help
- Diesel Is a Safe, Extensible ORM and Query Builder for Rust
- Queryx: An Open-Source Go ORM with Automatic Schema Management
- Diesel polls about upcoming features and guide topics