Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are much simpler standard ways to talk to a database from Rust:

https://crates.io/crates/postgres/

https://crates.io/crates/mysql/

This is an experimental approach. It might or might not be useful, but you don't have to use it.



That's valid, but ORMs have been pretty standard for years now too. Most mature languages have either ORMs or some database abstraction libraries, so it's good to see Rust getting those now.


> Most mature languages have either ORMs or some database abstraction libraries

And a lot of them really suck, too, because it's a hard problem. I'll take query builders or raw SQL over ORMs any day of the week.


+1

It seems like the intersection of good use case for Rust and need to use SQL, will also intersect with "minimal SQL needs", hence preference for simpler libraries.


[deleted]


Mentioned below where?

If you're talking about query string construction performance, I'm not sure I've ever seen even a Ruby application where query string building was a bottleneck vs the network.


Sorry, as you replied I had deleted my comment, because I decided I'd rather not get into an argument about this :) I will give you the link though:

https://news.ycombinator.com/item?id=11045700 <- "Diesel performs 33% faster than rust-postgres, and will be competitive with if not faster than ideomatic C. "


Forgive me, I didn't intend to be so argumentative. I genuinely want to understand. I'm trying to figure out if there are whole categories of use cases that I just don't have any exposure to.

As a side note: I keep trying Rust over and over again, and just can't get in to it. I think my brain just doesn't work that way. For my hobby project that needs super low level perf, I've moved a codebase from C, to Rust, and now to http://terralang.org/ and I'm finally quite satisfied with how the project is going.


Naw, it was my response that was more so than I wanted it to be. No worries. :)

Rust focuses on "zero-cost abstractions", that is, if you had to implement a feature yourself, you couldn't do it any better.

So this library, while more complex than a straightforward binding, has more features that are useful, like increased safety, while also being faster. A win-win. And very much in line with Rust's overall philosophy.


It's a bit late here, but feel free to DM me in our Gitter room and I can give you a full explanation tomorrow.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: