Why object-relational mapping makes me sad

I’ve spent a lot of time lately dealing with SQLAlchemy, which is an object-relational mapper for Python. As you might guess from the title of this post, it makes me kind of sad.

SA’s job is to be an abstraction layer over the database, so that you can write queries as Python functions and get back your results as Python objects. The SQLAlchemy abstraction barrier does act as a barrier in some ways:

On the other hand, it totally punts on some other things:

I’m not claiming that ORMs are necessarily bad on net. We’re almost certainly more productive using SQLAlchemy than if we were writing raw SQL. But I can’t help but feel like there must be something better.

Comments

email me replies

format comments in markdown.

Your comment has been submitted! It should appear here within 30 minutes.
Andrews

ActiveRecords in Rails gives me a different feel about ORMs. You can try it out.

email me replies

format comments in markdown.

Your comment has been submitted! It should appear here within 30 minutes.