Diesel: A Safe, Extensible ORM and Query Builder for Rust
Why is<p><pre><code>    Post::belonging_to(user).load(&amp;connection)
</code></pre>
an improvement over<p><pre><code>    SELECT * FROM posts WHERE user_id = 1;
</code></pre>
?<p>If you use this, it nails the database schema into your Rust code, because this needs to know the table formats.  If someone adds a new field to a row, you have to rebuild all your Rust programs that use the database.  Now your deployment process just got much more complicated.<p>It&#x27;s a neat hack, but seems an overly complex way to do something that&#x27;s not that complicated.  Unless this has some huge performance gain over rust-postgres[1],
it&#x27;s probably too much.<p>If rust-postgres is too slow, it would be worth having an optional generic for rust-postgres to help with unmarshalling returned rows. Rust-postgres returns row objects from which fields can be extracted. Converting that to a Rust struct is the only operation which needs to go fast.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;sfackler&#x2F;rust-postgres" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sfackler&#x2F;rust-postgres</a>