Re: [sqlalchemy] Declared Attribute Inheritance Not Working As Expected?

2018-10-05 Thread Mike Bayer
note I didn't use flask-sqlalchemy. Check to see if that is the thing that changes the behavior. On Fri, Oct 5, 2018 at 1:42 PM Mike Bayer wrote: > > On Fri, Oct 5, 2018 at 11:02 AM Victor Reichert wrote: > > > > Hi, > > > > I have a mixin like: > > > > class BasicSqlClass(object): > > > >

Re: [sqlalchemy] Declared Attribute Inheritance Not Working As Expected?

2018-10-05 Thread Mike Bayer
On Fri, Oct 5, 2018 at 11:02 AM Victor Reichert wrote: > > Hi, > > I have a mixin like: > > class BasicSqlClass(object): > > @declared_attr > def __tablename__(cls): > return convert(cls.__name__) + 's > > > The mixin declares the table name and does other stuff. > > Hover, there

[sqlalchemy] Declared Attribute Inheritance Not Working As Expected?

2018-10-05 Thread Victor Reichert
Hi, I have a mixin like: class BasicSqlClass(object): @declared_attr def __tablename__(cls): return convert(cls.__name__) + 's The mixin declares the table name and does other stuff. Hover, there is a class where I wanted to overwrite the mixed-in __tablename__ by declaring

Re: [sqlalchemy] Very slow inserts when using sqlalchemy core

2018-10-05 Thread Mike Bayer
On Fri, Oct 5, 2018 at 9:15 AM wrote: > > Simon, > > The MySQLdb module performs this operation with very little difference to > native (mysql < data.sql) speed, so I'm not concerned on that, the delta was > <0.5 seconds > > In my original example (I didn't know I could pass a dict to the

Re: [sqlalchemy] Very slow inserts when using sqlalchemy core

2018-10-05 Thread adam . botbyl
Simon, The MySQLdb module performs this operation with very little difference to native (mysql < data.sql) speed, so I'm not concerned on that, the delta was <0.5 seconds In my original example (I didn't know I could pass a dict to the execute to have it fill in the parameters) I built the

Re: [sqlalchemy] Very slow inserts when using sqlalchemy core

2018-10-05 Thread Simon King
MySQLdb builds a new SQL string by escaping each of the parameters and then substituting them into the original SQL: https://github.com/farcepest/MySQLdb1/blob/master/MySQLdb/cursors.py#L182 For 89 columns * 10,550 rows, that's nearly 1 million parameters. Each one involves a call to