summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed more regressions caused by NEVER_SET; comparisonsMike Bayer2015-04-206-25/+48
| | | | | | | | | to transient objects with attributes unset would leak NEVER_SET, and negated_contains_or_equals would do so for any transient object as the comparison used only the committed value. Repaired the NEVER_SET cases, fixes #3371, and also made negated_contains_or_equals() use state_attr_by_column() just like a non-negated comparison, fixes #3374
* - Fixed a critical regression caused by :ticket:`3061` where theMike Bayer2015-04-173-1/+5
| | | | | | | | | | | NEVER_SET symbol could easily leak into a lazyload query, subsequent to the flush of a pending object. This would occur typically for a many-to-one relationship that does not use a simple "get" strategy. The good news is that the fix improves efficiency vs. 0.9, because we can now skip the SELECT statement entirely when we detect NEVER_SET symbols present in the parameters; prior to :ticket:`3061`, we couldn't discern if the None here were set or not. fixes #3368
* - Identified an inconsistency when handling :meth:`.Query.join` to theMike Bayer2015-04-151-1/+7
| | | | | | | | | | | same target more than once; it implicitly dedupes only in the case of a relationship join, and due to :ticket:`3233`, in 1.0 a join to the same table twice behaves differently than 0.9 in that it no longer erroneously aliases. To help document this change, the verbiage regarding :ticket:`3233` in the migration notes has been generalized, and a warning has been added when :meth:`.Query.join` is called against the same target relationship more than once. fixes #3367
* - Made a small improvement to the heuristics of relationship whenMike Bayer2015-04-121-0/+9
| | | | | | | | | determining remote side with semi-self-referential (e.g. two joined inh subclasses referring to each other), non-simple join conditions such that the parententity is taken into account and can reduce the need for using the ``remote()`` annotation; this can restore some cases that might have worked without the annotation prior to 0.9.4 via :ticket:`2948`. fixes #3364
* - changelog + docstring for pullreq github:164Mike Bayer2015-04-031-0/+7
|
* Merge remote-tracking branch 'origin/pr/164' into pr164Mike Bayer2015-04-032-6/+9
|\
| * Allow kwargs to be passed through update()pr/164Amir Sadoughi2015-03-202-6/+9
| | | | | | | | | | This is useful to be able to pass in mysql_limit=1 from using the ORM.
* | - Fixed bug where the state tracking within multiple, nestedMike Bayer2015-04-021-0/+1
| | | | | | | | | | | | | | | | | | :meth:`.Session.begin_nested` operations would fail to propagate the "dirty" flag for an object that had been updated within the inner savepoint, such that if the enclosing savepoint were rolled back, the object would not be part of the state that was expired and therefore reverted to its database state. fixes #3352
* | - :class:`.Query` doesn't support joins, subselects, or specialMike Bayer2015-04-012-26/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FROM clauses when using the :meth:`.Query.update` or :meth:`.Query.delete` methods; instead of silently ignoring these fields if methods like :meth:`.Query.join` or :meth:`.Query.select_from` has been called, an error is raised. In 0.9.10 this only emits a warning. fixes #3349 - don't needlessly call _compile_context() and build up a whole statement that we never need. Construct QueryContext as it's part of the event contract, but don't actually call upon mapper attributes; use more direct systems of determining the update or delete table. - don't realy need _no_select_modifiers anymore
* | - Added a list() call around a weak dictionary used within theMike Bayer2015-04-011-1/+1
| | | | | | | | | | | | commit phase of the session, which without it could cause a "dictionary changed size during iter" error if garbage collection interacted within the process. Change was introduced by
* | - further fixes for #3347; track the mappers we're joiningMike Bayer2015-03-312-22/+53
| | | | | | | | | | between fully and match on those, rather than trying to compare selectables; fixes #3347
* | - Fixed a bug related to "nested" inner join eager loading, whichMike Bayer2015-03-301-22/+70
|/ | | | | | | | | | exists in 0.9 as well but is more of a regression in 1.0 due to :ticket:`3008` which turns on "nested" by default, such that a joined eager load that travels across sibling paths from a common ancestor using innerjoin=True will correctly splice each "innerjoin" sibling into the appropriate part of the join, when a series of inner/outer joins are mixed together. fixes #3347
* Accept unicode in CascadeOptionspr/160Julien Castets2015-03-161-1/+1
|
* - fix a get call here, we should figure this out since we dont wantMike Bayer2015-03-121-1/+1
| | | | to be using getattr
* - Added a new extension suite :mod:`sqlalchemy.ext.baked`. ThisMike Bayer2015-03-116-128/+207
| | | | | | | | 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
* - Added a new entry ``"entity"`` to the dictionaries returned byMike Bayer2015-03-111-2/+8
| | | | | | | | | :attr:`.Query.column_descriptions`. This refers to the primary ORM mapped class or aliased class that is referred to by the expression. Compared to the existing entry for ``"type"``, it will always be a mapped entity, even if extracted from a column expression, or None if the given expression is a pure core expression. references #3320
* - Added a new event suite :class:`.QueryEvents`. TheMike Bayer2015-03-102-5/+63
| | | | | | | | | | | :meth:`.QueryEvents.before_compile` event allows the creation of functions which may place additional modifications to :class:`.Query` objects before the construction of the SELECT statement. It is hoped that this event be made much more useful via the advent of a new inspection system that will allow for detailed modifications to be made against :class:`.Query` objects in an automated fashion. fixes #3317
* - The subquery wrapping which occurs when joined eager loadingMike Bayer2015-03-101-1/+1
| | | | | | | | | is used with a one-to-many query that also features LIMIT, OFFSET, or DISTINCT has been disabled in the case of a one-to-one relationship, that is a one-to-many with :paramref:`.relationship.uselist` set to False. This will produce more efficient queries in these cases. fixes #3249
* - Fixed bug where the session attachment error "object is alreadyMike Bayer2015-03-101-7/+7
| | | | | | | attached to session X" would fail to prevent the object from also being attached to the new session, in the case that execution continued after the error raise occurred. fixes #3301
* - copyright 2015Mike Bayer2015-03-1029-29/+29
|
* - pick around gaining modest dings in callcounts here and thereMike Bayer2015-03-091-15/+17
|
* - random performance whacking vs. 0.9, in particular we have to watchMike Bayer2015-03-082-1/+7
| | | | for the slots-based __getattr__ thing getting hit
* minor docstring fix in MappedCollection classJochem Oosterveen2015-03-061-2/+2
|
* - squash-merge the final row_proc integration branch. this isMike Bayer2015-03-017-88/+152
| | | | | | | | | | | | | | | a much more modest outcome than what we started with. The work of create_row_processor() for ColumnProperty objects is essentially done at query setup time combined with some lookups in _instance_processor(). - to allow this change for deferred columns, deferred columns no longer search for themselves in the result. If they've been set up as deferred without any explicit directive to undefer them, then this is what was asked for. if we don't do this, then we're stuck with this performance penalty for all deferred columns which in the vast majority of typical use cases (e.g. loading large, legacy tables or tables with many/large very seldom used values) won't be present in the result and won't be accessed at all.
* - Fixed bugs in ORM object comparisons where comparison ofMike Bayer2015-02-201-3/+4
| | | | | | | | | | many-to-one ``!= None`` would fail if the source were an aliased class, or if the query needed to apply special aliasing to the expression due to aliased joins or polymorphic querying; also fixed bug in the case where comparing a many-to-one to an object state would fail if the query needed to apply special aliasing due to aliased joins or polymorphic querying. fixes #3310
* - remove the need for a recursive call hereMike Bayer2015-02-201-5/+12
|
* - Fixed bug where internal assertion would fail in the case whereMike Bayer2015-02-201-2/+5
| | | | | | | | an ``after_rollback()`` handler for a :class:`.Session` incorrectly adds state to that :class:`.Session` within the handler, and the task to warn and remove this state (established by :ticket:`2389`) attempts to proceed. fixes #3309
* - Mapped state internals have been reworked to allow for a 50% reductionMike Bayer2015-02-187-77/+149
| | | | | | | | in callcounts specific to the "expiration" of objects, as in the "auto expire" feature of :meth:`.Session.commit` and for :meth:`.Session.expire_all`, as well as in the "cleanup" step which occurs when object states are garbage collected. fixes #3307
* - remove meaningless assignmentMike Bayer2015-02-081-1/+0
|
* - test + changelogMike Bayer2015-02-081-2/+2
|
* Merge remote-tracking branch 'origin/pr/147' into pr147Mike Bayer2015-02-081-1/+1
|\ | | | | | | | | Conflicts: lib/sqlalchemy/orm/query.py
| * It's the 'kwargs' which are iterable, not 'keys'pr/147Malthe Borch2014-10-301-2/+1
| |
* | - A warning is emitted if the ``isolation_level`` parameter is usedMike Bayer2015-02-041-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with :meth:`.Connection.execution_options` when a :class:`.Transaction` is in play; DBAPIs and/or SQLAlchemy dialects such as psycopg2, MySQLdb may implicitly rollback or commit the transaction, or not change the setting til next transaction, so this is never safe. - Added new parameter :paramref:`.Session.connection.execution_options` which may be used to set up execution options on a :class:`.Connection` when it is first checked out, before the transaction has begun. This is used to set up options such as isolation level on the connection before the transaction starts. - added new documentation section detailing best practices for setting transaction isolation with sessions. fixes #3296
* | - Fixed bug in lazy loading SQL construction whereby a complexMike Bayer2015-02-021-14/+18
| | | | | | | | | | | | | | | | primaryjoin that referred to the same "local" column multiple times in the "column that points to itself" style of self-referential join would not be substituted in all cases. The logic to determine substitutions here has been reworked to be more open-ended. fixes #3300
* | - don't overwrite an existing _strategy_keys collection;Mike Bayer2015-02-021-1/+2
| | | | | | | | this would cause LazyLoader to be initialized twice per property.
* | Merge branch 'bb_issue_3262' of https://bitbucket.org/xflr6/sqlalchemyMike Bayer2015-01-261-0/+9
|\ \
| * | warn on duplicate polymorphic_identitySebastian Bank2014-12-041-0/+9
| | |
* | | - restore r611883ffb35ca6664649f6328ae8 with additional fixes and an ↵Mike Bayer2015-01-192-17/+38
| | | | | | | | | | | | | | | | | | additional test that is much more specific to #1326
* | | - reverse the last commit temporarily as it breaks all the polymorphic casesMike Bayer2015-01-192-42/+24
| | |
* | | - The primary :class:`.Mapper` of a :class:`.Query` is now passed to theMike Bayer2015-01-192-24/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :meth:`.Session.get_bind` method when calling upon :meth:`.Query.count`, :meth:`.Query.update`, :meth:`.Query.delete`, as well as queries against mapped columns, :obj:`.column_property` objects, and SQL functions and expressions derived from mapped columns. This allows sessions that rely upon either customized :meth:`.Session.get_bind` schemes or "bound" metadata to work in all relevant cases. fixes #3227 fixes #3242 fixes #1326
* | | - further fixes and even better tests for this blockMike Bayer2015-01-191-3/+8
| | |
* | | - another adjustmentMike Bayer2015-01-191-2/+3
| | |
* | | - fix another issue from rf49c367ef, add another testMike Bayer2015-01-181-1/+1
| | |
* | | - fix a regression from ref #3178, where dialects that don't actually supportMike Bayer2015-01-171-4/+12
| | | | | | | | | | | | | | | sane multi rowcount (e.g. pyodbc) would fail on multirow update. add a test that mocks this breakage into plain dialects
* | | - The "wildcard" loader options, in particular the one set up byMike Bayer2015-01-134-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the :func:`.orm.load_only` option to cover all attributes not explicitly mentioned, now takes into account the superclasses of a given entity, if that entity is mapped with inheritance mapping, so that attribute names within the superclasses are also omitted from the load. Additionally, the polymorphic discriminator column is unconditionally included in the list, just in the same way that primary key columns are, so that even with load_only() set up, polymorphic loading of subtypes continues to function correctly. fixes #3287
* | | - doc fixesMike Bayer2015-01-062-12/+14
| | |
* | | - Fixed bug where if an exception were thrown at the start of aMike Bayer2015-01-051-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :class:`.Query` before it fetched results, particularly when row processors can't be formed, the cursor would stay open with results pending and not actually be closed. This is typically only an issue on an interpreter like Pypy where the cursor isn't immediately GC'ed, and can in some circumstances lead to transactions/ locks being open longer than is desirable. fixes #3285
* | | - add MemoizedSlots, a generalized solution to using __getattr__Mike Bayer2015-01-057-19/+76
| | | | | | | | | | | | | | | for memoization on a class that uses slots. - apply many more __slots__. mem use for nova now at 46% savings
* | | - callcountsMike Bayer2015-01-041-2/+0
| | | | | | | | | | | | - this needs to be serializable and isn't high volume so just whack the slots
* | | - strategies + declarativeMike Bayer2015-01-042-0/+25
| | |