On Sun, Jan 18, 2009 at 1:32 PM, Victor Lin <borns...@gmail.com> wrote: > > Hi, > > I am building some applications that insert data to database heavily. > I commit in for-loop every iteration. It seems that it is not a smart > way to commit data every iteration. SQL queries implies expensive IO > action. So I think that would be better to buffer data and flush them. > The question is, how to do with sqlalchemy? Are there any build-in > feature of sqlalchemy I can use? Is my strategy correct? >
Take a look at ticket #6095 to know the motivation and rationale behind the addition of the through option and some of the advantages when compared with using you own model with FKs to the two related models. Also and the documentation you pointed to modeltests/m2m_through tests show the usage of the new API that allows you to do the same things you were able to do but in a clearer way. Regards, -- Ramiro Morales --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---