Drop followed by generation of Foreign Keys

2015-09-18 Thread Sergi Pons Freixes
Hi everybody, I am experiencing the same issue commented here: https://bitbucket.org/zzzeek/alembic/issues/293/alembic-autogenerate-creates-endless In my case, I have the model: ---8<-- ... class EmailAttachment(Base): __tablename__ = 'email_attachment'

[sqlalchemy] Capturing query parameters

2015-09-18 Thread George Reilly
I find [SQLTap](http://sqltap.inconshreveable.com/) invaluable for profiling SQLAlchemy queries. Currently, I've reduced one operation in our system from nearly 12,000 queries to 800, and I'm not finished yet. SQLTap listens for the before_execute and after_execute events. In after_execute, it

Re: [sqlalchemy] Capturing query parameters

2015-09-18 Thread George Reilly
On Fri, Sep 18, 2015 at 1:33 PM, Mike Bayer wrote: > > On 9/18/15 3:22 PM, George Reilly wrote: > > I find [SQLTap](http://sqltap.inconshreveable.com/) invaluable for > profiling SQLAlchemy queries. Currently, I've reduced one operation in our > system from nearly

Re: [sqlalchemy] Mixed data type for a column

2015-09-18 Thread Mattias Lagergren
Hi again Michael, I'm still working with this problem but have changed it so that I'm no longer trying to CAST in the database, since you made me aware about the limitations of mixed types in traditional RDBMS. What I want is a column, casted_value, on the model that gives me the CASTed

Re: [sqlalchemy] Capturing query parameters

2015-09-18 Thread Mike Bayer
On 9/18/15 3:22 PM, George Reilly wrote: I find [SQLTap](http://sqltap.inconshreveable.com/) invaluable for profiling SQLAlchemy queries. Currently, I've reduced one operation in our system from nearly 12,000 queries to 800, and I'm not finished yet. SQLTap listens for the before_execute

[sqlalchemy] Re: create and update table dynamically in declarative base

2015-09-18 Thread Nana Okyere
Can anyone help me with this? -- 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...@googlegroups.com. To post to this group, send email to

Re: [sqlalchemy] Mixed data type for a column

2015-09-18 Thread Mattias Lagergren
Forgot the actual question; is there a better less complicated solution? With hybrid_property expression I get into the problem that it doesn't load up front: session.query(Variable_Value) Thanks! Mattias L On Friday, September 18, 2015 at 12:25:41 PM UTC+2, Mattias Lagergren wrote: > > Hi

[sqlalchemy] Re: Mixed data type for a column

2015-09-18 Thread Jonathan Vanasco
If I understand you correctly, I would just do this: 1. Use 3 different columns for the value -- each a native data type. 2. Use `coalesce` to handle sorting 3. When displaying in sqlalchemy, just use a property to proxy displaying the set column (and explicitly work with the correct columns

[sqlalchemy] Re: Mixed data type for a column

2015-09-18 Thread Mattias Lagergren
Hi Jonathan, Yes, but as I mentioned in the original post, this is to improve an existing system and a solution that does not involve changes to the database schema would be ideal. I think I've found a way forward by adding a column with column_property and then using a synonym to with a