SQLObject or SQLAlchemy?

Adam Jones ajones1 at gmail.com
Thu Aug 31 18:59:08 EDT 2006


John Salerno wrote:
> Adam Jones wrote:
>
> > I think SA's extra flexability
> > is worth the effort.
>
> Thanks for the reply. Do you mean in the above quote that SA is a little
> more complicated than SO?

Yes, it is. To avoid the technical issues involved the complication can
be summarized as: SQLAlchemy implements the Data Mapper pattern, of
which the Active Record pattern (which SQLObject implements) is a
subset.

SO makes a few assumptions about your tables (like that it will have
single immutable primary keys for all tables) which make it difficult
to work with an existing database. It also does not have the ability to
compile multiple queries into a single unit of work for processing, at
least not on the same level that SA does. Given that SA can support
more complex data models, is better for supporting pre-existing
databases, and usually is faster. After you have learned it you have a
better tool all around. That said it is more complicated, and if what
you are doing is not high traffic and does not require extremely
complex data models SO is still an excellent choice.




More information about the Python-list mailing list