[sqlalchemy] Is it possible to set the constraint unique = True except for empty string into SQLAlchemy?

2015-08-22 Thread Andriy Andrusyk
I use the following column in my table: email = Column(String(60), unique=True) However, I need the possibility to save empty strings in this column. Namely, I need

[sqlalchemy] converting date @ hybrid property

2015-08-22 Thread Mehdi
Hi I'm using latest sqlalchemy with an Oracle db backend. I have a Date column which presents a *Gregorian date* in db. but i want to query my table by a *Jalali date*. So the hybrid_property to convert gregorian date into jalali date should be like this, i think: @hybrid_property def jalali_

[sqlalchemy] Alembic 0.8.1 Released

2015-08-22 Thread Mike Bayer
Alembic 0.8.1 is now available. This release includes a small number of fixes and features, including repair of a regression which occurred with the new 0.8 series, where the "multidb" template failed to work with autogenerate. Some changes to the "ops" API were made to accommodate this, how

[sqlalchemy] Re: recurrence of sqlalchemy.exc.InternalError: (InternalError) (1205, u'Lock wait timeout exceeded ...

2015-08-22 Thread dewey
Thanks Mike!!! Good stuff. These errors are happening in production on a financial system that I wrote, but to which I do not have live access for security, liability and policy reasons. So I can't inspect the internal state of the server myself (and the SA with clearance won't go out of his w

Re: [sqlalchemy] Re: recurrence of sqlalchemy.exc.InternalError: (InternalError) (1205, u'Lock wait timeout exceeded ...

2015-08-22 Thread Mike Bayer
On 8/22/15 12:15 PM, dewey wrote: I'm creating my session like this: engine = create_engine(_db_con_str, echo=DB_ECHO, pool_recycle=3600, isolation_level="READ UNCOMMITTED") Session = sessionmaker(bind=engine) Session(expire_on_commit=False) Is any of that the likely culprit?? not at all

Re: [sqlalchemy] How to pass a table as a function parameter?

2015-08-22 Thread Tim Radke
That is the case, I'm afraid. Thanks for the prompt reply and thanks for making such a killer library. :-) On Sat, Aug 22, 2015, 9:51 AM Mike Bayer wrote: > what's the SQL you want - is this the special Postgresql syntax where an > entire table name is sent to a function? SQLAlchemy doesn't sup

Re: [sqlalchemy] How to pass a table as a function parameter?

2015-08-22 Thread Mike Bayer
what's the SQL you want - is this the special Postgresql syntax where an entire table name is sent to a function? SQLAlchemy doesn't support that. Just use text(), if this is the case. On 8/21/15 11:44 PM, Tim Radke wrote: I'm using SQLAlchemy version 0.9.8, connecting to Postgres 9.4. I'

[sqlalchemy] Re: recurrence of sqlalchemy.exc.InternalError: (InternalError) (1205, u'Lock wait timeout exceeded ...

2015-08-22 Thread dewey
I'm creating my session like this: engine = create_engine(_db_con_str, echo=DB_ECHO, pool_recycle=3600, isolation_level="READ UNCOMMITTED") Session = sessionmaker(bind=engine) Session(expire_on_commit=False) Is any of that the likely culprit?? -- You received this message because you are subs

[sqlalchemy] Re: recurrence of sqlalchemy.exc.InternalError: (InternalError) (1205, u'Lock wait timeout exceeded ...

2015-08-22 Thread dewey
I forgot to add the environment details: Python 2.7.8, SA 0.9.8 MySQL MariaDB 10.0.17 -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@g

[sqlalchemy] recurrence of sqlalchemy.exc.InternalError: (InternalError) (1205, u'Lock wait timeout exceeded ...

2015-08-22 Thread dewey
Guys, I keep seeing: sqlalchemy.exc.InternalError: (InternalError) (1205, u'Lock wait timeout exceeded in code where there should not be any contention for the records or indexes..I'm pretty experienced on the MySQL side and this even should be incredibly rare but it's happening with som