views:

1039

answers:

6

I've recently started to fell in love with SQLAlchemy. You can write clean and fast SQL statements without having to write one line of SQL. There is no need to write most of the meta configuration you would need for something like Hibernate. At work I managed to create a mapper for a table which doesn't have a primary key! I can have composite primary keys, no need to spread an id column over all tables if you have a real primary key. And its autoload feature really works, at least for the Oracle engine. Is there any ORM out there which has the same capabilities? Till now I haven't found one.

+3  A: 

http://www.sqlobject.org/

https://storm.canonical.com/

Unknown
storm is pretty nice.
Geo
A: 

Do you mean, for a non-Python environment? With Python, you could just use SQLAlchemy with Elixir (or the declarative layer included with SQLAlchemy itself) - this gives you the ability to easily work with objects persisted via SQLAlchemy.

http://elixir.ematia.de/

Vinay Sajip
A: 

You can use the Django ORM as a stand alone solution, without all the rest of the Django framework. It has very similar capabilities. Together with South of Django-migrations this is very nice.

Ber
You can't do composite primary keys or tables missing primary keys in Django, as of 1.1 at least. Support for working with more than one database at a time is being worked upon.
kaleissin
Very similar? No, there's really no feature comparison. SQLAlchemy handles many more scenarios that Django just can't hack.
Eloff
+8  A: 

I haven't seen anything other than Hibernate that has capabilities similar to SQLAlchemy. This is not entirely accidental as SQLAlchemy has been heavily influenced by Hibernate (although not completely). Hibernate's HQL allows pretty good expression support and it allows a decoupled datamapper pattern, lots of flexibility about primary keys and collections, and eager loading of collections via joins - SQLA's eager loading in particular as well as its "cascade" feature were inspired by that of Hibernate. At a nuts and bolts level, SQLAlchemy's approach of actually loading collections and related items into an object's __dict__, as opposed to proxying attributes which perform a load everytime (which is what SQLObject and Storm do), makes it more similar to Hibernate than any other Python solution I've seen.

zzzeek
A: 

i think that it will be helpful for you

http://www.sqlalchemy.org/docs/05/ormtutorial.html#using-subqueries

nazmul hasan
A: 

Maybe DejaVu, which had been compared to sqlalchemy and storm here

ychaouche