| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Column and MapperProperty objects keep a state
variable indicating their creation order, which
declarative_base() maintains when generating
Table constructs.
|
| |
|
|
| |
maintenance branch
|
| |
|
|
|
|
| |
setitem w/ slice) weren't possible in 0.3 and/or I spaced these.
Improved messaging on flubbed stepped slice assignment in collection decorators.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
by select().scalar() which returns a _ScalarSelect object, that obeys
the ColumnElement interface fully
- removed _selectable() method. replaced with __selectable__() as an optional
duck-typer; subclassing Selectable (without any __selectable__()) is equivalent
- query._col_aggregate() was assuming bound metadata. ick !
- probably should deprecate ClauseElement.scalar(), in favor of ClauseElement.execute().scalar()...
otherwise might need to rename select().scalar()
|
| | |
|
| | |
|
| |
|
|
| |
Fixed comparison of _UnaryExpressions
|
| | |
|
| | |
|
| |
|
|
|
|
| |
- merges "bind" argument change
- merges join fixes for [ticket:185]
- removed all "engine"/"connectable"/"bind_to"/"engine_or_url" arguments/attributes
|
| |
|
|
| |
- removed BoundMetaData, use MetaData instead
|
| | |
|
| |
|
|
|
|
|
| |
- any NullType will trigger the "get col type from FK logic", though
there are other issues with this logic (requires the FK be initialized)
- added INT to sqlite resolution map
- adjusted sqlsoup for sql.Select api changes
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a proxy-free, decorator-based approach for user-space instrumentation and
a "view" adapter for interaction with the user's collection within the orm.
Fixes [ticket:213], [ticket:548], [ticket:563].
- This needs many more unit tests. There is significant indirect coverage
through association proxy, but direct tests are needed, specifically in
the decorators and add/remove event firing.
- Collections are now instrumented via decorations rather than
proxying. You can now have collections that manage their own
membership, and your class instance will be directly exposed on the
relation property. The changes are transparent for most users.
- InstrumentedList (as it was) is removed, and relation properties no
longer have 'clear()', '.data', or any other added methods beyond those
provided by the collection type. You are free, of course, to add them
to a custom class.
- __setitem__-like assignments now fire remove events for the existing
value, if any.
- dict-likes used as collection classes no longer need to change __iter__
semantics- itervalues() is used by default instead. This is a backwards
incompatible change.
- subclassing dict for a mapped collection is no longer needed in most cases.
orm.collections provides canned implementations that key objects by a
specified column or a custom function of your choice.
- collection assignment now requires a compatible type- assigning None
to clear a collection or assinging a list to a dict collection will now
raise an argument error.
- AttributeExtension moved to interfaces, and .delete is now .remove
The event method signature has also been swapped around.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- copy_container() removed. ClauseVisitor.traverse() now features "clone"
flag which allows traversal with copy-and-modify-in-place behavior
- select() objects copyable now [ticket:52] [ticket:569]
- improved support for custom column_property() attributes which
feature correlated subqueries...work better with eager loading now.
- accept_visitor() methods removed. ClauseVisitor now genererates method
names based on class names, or an optional __visit_name__ attribute. calls
regular visit_XXX methods as they exist, can optionally call an additional
"pre-descent" enter_XXX method to allow stack-based operations on traversals
- select() and union()'s now have "generative" behavior. methods like
order_by() and group_by() return a *new* instance - the original instance
is left unchanged. non-generative methods remain as well.
- the internals of select/union vastly simplified - all decision making
regarding "is subquery" and "correlation" pushed to SQL generation phase.
select() elements are now *never* mutated by their enclosing containers
or by any dialect's compilation process
|
| | |
|
| |
|
|
| |
- removed "clear_mapper()" method
|
| |
|
|
|
| |
- fixes to is_select() which is now an important method
- mysql unit tests fixes
|
| | |
|
| |
|
|
|
|
|
| |
- got all tests/extensions working with new APIs
- axed proxyengine until further notice
- SelectResults folds into a 10 line wrapper for Query, loses join_to() (use join())
- test cleanup
|
| |
|
|
|
| |
- query.join() resets the joinpoint
- added filter(), filter_by() to assignmapper
|
| |
|
|
|
|
|
| |
- removed sqlalchemy.orm from sqlalchemy.__init__ namespace. still
needs updates in documentation, tutorial pages
- moved MapperExtension to interfaces package
- moved ExtensionCarrier to orm.util
|
| |
|
|
|
|
|
|
|
| |
that the mappers all get compiled when an instance of a mapped class is first constructed.
the SessionContextExt extension gets all the "add object to the session" logic now and the
_sa_session and _sa_entity_name arguments only apply to when the SessionContextExt is in use.
Some extra methods to MapperExtension to support __init__ decoration.
- assignmapper loses "join_to", gains "join". id like to replace all those methods with just "query"
but i think they are too popular, so it should probably get filter(), filter_by() also.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
list, dict and set-based relation collections (and scalar relations). Extensive tests.
- Added util.duck_type_collection
|
| |
|
|
| |
an object attribute with that object's position in the list
|
| |
|
|
| |
select().
|
| | |
|
| | |
|
| |
|
|
| |
#551
|
| |
|
|
| |
objects can be associated with a single association collection.
|
| |
|
|
|
|
|
|
|
|
|
| |
deterministic names now, based on their ordering within the
full statement being compiled. this means the same statement
will produce the same string across application restarts and
allowing DB query plan caching to work better.
- cleanup to sql.ClauseParameters since it was just falling
apart, API made more explicit
- many unit test tweaks to adjust for bind params not being
"pre" truncated, changes to ClauseParameters
|
| |
|
|
| |
restructuredtext fixes throughout docstrings
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
into a new set of methods available off of Query. These methods
all provide "generative" behavior, whereby the Query is copied
and a new one returned with additional criterion added.
The new methods include:
filter() - applies select criterion to the query
filter_by() - applies "by"-style criterion to the query
avg() - return the avg() function on the given column
join() - join to a property (or across a list of properties)
outerjoin() - like join() but uses LEFT OUTER JOIN
limit()/offset() - apply LIMIT/OFFSET
range-based access which applies limit/offset:
session.query(Foo)[3:5]
distinct() - apply DISTINCT
list() - evaluate the criterion and return results
no incompatible changes have been made to Query's API and no methods
have been deprecated. Existing methods like select(), select_by(),
get(), get_by() all execute the query at once and return results
like they always did. join_to()/join_via() are still there although
the generative join()/outerjoin() methods are easier to use.
- the return value for multiple mappers used with instances() now returns
a cartesian product of the requested list of mappers, represented
as a list of tuples. this corresponds to the documented behavior.
So that instances match up properly, the "uniquing" is disabled when
this feature is used.
- strings and columns can also be sent to the *args of instances() where
those exact result columns will be part of the result tuples.
- query() method is added by assignmapper. this helps with
navigating to all the new generative methods on Query.
|
| |
|
|
| |
like the rest of the SelectResults methods [ticket:472]
|
| |
|
|
|
|
| |
straight <pre> + trim() func
for now. applies most of [ticket:214], compliemnts of Lele Gaifax
|
| | |
|
| |
|
|
| |
[ticket:472]
|
| |
|
|
|
|
|
| |
- PropertyLoader figures out accurate remote_side collection based
on foreign_keys, legacy foreignkey, primary/secondaryjoin/polymorphic
- reworked lazyloader, sync to work straight off foreign_keys/
remote_side collections
|
| |
|
|
|
|
| |
options to
Table objects [ticket:462]
|
| |
|
|
|
|
| |
difference
when using count().
|
| |
|
|
| |
with None (see [ticket:457])
|
| |
|
|
|
|
|
|
|
|
| |
non-polymorphic local table.
lazy load clause evaluation is plenty solid enough to handle it this time.
- the join_to() method on PropertyLoader takes the parent mapper as an argument and alisiazes
the primaryjoin against that mapper's selectable, so that the same primary join can be used against
the base mapper, any inheriting mapper, etc., whether or not it uses a polymorphic union (although
needs to be tested against alternate polymorphic unions added on subclasses). fixes [ticket:448]
|
| |
|
|
|
| |
as a much trickier thing to clean out. added a unit test so that if any new collections get introduced
we are still testing.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
further on that branch and introduce the foreign_keys argument, and further centralize the "intelligence" about the joins and selectables into PropertyLoader so that lazyloader/sync can be simplified, but the current branch goes pretty far.
- relations keep track of "polymorphic_primaryjoin", "polymorphic_secondaryjoin" which it derives from the plain primaryjoin/secondaryjoin.
- lazy/eagerloaders work from those polymorphic join objects.
- the join exported by PropertyLoader to Query/SelectResults is the polymorphic join, so that join_to/etc work properly.
- Query builds itself against the base Mapper again, not the "polymorphic" mapper. uses the "polymorphic" version
only as appropriate. this helps join_by/join_to/etc to work with polymorphic mappers.
- Query will also adapt incoming WHERE criterion to the polymorphic mapper, i.e. the "people" table becomes the "person_join" automatically.
- quoting has been modified since labels made out of non-case-sensitive columns could themselves require quoting..so case_sensitive defaults to True if not otherwise specified (used to be based on the identifier itself).
- the test harness gets an ORMTest base class and a bunch of the ORM unit tests are using it now, decreases a lot of redundancy.
|