SQLAlchemy caching queries?

Issue #2192 resolved
Former user created an issue

Please see http://stackoverflow.com/questions/6333725/sqlalchemy-caching-queries for this bug i'm experiencing.

My bootstrap is at follows:

engine = create_engine( Config.DATABASE_URI, convert_unicode = True )
metadata = MetaData()
db_session = scoped_session( sessionmaker( bind = engine ) )

def init_db():
    metadata.create_all( bind = engine )

so no caching set or whatever.

SQLAlchemy version 1.7.1

Both these requests return the same result by querying the user tony. No matter what table i query after firing the first requests, sqlalchemy always appends 'where username LIKE 'tony%' (that's part of the query executed in first request)

"GET /admin/api/User/?username=tony HTTP/1.1" 200 -

"GET /admin/api/User/ HTTP/1.1" 200 -

Btw i'm using flask framework with sqlalchemy if that matters.

Comments (1)

  1. Mike Bayer repo owner

    While it seems unlikely there is any issue with SQLAlchemy as it does not cache SELECT queries in any way, there's nothing we can do here without very specific details including a full SQLAlchemy-only test case, which is not here or on the SO post. Please see the bug reporting guidelines at http://www.sqlalchemy.org/participate.html#bugs .

  2. Log in to comment