3 ms·
Diesel is the leading ORM for Rust and they allow you to build SQL queries in a type safe way, as well as, making sure the struct you deserialize to matches the
by davidatbu 5y ago
Diesel is the leading ORM for Rust and they allow you to build SQL queries in a type safe way, as well as, making sure the struct you deserialize to matches the output of the query (ie, type safe deserialization).
I've used ActiveRecord and Django's ORM, and neither provide anything like this.
The closest I've seen is SQLModel, a library on top of SQLAlchemy built by the author of FastAPI.
However, last I checked, the kinds of queries that Diesel allows are more restricted than that of Django or ActiveRecord. Of course , you can always write custom SQL for things like that when using Diesel.
I believe also that Diesel is either maintained by or was created by the same peeps behind ActiveRecord. I also read somewhere that a running joke among them is that they learnt what not to do in writing an ORM through ActiveRecord.
A question I have for y'all is: can anyone make a comparison between Diesel and TypeORM?