| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
See README.unittests for information on how to run
the tests. [ticket:970]
|
| |
|
|
|
|
|
|
|
|
| |
a joined-table subclass entity, i.e.
query(SubClass.foo, SubcClass.bar).join(<anything>).
In most cases, an error "Could not find a FROM clause to join
from" would be raised. In a few others, the result would be
returned in terms of the base class rather than the subclass -
so applications which relied on this erroneous result need to be
adjusted. [ticket:1431]
|
| |
|
|
| |
dependencies on those.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in conjunction with large mapper graphs, large numbers of
objects:
- The Session's "weak referencing" behavior is now *full* -
no strong references whatsoever are made to a mapped object
or related items/collections in its __dict__. Backrefs and
other cycles in objects no longer affect the Session's ability
to lose all references to unmodified objects. Objects with
pending changes still are maintained strongly until flush.
[ticket:1398]
The implementation also improves performance by moving
the "resurrection" process of garbage collected items
to only be relevant for mappings that map "mutable"
attributes (i.e. PickleType, composite attrs). This removes
overhead from the gc process and simplifies internal
behavior.
If a "mutable" attribute change is the sole change on an object
which is then dereferenced, the mapper will not have access to
other attribute state when the UPDATE is issued. This may present
itself differently to some MapperExtensions.
The change also affects the internal attribute API, but not
the AttributeExtension interface nor any of the publically
documented attribute functions.
- The unit of work no longer genererates a graph of "dependency"
processors for the full graph of mappers during flush(), instead
creating such processors only for those mappers which represent
objects with pending changes. This saves a tremendous number
of method calls in the context of a large interconnected
graph of mappers.
- Cached a wasteful "table sort" operation that previously
occured multiple times per flush, also removing significant
method call count from flush().
- Other redundant behaviors have been simplified in
mapper._save_obj().
|
| |
|
|
| |
the evaluator
|
| | |
|
| |
|
|
|
|
| |
when used in an unambiguously scalar context, i.e. it's used
in a comparison operation. This applies to
the ORM when using query.subquery() as well.
|
| |
|
|
|
| |
to the FROM clause, such as with select_from(), using
with_polymorphic(), or using from_self().
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
its selectable, which means a Query instance can be accepted
in many SQL expressions, including col.in_(query),
union(query1, query2), select([foo]).select_from(query),
etc.
- the __selectable__() interface has been replaced entirely
by __clause_element__().
|
| |
|
|
|
|
|
|
|
|
| |
- _ORMJoin() gets a new flag join_to_left to specify if
we really want to alias from the existing left side or not. eager loading
wants this flag off in almost all cases, query.join() usually wants it on.
- query.join()/outerjoin() will now properly join an aliased()
construct to the existing left side, even if query.from_self()
or query.select_from(someselectable) has been called.
[ticket:1293]
|
| |
|
|
|
|
| |
Session methods have been deprecated, replaced by
"expunge_all()" and "add()". "expunge_all()" has also
been added to ScopedSession.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
the rendering of eager joins inside the subquery produced.
The "disable all eager joins" feature is available publically
via a new query.enable_eagerloads() generative. [ticket:1276]
- Added a rudimental series of set operations to Query that
receive Query objects as arguments, including union(),
union_all(), intersect(), except_(), insertsect_all(),
except_all(). See the API documentation for
Query.union() for examples.
- Fixed bug that prevented Query.join() and eagerloads from
attaching to a query that selected from a union or aliased union.
|
| |
|
|
|
|
| |
doesn't match the property-based attribute - while it's
unlikely anyone is doing this, the SQLAlchemy author was
guilty of this particular loosey-goosey behavior.
|
| | |
|
| |
|
|
|
|
|
|
| |
impact a Query made against a selectable containing
multiple versions of the same table, as well as
unions and similar which contained the same table columns
in different column positions at different levels.
[ticket:1268]
|
| |
|
|
|
|
|
|
|
| |
to query.update({}). [ticket:1262]
- Mapped attributes passed to the values() of an
expression level insert() or update() will use the
keys of the mapped columns, not that of the mapped
attribute.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as a column expression and it will be expanded.
Somewhat related to [ticket:1253].
- Query() is a little more robust when passed
various column expressions such as strings,
clauselists, text() constructs (which may mean
it just raises an error more nicely).
- select() can accept a ClauseList as a column
in the same way as a Table or other selectable
and the interior expressions will be used as
column elements. [ticket:1253]
- removed erroneous FooTest from test/orm/query
-This line, and those below, will be ignored--
M test/orm/query.py
M test/orm/mapper.py
M test/sql/select.py
M lib/sqlalchemy/orm/query.py
M lib/sqlalchemy/sql/expression.py
M CHANGES
|
| |
|
|
|
| |
This should assist with helping to document the reasons for testing failures.
Currently unspecified failures are defaulted to 'FIXME: unknown'.
|
| |
|
|
| |
duplicate columns in the order by clause.
|
| |
|
|
| |
Query.update. Thanks zzzeek. Fixes #1242.
|
| | |
|
| |
|
|
| |
properly converted to IS NOT NULL based on not_().
|
| |
|
|
|
|
|
|
| |
that the given argument is a FromClause,
or Text/Select/Union, respectively.
- Query.add_column() can accept FromClause objects
in the same manner as session.query() can.
|
| |
|
|
| |
to appropriately flag it as not supported on mssql. I sure hope I didn't jack things up for other dialects. Cleaned up a comment and removed some commented pdb statements.
|
| |
|
|
| |
offset. A lot of dialects don't really require order_by although you'll get unpredictable results. mssql does require order_by with an offset, so this fixes problems with that dialect.
|
| | |
|
| |
|
|
| |
[ticket:1140] [ticket:1221]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
thing" in a wider variety of cases. It can now
count multiple-entity queries, as well as
column-based queries. Note that this means if you
say query(A, B).count() without any joining
criterion, it's going to count the cartesian
product of A*B. Any query which is against
column-based entities will automatically issue
"SELECT count(1) FROM (SELECT...)" so that the
real rowcount is returned, meaning a query such as
query(func.count(A.name)).count() will return a value of
one, since that query would return one row.
|
| |
|
|
|
| |
error message when executed against multiple entities.
[ticket:1220]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
multiple aliases of the same class (will add tests in
[ticket:1218])
- Added a new extension sqlalchemy.ext.serializer. Provides
Serializer/Deserializer "classes" which mirror Pickle/Unpickle,
as well as dumps() and loads(). This serializer implements
an "external object" pickler which keeps key context-sensitive
objects, including engines, sessions, metadata, Tables/Columns,
and mappers, outside of the pickle stream, and can later
restore the pickle using any engine/metadata/session provider.
This is used not for pickling regular object instances, which are
pickleable without any special logic, but for pickling expression
objects and full Query objects, such that all mapper/engine/session
dependencies can be restored at unpickle time.
|
| | |
|
| |
|
|
| |
descriptor which would lose the left alias.
|
| |
|
|
|
|
|
|
|
|
|
| |
accurately adapt the expressions generated, which helps
particularly with self-referential comparisons. [ticket:1171]
- Fixed bug involving primaryjoin/secondaryjoin conditions
constructed from class-bound attributes (as often occurs
when using declarative), which later would be inappropriately
aliased by Query, particularly with the various EXISTS
based comparators.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
ON clause, the clause will be aliased in terms of the left
side of the join, allowing scenarios like query(Source).
from_self().join((Dest, Source.id==Dest.source_id)) to work
properly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to an instance will not drop into an EXISTS clause
and will compare foreign key columns instead.
- removed not-really-working use cases of comparing
a collection to an iterable. Use contains() to test
for collection membership.
- Further simplified SELECT compilation and its relationship
to result row processing.
- Direct execution of a union() construct will properly set up
result-row processing. [ticket:1194]
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
alias repaired - the
contains_eager adapter wraps the query adapter, not vice versa. Test coverage added.
- contains_eager() will now add columns into the "primary" column collection within Query._compile_context(), instead
of the "secondary" collection. This allows those columns to get wrapped within the subquery generated
by limit/offset in conjunction with an ORM-generated eager join.
Eager strategy also picks up on context.adapter in this case to deliver the columns during result load.
contains_eager() is now compatible with the subquery generated by a regular eager load
with limit/offset. [ticket:1180]
|
| |
|
|
|
| |
for zero length slices, slices with None on either end.
[ticket:1177]
|
| | |
|
| |
|
|
|
|
|
| |
mapper extension methods to be called as each instance
is updated/inserted, now honors the insert order
of the objects given.
- added some tests, some commented out, involving [ticket:1171]
|
| |
|
|
|
|
|
| |
single scalar value. scalar() takes no arguments and is
roughly equivalent to first()[0], value()
takes a single column expression and is roughly equivalent to
values(expr).next()[0].
|
| |
|
|
|
|
|
|
|
| |
of elements as FROM clauses, allowing them to be used more
effectively in the columns clause of a SELECT.
- and_() and or_() now generate a ColumnElement, allowing
boolean expressions as result columns, i.e.
select([and_(1, 0)]). [ticket:798]
|
| |
|
|
| |
the query issued by GET but does not raise an exception.
|
| | |
|
| |
|
|
| |
- added API docs for Query.update/Query.delete
|