[Chicago] Yet another ORM for Python

Brantley Harris deadwisdom at gmail.com
Tue Jul 10 22:44:29 CEST 2007


On 7/10/07, Pete <pfein at pobox.com> wrote:
> Generating schema change scripts is a very hard problem.  It's analagous to
> diffing a pickle.  There's been quite a bit of academic research done in this
> area, but not much has come of it.  IIRC, there's a windows-based schema
> migration tool for Oracle that's supposed to be decent, but it's quite
> expensive and by no means automatic.

Meh, as far as I'm concerned I already solved it, the best that can be
done.  The trick is that you need an intermediary step between
generating what the system thinks you want done and the actual
execution.  So essentially you have a prediction step, where the
computer figures out what should be done; a review step, where the
user makes changes to what will be done; and then finally the
execution step, where the changes are enacted.  Oh and an 'undo',
that'd probably be a good idea.

The system I created for pre-magic removal Django worked rather well
for my needs anyway.  The "prediction step" essentially created a
script that contained directives like Model.rename('New Name'),
Model.drop(), and Model.create().  The user could then edit that
script, and then once it was run it would finally enact the changes to
the schema.  It was pretty good, but a nice graphic / web interface
would be better.

> AFAIK, you're not forced to use Django's ORM and can use SQLAlchemy instead if
> you like, but you lose some of the automagic.  Also AFAIK, the Django folks
> have said they're not planning to ditch their ORM.

No, there was an idea floating around to make SQLAlchemy the engine,
if you will, of the Django ORM.  So you could have the best of both
worlds.  SQLAlchemy is already split up between its SQL-handler and
its ORM, Django would merely replace that ORM part.


More information about the Chicago mailing list