ANN: Dejavu 1.5.0RC1

Michele Cella michele.cella at gmail.com
Thu Jan 25 11:31:30 EST 2007


On 25 Gen, 09:02, "fumanchu" <fuman... at amor.org> wrote:
>
> > I am curious ... how this compare to SQLAlchemy?The comparisons could be endless ;) but here are some of the larger
> differences:
>
>  1. Dejavu uses generic "storage" concepts and syntax, while SQLAlchemy
> prefers database concepts and syntax.
>  2. Dejavu uses Python expressions (lambdas) to query storage, whereas
> SQLAlchemy uses functions and magic attributes:
>     * SQLAlchemy: users.select(and_(users.c.age < 40, users.c.name !=
> 'Mary'))
>     * Dejavu: recall(users, lambda u: u.age < 40 and u.name != 'Mary')
>  3. SQLAlchemy prefers that you write data classes, table classes and
> the mappers between them. Dejavu only expects you to write a data
> class. New in 1.5: you can auto-generate even the data classes if you
> already have a populated database.
>  4. SQLAlchemy allows you to write more complicated queries (like
> subqueries and aggregate columns). Dejavu doesn't provide those yet
> (slated for 1.6).
>

5. Dejavu supports model evolution (very much like rails's ActiveRecord
migrations)

I will add that I've never been able to (easily) wrap my head around
ORMs like SQLObject and SQLAlchemy, while they are both great pieces of
software and SQLAlchemy is impressively well documented (like every
other things powered by Michael Bayer) they are trying to reinvent an
ad-hoc query language on top of SQL using python that you need to
learn, that's why my favorite Dejavu feature it's the way you build
queries (using common python constructs like lambda) and define models
(using python types like str, unicode... or your own).

I really encourage anyone to check it out, it's not getting the
publicity it deserves but this doesn't mean it's not good at what it
does, and Robert is like a quality assurance. ;-)

Ciao
Michele




More information about the Python-list mailing list