> -----Original Message-----
> From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com]
> On Behalf Of Mike Conley
> Sent: 27 July 2011 17:43
> To: sqlalchemy@googlegroups.com
> Subject: [sqlalchemy] engine.echo not working as expected
> 
> Under 0.5 I was able to turn echo on and off as desired to support
> debugging; it doesn't seem to work now.
> 
> Python version: 2.7.1
> SQLAlchemy version: 0.7.1
> 
> Here's the code:
> 
> from sqlalchemy import *
> eng1 = create_engine('sqlite:///')
> meta1 = MetaData(bind=eng1)
> tab_a = Table('x', meta1,
>     Column('id',Integer, primary_key=True))
> meta1.create_all()
> conn = eng1.connect()
> conn.execute(tab_a.insert())
> x=conn.execute(select([tab_a])).fetchone()
> eng1.echo=True
> conn.execute(tab_a.delete().where(tab_a.c.id==x.id))
> 
> Under 0.5.8 The SQL for the delete is echoed, under 0.7 (and I think
> 0.6) it is not.
> If I move the echo=True before the select, both the select and delete
> are echoed.
> It looks like there might be a subtle difference since 0.5 that keeps
> the logging from taking effect immediately when echo is changed.
> 
> P.S. Now as I try to reverify it, I have to move the echo=True all
> the way before the connect() to get it to echo.
> 

This is explained in the note at the bottom of
http://www.sqlalchemy.org/docs/core/engines.html#configuring-logging.

(not that that necessarily helps you, but it does at least say that it
is expected behaviour)

Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to