[Sqlalchemy-tickets] Issue #4135: Enable set_shard on baked qurires (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
From: Rishi S. <iss...@bi...> - 2017-11-11 14:03:49
|
New issue 4135: Enable set_shard on baked qurires https://bitbucket.org/zzzeek/sqlalchemy/issues/4135/enable-set_shard-on-baked-qurires Rishi Sharma: I am exploring the use of baked queries to help reduce the compilation overhead. Looks great, however, we use ShardedQuery as the query_cls in our session and need the flexibility to set_shard on the query object. The reason for this is to avoid our catch-all implementation of query_chooser, which calls query.statement and negates the performance gain from the baked query. Roughly speaking, being able to do the following would be useful for us: ``` #!python baked_query(session).params(user_id=user_id).set_shard(shard_id).one_or_none() ``` We are currently on 1.1.15 |