summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
Commit message (Collapse)AuthorAgeFilesLines
* - 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
| | |
* | | - wip - start factoring events so that we aren't using descriptors for dispatch,Mike Bayer2015-01-042-3/+4
| | | | | | | | | | | | allowing us to move to __slots__
* | | - start trying to move things into __slots__. This seems to reduce theslotsMike Bayer2015-01-044-37/+68
| | | | | | | | | | | | | | | size of the many per-column objects we're hitting, but somehow the overall memory is hardly being reduced at all in initial testing
* | | - tighten the inspection in _ColumnEntity to reduce unnecessaryMike Bayer2015-01-031-14/+14
| | | | | | | | | | | | isinstance() calls, express intent more clearly
* | | - fix links for loading, add a redirect pageMike Bayer2014-12-272-3/+3
| | | | | | | | | | | | | | | | | | bump foo
* | | - correctionsMike Bayer2014-12-271-2/+2
| | | | | | | | | | | | - attempt to add a script to semi-automate the fixing of links
* | | Maul the evaulate & friends typoPriit Laes2014-12-191-2/+2
| | |
* | | - Added new method :meth:`.Session.invalidate`, functions similarlyMike Bayer2014-12-121-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to :meth:`.Session.close`, except also calls :meth:`.Connection.invalidate` on all connections, guaranteeing that they will not be returned to the connection pool. This is useful in situations e.g. dealing with gevent timeouts when it is not safe to use the connection further, even for rollbacks. references #3258
* | | - fix up query update /delete documentation, make warningsMike Bayer2014-12-101-69/+110
| | | | | | | | | | | | a lot clearer, partial fixes for #3252
* | | - A new series of :class:`.Session` methods which provide hooksMike Bayer2014-12-081-22/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directly into the unit of work's facility for emitting INSERT and UPDATE statements has been created. When used correctly, this expert-oriented system can allow ORM-mappings to be used to generate bulk insert and update statements batched into executemany groups, allowing the statements to proceed at speeds that rival direct use of the Core. fixes #3100
* | | - add an option for bulk_save -> update to not do historyMike Bayer2014-12-072-13/+28
| | |
* | | - fix inheritance persistenceMike Bayer2014-12-073-6/+184
| | | | | | | | | | | | - start writing docs
* | | - initial tests for bulkMike Bayer2014-12-071-1/+2
| | |
* | | Merge branch 'master' into ticket_3100Mike Bayer2014-12-076-10/+81
|\ \ \
| * | | - Added support for CTEs under Oracle. This includes some tweaksMike Bayer2014-12-041-1/+29
| |/ / | | | | | | | | | | | | | | | | | | to the aliasing syntax, as well as a new CTE feature :meth:`.CTE.suffix_with`, which is useful for adding in special Oracle-specific directives to the CTE. fixes #3220
| * | - changelog, improve docstring/test for #3217. fixes #3217Mike Bayer2014-11-261-1/+7
| | |
| * | Merge branch 'issue_bb_3217' of ↵Mike Bayer2014-11-261-4/+7
| |\ \ | | | | | | | | | | | | https://bitbucket.org/jvanasco/sqlalchemy-alt into pr32
| | * | * adding 'isouter=False' to sqlalchemy.orm.query.Query ↵jonathan vanasco2014-10-031-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://bitbucket.org/zzzeek/sqlalchemy/issue/3217/make-join-more-standard-or-improve-error) $ python setup.py develop $ pip install nose $ pip install mock $ ./sqla_nose.py test.orm.test_joins ..................................................................................................... ---------------------------------------------------------------------- Ran 101 tests in 1.222s OK $ ./sqla_nose.py test.orm ......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S......................................................................................................................................................................................................................................................................................................................S.......................................................................................................................................................................................................................................................................................................................................................S.......S..S.SSS.SS...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S................................S..S........................S...........................................................................................SSS.S.........SSSSSSSS......SSSSSSSSS........SS...SS...............S.............................S..............................................................SS..SS..............................................................................................................S. ---------------------------------------------------------------------- Ran 3103 tests in 82.607s OK (SKIP=46)
| * | | - The :meth:`.PropComparator.of_type` modifier has beenMike Bayer2014-11-242-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | improved in conjunction with loader directives such as :func:`.joinedload` and :func:`.contains_eager` such that if two :meth:`.PropComparator.of_type` modifiers of the same base type/path are encountered, they will be joined together into a single "polymorphic" entity, rather than replacing the entity of type A with the one of type B. E.g. a joinedload of ``A.b.of_type(BSub1)->BSub1.c`` combined with joinedload of ``A.b.of_type(BSub2)->BSub2.c`` will create a single joinedload of ``A.b.of_type((BSub1, BSub2)) -> BSub1.c, BSub2.c``, without the need for the ``with_polymorphic`` to be explicit in the query. fixes #3256
| * | | - add some logging to path_registry to help debug eager loadingMike Bayer2014-11-242-0/+13
| | | | | | | | | | | | | | | | issues
| * | | - Fixed a leak which would occur in the unsupported and highlyMike Bayer2014-11-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-recommended use case of replacing a relationship on a fixed mapped class many times, referring to an arbitrarily growing number of target mappers. A warning is emitted when the old relationship is replaced, however if the mapping were already used for querying, the old relationship would still be referenced within some registries. fixes #3251
| * | | - don't do inline string interpolation when loggingJon Nelson2014-11-111-1/+1
| | | |
* | | | Merge branch 'master' into ticket_3100Mike Bayer2014-11-061-4/+4
|\ \ \ \ | |/ / / | | | | | | | | | | | | Conflicts: lib/sqlalchemy/orm/persistence.py
| * | | Small improvement on FlushError can't update error messagepr/149Paulo Bu2014-11-061-4/+4
| | | | | | | | | | | | | | | | Output in the error message the table name and the column name.
* | | | Merge branch 'master' into ticket_3100Mike Bayer2014-11-069-103/+314
|\ \ \ \ | |/ / /