Re: [sqlalchemy] session flush inserts performing VERY slow for MS Sql Server

2016-03-07 Thread Jason Brownstein
Thanks Mike - will the full profile ASAP. On Monday, March 7, 2016, Mike Bayer wrote: > What will make inserts slow is network as well as indexes. If you aren't > comparing your script to some other backend then there's probably a whole > lot of other things that can

[sqlalchemy] Re: how to serializer list object in sqlalchemy?

2016-03-07 Thread Ramin Farajpour Cami
Thanks, but not work, very very bad sqlalchemy in this,i have relstionship not work class Student(Base): __tablename__ = 'reltest' id = Column(Integer, primary_key=True) name = Column(String(50)) fullname = Column(String(50)) password =

[sqlalchemy] session flush inserts performing VERY slow for MS Sql Server

2016-03-07 Thread jbrownstein
I've run sqlalchemy on MySQL dbs and never had a problem with performance, but when I started writing an app that connected to Microsoft SQL Server 2014 via pyodbc I ran into a serious performance problem. I'm running the app on my laptop and the database server IS in a VPN but my internet is

Re: [sqlalchemy] How can I use negate for operator in UserDefinedType.Comparator

2016-03-07 Thread Mike Bayer
On 03/07/2016 01:03 PM, Frazer McLean wrote: Hi, This should demonstrate the problem I'm having. I think I should be doing something to turn 'other' into an expression before BinaryExpression will work with it? | importsqlalchemy.types astypes fromsqlalchemy

[sqlalchemy] Re: how to serializer list object in sqlalchemy?

2016-03-07 Thread Jonathan Vanasco
1. You're serializing the SqlAlchemy object, not the data. In order to get the underlying data from an object, I PERSONALLY use a mixin class for my declarative base that offers `columns_as_dict`: def columns_as_dict(self): return dict((col.name, getattr(self, col.name)) for col in

Re: [sqlalchemy] How can I use negate for operator in UserDefinedType.Comparator

2016-03-07 Thread Frazer McLean
Hi, This should demonstrate the problem I'm having. I think I should be doing something to turn 'other' into an expression before BinaryExpression will work with it? import sqlalchemy.types as types from sqlalchemy import Column, Integer, create_engine from sqlalchemy.ext.declarative import

Re: [sqlalchemy] How can I use negate for operator in UserDefinedType.Comparator

2016-03-07 Thread Mike Bayer
On 03/07/2016 09:11 AM, Frazer McLean wrote: ||I am trying to add regexp and iregexp operators to a subclass of the Text type. I'm using SQLAlchemy v1.0.12. I am able to correctly use '~' and '!~' operators if I use a notregexp method like this: | importsqlalchemy.types astypes

[sqlalchemy] How can I use negate for operator in UserDefinedType.Comparator

2016-03-07 Thread Frazer McLean
I am trying to add regexp and iregexp operators to a subclass of the Text type. I'm using SQLAlchemy v1.0.12. I am able to correctly use '~' and '!~' operators if I use a notregexp method like this: import sqlalchemy.types as types class TEXT(types.Text): class

[sqlalchemy] how to serializer list object in sqlalchemy?

2016-03-07 Thread Ramin Farajpour Cami
I use jsonpickle for serializer when i selectall to database, i am going to convert list object to json when use jsonpickle for this i get this output: Codes: Session = sessionmaker(bind=connect.ConnectorMySql()) ses = Session() lst =