summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
Commit message (Collapse)AuthorAgeFilesLines
* - 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
| |\ \ \
| | * | | cleanup exception handling - use new exception hierarchy (since python 2.5)pr/140ndparker2014-10-021-3/+1
| | | | |
| | * | | improve exception vs. exit handlingndparker2014-09-232-2/+4
| | | | |
| * | | | - The ON clause rendered when using :meth:`.Query.join`,Mike Bayer2014-10-091-0/+10
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :meth:`.Query.outerjoin`, or the standalone :func:`.orm.join` / :func:`.orm.outerjoin` functions to a single-inheritance subclass will now include the "single table criteria" in the ON clause even if the ON clause is otherwise hand-rolled; it is now added to the criteria using AND, the same way as if joining to a single-table target using relationship or similar. fixes #3222
| * | | - cyclomatic complexity: instrument_class goes from E to an AMike Bayer2014-09-271-11/+37
| | | |
| * | | - add explicit warning re: polymorphic_on, cascading is not supportedMike Bayer2014-09-261-0/+6
| | | | | | | | | | | | | | | | at this time. ref #3214
| * | | - refactor of declarative, break up into indiviudal methodsMike Bayer2014-09-251-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that are now affixed to _MapperConfig - declarative now creates column copies ahead of time so that they are ready to go for a declared_attr - overhaul of declared_attr; memoization, cascading modifier - A relationship set up with :class:`.declared_attr` on a :class:`.AbstractConcreteBase` base class will now be configured on the abstract base mapping automatically, in addition to being set up on descendant concrete classes as usual. fixes #2670 - The :class:`.declared_attr` construct has newly improved behaviors and features in conjunction with declarative. The decorated function will now have access to the final column copies present on the local mixin when invoked, and will also be invoked exactly once for each mapped class, the returned result being memoized. A new modifier :attr:`.declared_attr.cascading` is added as well. fixes #3150 - the original plan for #3150 has been scaled back; by copying mixin columns up front and memoizing, we don't actually need the "map properties later" thing. - full docs + migration notes
| * | | - clarify documentation on exists() that it is preferred to be in theMike Bayer2014-09-241-0/+13
| |/ / | | | | | | | | | WHERE clause. fixes #3212
| * | - Fixed bug that affected generally the same classes of eventMike Bayer2014-09-181-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as that of :ticket:`3199`, when the ``named=True`` parameter would be used. Some events would fail to register, and others would not invoke the event arguments correctly, generally in the case of when an event was "wrapped" for adaption in some other way. The "named" mechanics have been rearranged to not interfere with the argument signature expected by internal wrapper functions. fixes #3197
| * | - Added new method :meth:`.Select.with_statement_hint` and ORMMike Bayer2014-09-181-2/+27
| |/ | | | | | | | | | | method :meth:`.Query.with_statement_hint` to support statement-level hints that are not specific to a table. fixes #3206
* | Merge branch 'master' into ticket_3100Mike Bayer2014-09-159-122/+206
|\ \ | |/
| * - Fixed warning that would emit when a complex self-referentialMike Bayer2014-09-111-4/+4
| | | | | | | | | | | | | | primaryjoin contained functions, while at the same time remote_side was specified; the warning would suggest setting "remote side". It now only emits if remote_side isn't present. fixes #3194
| * - Fixed bug in ordering list where the order of items would beMike Bayer2014-09-101-0/+10
| | | | | | | | | | | | | | | | thrown off during a collection replace event, if the reorder_on_append flag were set to True. The fix ensures that the ordering list only impacts the list that is explicitly associated with the object. fixes #3191
| * - check for None linker...Mike Bayer2014-09-081-1/+1
| |
| * - Added new event handlers :meth:`.AttributeEvents.init_collection`Mike Bayer2014-09-073-20/+79
| | | | | | | | | | | | | | and :meth:`.AttributeEvents.dispose_collection`, which track when a collection is first associated with an instance and when it is replaced. These handlers supersede the :meth:`.collection.linker` annotation. The old hook remains supported through an event adapter.
| * - remove some old cruftMike Bayer2014-09-074-78/+93
| | | | | | | | | | | | - prop.compare() isn't needed; replace with prop._with_parent() for relationships - update docs in orm/interfaces
| * - rework ColumnAdapter and ORMAdapter to only provide the featuresticket_3148Mike Bayer2014-09-071-10/+8
| | | | | | | | | | | | | | | | | | | | | | we're now using; rework them fully so that their behavioral contract is consistent regarding adapter.traverse() vs. adapter.columns[], add a full suite of tests including advanced wrapping scenarios previously only covered by test/orm/test_froms.py and test/orm/inheritance/test_relationships.py - identify several cases where label._order_by_label_clause would be corrupted, e.g. due to adaption or annotation separately - add full tests for #3148