On May 4, 2007, at 4:08 PM, johnny wrote:

>
>> theres another extension called SqlSoup that does what I think youre
>> asking for.  creates the classes on the fly for each table which it
>> also reflects on the fly.
>>
>> http://www.sqlalchemy.org/trac/wiki/SqlSoup
>
> This is what I need.
>
> I have one more question.  Lets say I have a method that updates the
> table and uses SqlSoup to create mappers on the fly.
> That method will be called repeatedly many times in the application.
> That means SqlSoup will introspect the db on every call.

no, just once per table per SqlSoup instance, which you store at the  
module level so its initialized once per application.  the  
performance hit is generally negligible.

> This is bad
> for performance.  I just want to introspect once and save the file on
> disk, so I can import it.

then we go back to the beginning, where you use a declarative  
approach and lay out your Table objects explicitly.  the Metadata  
associated with those tables you pass to an SqlSoup instance.   We  
dont have a "print out the tables from a Table" feature right now but  
you can get a large part of the way there using repr().

but since you'd have the Table objects laid out anyway, you could use  
explicit mappers and/or an activerecord pattern like Elixir as well.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to