Re: [sqlalchemy] more granular logging configuration

2018-03-20 Thread Uri Okrent
On Thursday, March 15, 2018 at 9:11:06 AM UTC-4, Mike Bayer wrote: > use execution events for this, before_cursor_execute tends to be a > good choice (but not the only one): > > >

[sqlalchemy] more granular logging configuration

2018-03-15 Thread Uri Okrent
Hey all, are there any more knobs to turn besides the logging debug level ("DEBUG", "INFO")? Specifically I would like to somehow be able to log read-only queries to a separate log (or maybe even skip logging those altogether) since they are far more numerous and frequent. Thanks --

Re: [sqlalchemy] select with_for_update with nowait=True

2017-06-05 Thread Uri Okrent
On Monday, May 29, 2017 at 12:27:51 PM UTC-4, Mike Bayer wrote: > > I'm assuming this "invalidates the transaction" is on the Postgresql > side, e.g. you get "current transaction is aborted". There is a simple > solution for that which is to use a savepoint, which with the ORM is via >

[sqlalchemy] select with_for_update with nowait=True

2017-05-28 Thread Uri Okrent
Background: I have a postgres database containing objects with 1-N (parent-child) relationships. Each object can have several of these types of relationships (i.e., more than one parent). These are connected by foreign keys with 'on delete set null' since a child can lose a parent and that is

Re: [sqlalchemy] hang on connect in forked process

2016-02-21 Thread Uri Okrent
0 PM UTC-8, Mike Bayer wrote: > > > > On 02/18/2016 01:39 PM, Uri Okrent wrote: > > Looks like forking from a thread causes other issues. I think I've > > resolved the hang in psycopg2 by creating a brand new engine in the > > forked subprocess, but now I'm getting occ

Re: [sqlalchemy] hang on connect in forked process

2016-02-18 Thread Uri Okrent
this section when forking. Either one is probably a monkey patch... On Wednesday, February 17, 2016 at 10:41:00 AM UTC-8, Mike Bayer wrote: > > > > On 02/17/2016 11:33 AM, Uri Okrent wrote: > > Maybe this is a psycopg question and if so please say so. > >

[sqlalchemy] hang on connect in forked process

2016-02-17 Thread Uri Okrent
Maybe this is a psycopg question and if so please say so. I have a multi-threaded server which maintains a thread-pool (and a corresponding connection pool) for servicing requests. In order to mitigate python's high-water-mark memory usage behavior for large queries, I'm attempting to handle

[sqlalchemy] combining column_property and TypeDecorator

2015-11-10 Thread Uri Okrent
Seems like a simple thing to do but I can't seem to find an example. Say I have a simple column_property like the example in the docs: fullname = column_property(firstname + " " + lastname) and I want to perform additional (trivial in this example) processing on the result at the orm level

[sqlalchemy] inherited column_property

2015-11-09 Thread Uri Okrent
I'm trying to define a column_property on a mixin class for a joined-table polymorphic class but I'm having issues with the from/joins. These are my classes: class MomBase(Base): __tablename__ = 'mom_objects' guid = Column(Text, primary_key=True) index = Column(Integer, index=True)

Re: [sqlalchemy] TypeDecorator odd behavior

2015-10-28 Thread Uri Okrent
ork against the pg backend (I'd get an Exception that the impl doesn't define getitem) unless I set the class impl to JSON. Thanks for the quick help! On Wednesday, October 28, 2015 at 10:48:26 AM UTC-4, Michael Bayer wrote: > > > > On 10/27/15 9:01 PM, Uri Okrent wrote: > &g

[sqlalchemy] Re: TypeDecorator odd behavior

2015-10-28 Thread Uri Okrent
update: tried with 0.9.10 and I see the same behavior On Tuesday, October 27, 2015 at 9:01:55 PM UTC-4, Uri Okrent wrote: > > Hello, I've created a TypeDecorator for use with postgresql's JSON type, > for the purpose of adapting it to sqlite and it's producing an incorrect > bind pa

[sqlalchemy] TypeDecorator odd behavior

2015-10-27 Thread Uri Okrent
Hello, I've created a TypeDecorator for use with postgresql's JSON type, for the purpose of adapting it to sqlite and it's producing an incorrect bind parameter when using JSON's column index operation. I'm using sqlalchemy 0.9.4 (I haven't been able to install a more updated version as yet,

Re: [sqlalchemy] Performance questions on semi-large result sets

2015-10-21 Thread Uri Okrent
Interesting... On Wednesday, October 21, 2015 at 5:43:22 PM UTC-4, Michael Bayer wrote: > > class Customer(Base): > __tablename__ = "customer" > id = Column(Integer, primary_key=True) > name = Column(Unicode(255)) > description = Column(Unicode(255)) > My declarative classes