Semeiotike

Woke Up. Ate a Sandwich. Went to Bed.

Skip to Main Content

Viva La SQL!

Daniel Spiewak over at Code Commit poses the question Should ORMs Insulate Developers from SQL? My initial answer before reading the article is a resounding NO, which seems to agree with Daniel's assessment. The problem is, ORMs work really really well for the things that their designers kept in mind. Don't get me wrong, I've happily used ActiveRecord SQLObject as well as written a few “Micro-ORMs” for internal projects. The problem is when you drink the “You should never have to write SQL” kool-aid.

The thing I don't want out of my ORM is to have to learn a new relational language (like Hibernate's HQL) when I need to go beyond the assumptions of the ORM authors. Similarly, I despise leaky abstractions and I want my ORM to get out of the way and let me drop a query when the wrappers don't work. “But”, the converted say, “wouldn't you like to use a DSL to write your database queries?” Why yes, yes I would. In fact I'd like to use a well-tested and robust DSL for my relational queries—I call that DSL SQL, and it works pretty darned well.

Content contained on Semeiotike, unless otherwise noted is © 1994-2008 Jeremy J. Sydik and / or Katherine A.W. Sydik
Powered by CommonPlace