SQLObject or SQLAlchemy?

Bruno Desthuilliers onurb at xiludom.gro
Fri Sep 1 10:51:39 CEST 2006

Jorge Vargas wrote:
> On 8/31/06, John Salerno <johnjsal at nospamgmail.com> wrote:
>> Are there any major differences between these two? It seems they can
>> both be used with TurboGears, and SQLAlchemy with Django. I'm just
>> wondering what everyone's preference is, and why, and if there are even
>> more choices for ORM.
> they use two approach to the same problem.

I do not agree here. SLQObject tries to use a RDBMS for object
persistance, while SQLAlchemy's main goal is to provide a better
integration of RDBMS into Python - ORM features being just an optional

> SO tries to tide each object to a table while
> SA lets you do the mapping.
> so each one has it's pros and cons.
> for example SA wins at using an existing db
> but SO wins at not worring about the db structure

Not worrying about the db structure ? Heck, why using a RDBMS then - if
what you want is object persistance, ZODB works just fine.

SQLAlchemy clearly exposes the RDBMS schema (you can either define the
schema in Python or use reflection), and gives you access to the full
power of SQL DBMS without having to do the embed-SQL-as-strings dance.


> In my experience SO is great for new projects
>  and if you don't want to
> mess/optimize with the actual SQL queries (which is great for an ORM
> because IMO that is the main goal of ORMing)

Disagreement here too. Even for relatively simple new projects,
SQLObject can be far too limited to take advantage of relational
paradigm. Try managing valued many-to-many associations with SQLObject -
which is a pretty simple and common requirement, and certainly not
"messing with the db".

SQLObject, while being a much better piece of software than what I could
come with by myself (been here, done that...), is IMVHO a wrong
solution. I mean, a RDBMS is not a persistence engine, it's a data
management tool. If you don't need a relational model, or if it doesn't
match your app's needs, then why use one when we have great OODBMS in
Python ?

My 2 cents...
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"

More information about the Python-list mailing list