3 ms·
As a knee-jerk response I was going to point out that all of these problems were already solved well by complementary patterns available in libraries like SQLAl
by jchw 7y ago
As a knee-jerk response I was going to point out that all of these problems were already solved well by complementary patterns available in libraries like SQLAlchemy, but after reading it is clear that what the author is referring to as “Active Record” is different than what you are probably thinking. That said, I don’t know any ORMs that don’t have query building APIs right now, so I’m not sure what this is aimed at; its clearly possible to combine object based ORM interfaces very nicely with query builders. The relationship is beneficial imo. I think this will become more apparent in languages like Rust where you could potentially use metaprogramming to provide a bunch of type safe sugar revolving around your model classes in the query builder (I haven’t tried SQL in Rust yet - this may already exist for all I know.) It is already useful in Python where it can aid in migrations, scaffolding for tests and new environments, and of course, the pretty common case where you are really dealing with entire objects, like CRUD.
- steveklabnik 7y agoIt does! http://diesel.rs/ http://diesel.rs/ (Created by one of the former maintainers of ActiveRecord in Rails. It's much more of a query builder than an AR implementation.)