[Discuss] SQLAlchemy Has Annoyances

Kent Borg kentborg at borg.org
Thu Feb 5 14:47:10 EST 2015


On 02/05/2015 01:45 PM, Mike Small wrote:
> So in his case could he use only one class and map it to many tables? 
> i.e. when finished with one temporary table and moving on to a second 
> one, 

I tried that, and SQL Alchemy complains.

> could he sweep out all the old class members (member variables or 
> methods -- I don't know how the mapping to columns is done here) and 
> add new ones corresponding to the new set of columns? 

I don't dare do surgery on the class unless I also do matching surgery 
on the private data structures they are maintaining to map between a 
class and SQL. The don't watch the class dynamically, that is why I have 
to make a mapper call.

I also considered lifting from their code that frees all the mappings 
and just free the one I want, but that seemed dangerous and getting is 
too deep.

-kb




More information about the Discuss mailing list