| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added a new style of mapper-level inheritance loading
"polymorphic selectin". This style of loading
emits queries for each subclass in an inheritance
hierarchy subsequent to the load of the base
object type, using IN to specify the desired
primary key values.
Fixes: #3948
Change-Id: I59e071c6142354a3f95730046e3dcdfc0e2c4de5
|
|
|
|
|
|
|
|
|
|
| |
Added new flag :paramref:`.Session.enable_baked_queries` to the
:class:`.Session` to allow baked queries to be disabled
session-wide, reducing memory use. Also added new :class:`.Bakery`
wrapper so that the bakery returned by :paramref:`.BakedQuery.bakery`
can be inspected.
Change-Id: I5657af7a99d2b24c89d6aee1343f432728e3f807
|
|
|
|
|
|
|
|
| |
level cache
- include SelectinLoader itself in the cache key, though
this is currently not critical
Change-Id: I8e4bcd579277fbe53d9c7eca3552a0b8ab9d7a39
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ``lazy="select"`` loader strategy now makes used of the
:class:`.BakedQuery` query caching system in all cases. This
removes most overhead of generating a :class:`.Query` object and
running it into a :func:`.select` and then string SQL statement from
the process of lazy-loading related collections and objects. The
"baked" lazy loader has also been improved such that it can now
cache in most cases where query load options are used.
Change-Id: Ic96792fffaa045ae9aa0a4657d6d29235d3efb85
Fixes: #3954
|
|
|
|
|
|
|
|
|
|
| |
Added support for bound parameters, e.g. those normally set up
via :meth:`.Query.params`, to the :meth:`.baked.Result.count`
method. Previously, support for parameters were omitted. Pull request
courtesy Pat Deegan.
Change-Id: I8c33548cf2a483699767e459731694c8cadebff6
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/350
|
|
|
|
|
| |
Change-Id: I8af0d7b41ae2df384ce5d0ef274732352d81f376
Fixes: #3897
|
|
|
|
| |
Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a new variant to the "isnew" state within entity loading
for isnew=False, but the load path is new. This is to address
the use case of an entity appearing in multiple places in
the row in a more generalized way than the fixes in [ticket:3431],
[ticket:3811] in that loading.py will be able to tell the
populator that this row is not "isnew" but is a "new" path
for the entity. For the moment, the new information is only
being applied to the use of "quick" populators so that
simple column loads can take place on top of a deferred loader
from elsewhere in the row.
As part of this change, state.load_path() will now always
be populated with the "path" that was in effect when this state
was originally loaded, which for multi-path loads of the
same entity is still non-deterministic. Ideally there'd be some
kind of "here's all the paths that loaded this state and how"
type of data structure though it's not clear if that could be
done while maintaining performance.
Fixes: #3822
Change-Id: Ib915365353dfcca09e15c24001a8581113b97d5e
|
|
|
|
|
|
|
|
|
| |
Discovered during testing for [ticket:3822], the rule added
for [ticket:1495] will fail if the source object has propagated
options set up, which add elements to query._current_path.
Fixes: #3824
Change-Id: I3d96c96fee5f9b247f739d2136d18681ac61f2fe
|
|
|
|
|
|
|
|
|
|
| |
Fix improper capture of a loop variable inside a lambda during unbaking
of subquery eager loaders, which would cause the incorrect query
to be invoked.
Fixes: #3743
Change-Id: I995110deb8ee2dae8540486729e1ae64578d28fc
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/290
|
| |
|
|
|
|
|
|
|
|
| |
for setting up baked lazy loaders would interfere with other
loader strategies that rely on lazy loading as a fallback, e.g.
joined and subquery eager loaders, leading to ``IndexError``
exceptions at mapper configuration time.
fixes #3612
|
|
|
|
|
|
|
|
|
| |
directly or within lazy loads, didn't consider the mapper's "get clause"
as part of the cache key, causing bound parameter mismatches if the
clause got re-generated. This clause is cached by mappers
on the fly but in highly concurrent scenarios may be generated more
than once when first accessed.
fixes #3597
|
|
|
| |
Thanks to Mike Bayer for suggesting a simpler refactoring.
|
|
|
| |
Also add a couple of missing tests.
|
|
|
|
| |
- changelog / version note finishing
|
|
|
|
| |
- alter the approach so that the initial callable is working just like add_criteria/with_criteria
|
|
|
|
|
|
|
|
|
|
|
|
| |
When making baked query in classmethod of declarative base,
cls should be added in cache key.
@as_declarative
class Base(object):
@classmethod
def baked_query(cls):
return bakery(lambda: session.query(cls), (cls,))
|
|
simple but unusual system allows for a dramatic savings in Python
overhead for the construction and processing of orm :class:`.Query`
objects, from query construction up through rendering of a string
SQL statement.
fixes #3054
|