summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
Commit message (Collapse)AuthorAgeFilesLines
* 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
|\ \ \ | |/ /
| * | Small improvement on FlushError can't delete error messagepr/148Paulo Bu2014-11-051-2/+2
| | | | | | | | | | | | Output in the error message the table name and the column name.
| * | - Fixed bug in single table inheritance where a chain of joinsMike Bayer2014-10-231-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that included the same single inh entity more than once (normally this should raise an error) could, in some cases depending on what was being joined "from", implicitly alias the second case of the single inh entity, producing a query that "worked". But as this implicit aliasing is not intended in the case of single table inheritance, it didn't really "work" fully and was very misleading, since it wouldn't always appear. fixes #3233
| * | - Fixed bug where the ON clause for :meth:`.Query.join`,Mike Bayer2014-10-231-2/+5
| | | | | | | | | | | | | | | | | | | | | and :meth:`.Query.outerjoin` to a single-inheritance subclass using ``of_type()`` would not render the "single table criteria" in the ON clause if the ``from_joinpoint=True`` flag were set. fixes #3232
| * | Merge remote-tracking branch 'origin/pr/137' into pr137Mike Bayer2014-10-211-7/+12
| |\ \
| | * | change functionspr/137jona2014-09-161-7/+12
| | | |
| * | | - Fixed bug where :meth:`.Session.expunge` would not fully detachMike Bayer2014-10-192-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the given object if the object had been subject to a delete operation that was flushed, but not committed. This would also affect related operations like :func:`.make_transient`. fixes #3139
| * | | - for #3230, scale back the check to only look at columns thatMike Bayer2014-10-191-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | already have more than one ForeignKeyConstraint referring to them. This limits the check to what we hope is the most common case, but we benefit that the memory and config-time impact is scaled back dramatically.
| * | | - A warning is emitted in the case of multiple relationships thatticket_3230Mike Bayer2014-10-191-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ultimately will populate a foreign key column in conflict with another, where the relationships are attempting to copy values from different source columns. This occurs in the case where composite foreign keys with overlapping columns are mapped to relationships that each refer to a different referenced column. A new documentation section illustrates the example as well as how to overcome the issue by specifying "foreign" columns specifically on a per-relationship basis. fixes #3230
| * | | - The :meth:`.Query.update` method will now convert string keyMike Bayer2014-10-162-13/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | names in the given dictionary of values into mapped attribute names against the mapped class being updated. Previously, string names were taken in directly and passed to the core update statement without any means to resolve against the mapped entity. Support for synonyms and hybrid attributes as the subject attributes of :meth:`.Query.update` are also supported. fixes #3228
| * | | - Improvements to the mechanism used by :class:`.Session` to locateMike Bayer2014-10-141-43/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | "binds" (e.g. engines to use), such engines can be associated with mixin classes, concrete subclasses, as well as a wider variety of table metadata such as joined inheritance tables. fixes #3035
| * | | Merge remote-tracking branch 'origin/pr/140' into pr140Mike Bayer2014-10-112-3/+3
| |\ \ \