10 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: Avoiding reflection ...
FromSent OnAttachments
Don Dwiggins22 Feb 2008 18:05 
Michael Bayer22 Feb 2008 18:17 
Don Dwiggins25 Feb 2008 10:08 
Rick Morrison25 Feb 2008 10:53 
Don Dwiggins25 Feb 2008 12:10 
Rick Morrison25 Feb 2008 12:42 
Waldemar Osuch26 Feb 2008 11:45 
Rick Morrison28 Feb 2008 16:57.patch
Don Dwiggins29 Feb 2008 11:35 
Michael Bayer29 Feb 2008 12:44 
Subject:[sqlalchemy] Re: Avoiding reflection (was: Re: Reflecting tables with foreign keys)
From:Waldemar Osuch (wald@gmail.com)
Date:02/26/2008 11:45:32 AM
List:com.googlegroups.sqlalchemy

On Feb 25, 1:10 pm, Don Dwiggins <d.@dondwiggins.net> wrote:

Rick Morrison wrote:

Ugg, I am not a big table reflection fan....:-(

I am in the middle of readying a presentation, so unless someone else wants to jump on this, I'll take a look at this later on this week, along with integrating a reflection speed-up patch I remember from a while back.

Thanks. I'm willing to use something other than reflection, if there's a good way I can avoid having to duplicate my schema (or significant chunks of it) in SA declarations. I'd like to stick to the DRY principle if at all possible. (I'm dealing with a legacy DB, and can't really take SA declarations as "ground truth".)

The approach I have taken is to to dump the legacy database definitions into python module using autocode. http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode. (I had to tweak the recipe slightly to work with Oracle)

The resulting code needed clean up but still it was a win - no more waiting for the reflection to finish. Now if DB schema changes I have to update my module but I do not mind, the changes are rare. It is a legacy database after all :-).

Waldemar