Re:Object-Relational Mapping is the Vietnam of Computer Scie...
by habitue on Thursday February 27, 2014 @12:06AM
(#7310492)
Yeah, I think sqlalchemy broke the mold. It starts from the idea that you already know and understand SQL and relational constructs well, then adds a layer of abstraction that lets you skip tons of boilerplate and write really elegant code. Personally, while there are lots of good decisions in sqlalchemy like the unit of work pattern (in contrast to the active record pattern), the one that pays off time and again is representing the SQL ast as python objects. It eliminates and entire class of text munging issues that occur when you write raw SQL and just completely makes you wonder "where's the mismatch they keep talking about?"
[ Parent
| on HN ]
Re:Object-Relational Mapping is the Vietnam of Computer Scie...
by _pmf_ on Thursday February 27, 2014 @01:27AM
(#7310703)
Do you know of any Java-OR mappers in the same spirit?
Re:Object-Relational Mapping is the Vietnam of Computer Scie...
by teacup50 on Thursday February 27, 2014 @01:51AM
(#7310747)
Java: http://www.jooq.org/
Scala: http://slick.typesafe.com/
They also have the benefit of being fully type-safe across query projections.
Re:Object-Relational Mapping is the Vietnam of Computer Scie...
by lukaseder on Thursday February 27, 2014 @12:28PM
(#7313469)
I don't think Slick can be considered a very SQL-centric API. While the Slick folks embrace the relational model, they certainly do not embrace the SQL language. Just as with LINQ, this can be desirable if you want to reason about collections in a more general sense. On the other hand, the SQL standard has gone far beyond the "occasional" OUTER JOIN that can turn out to be a true challenge to Slick.
In other words, SQL has never been purely relational. It is a beast of its own.