Re:Diesel: A Safe, Extensible ORM and Query Builder for Rust
by skywhopper on Friday February 05, 2016 @08:03PM
(#11045948)
The ORM model of building a query dynamically over multiple steps in multiple contexts gives you a lot more flexibility and more resilient code. You can share code that builds queries for multiple tables that share some, but not all, fields or relation patterns much more easily. And you can do it all without making multiple calls to the database.
[ Parent
| on HN ]
Re:Diesel: A Safe, Extensible ORM and Query Builder for Rust
by reedlaw on Friday February 05, 2016 @11:21PM
(#11046536)
See Sandi Metz' recent piece, The Wrong Abstraction [1]. I prefer a SQL template approach such as Yesql [2]. The trouble with an ORM like ActiveRecord is a lack of control of when and how the query is performed.
1. http://www.sandimetz.com/blog/2016/1/20/the-wrong-abstractio...
Re:Diesel: A Safe, Extensible ORM and Query Builder for Rust
by RussianCow on Saturday February 06, 2016 @01:31PM
(#11048986)
That's a problem with ActiveRecord and not with ORMs in general. Plenty of ORMs are explicit about how and when queries are performed. Check out SQLAlchemy for an example.