- changed status to wontfix
Setting engine.echo = True doesn't echo if it was already off during what would have been output
Issue #2040
resolved
This seems like a defect, so I skipped googlegroups. I am running ''SQLAlchemy-0.6.4''.
This script echos output as you would expect:
from sqlalchemy import *
from sqlalchemy.orm import *
engine = create_engine('sqlite://')
Session = sessionmaker(bind=engine)
session = Session()
engine.echo = True
session.execute("create table ab (data varchar)")
session.execute("create table bc (data varchar)")
However, this script echos nothing at all:
from sqlalchemy import *
from sqlalchemy.orm import *
engine = create_engine('sqlite://')
Session = sessionmaker(bind=engine)
session = Session()
session.execute("create table ab (data varchar)")
engine.echo = True
session.execute("create table bc (data varchar)")
Comments (1)
-
repo owner - Log in to comment
yeah you'd need to rollback(), commit(), or close() the session first, as the loglevel is checked upon engine.connect. Its not feasable for us to check the log level on every execute() call, sorry.