diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-13 16:54:21 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-13 16:54:21 -0400 |
| commit | 28a349135792a2f8e94fc0892cb612804d3b072c (patch) | |
| tree | da4d0599fd3318445e74f914a1bc0298640a7bcd /doc | |
| parent | 0cea9fd61c59b68dd7e027bec92a67ebbea239fc (diff) | |
| download | sqlalchemy-28a349135792a2f8e94fc0892cb612804d3b072c.tar.gz | |
- Added new option to :func:`.relationship` ``distinct_target_key``.
This enables the subquery eager loader strategy to apply a DISTINCT
to the innermost SELECT subquery, to assist in the case where
duplicate rows are generated by the innermost query which corresponds
to this relationship (there's not yet a general solution to the issue
of dupe rows within subquery eager loading, however, when joins outside
of the innermost subquery produce dupes). When the flag
is set to ``True``, the DISTINCT is rendered unconditionally, and when
it is set to ``None``, DISTINCT is rendered if the innermost relationship
targets columns that do not comprise a full primary key.
The option defaults to False in 0.8 (e.g. off by default in all cases),
None in 0.9 (e.g. automatic by default). Thanks to Alexander Koval
for help with this. [ticket:2836]
Conflicts:
lib/sqlalchemy/orm/relationships.py
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build/changelog/changelog_08.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/build/changelog/changelog_08.rst b/doc/build/changelog/changelog_08.rst index a126bcbeb..f147fcfed 100644 --- a/doc/build/changelog/changelog_08.rst +++ b/doc/build/changelog/changelog_08.rst @@ -11,6 +11,25 @@ :version: 0.8.3 .. change:: + :tags: feature, orm + :tickets: 2836 + :versions: 0.9.0 + + Added new option to :func:`.relationship` ``distinct_target_key``. + This enables the subquery eager loader strategy to apply a DISTINCT + to the innermost SELECT subquery, to assist in the case where + duplicate rows are generated by the innermost query which corresponds + to this relationship (there's not yet a general solution to the issue + of dupe rows within subquery eager loading, however, when joins outside + of the innermost subquery produce dupes). When the flag + is set to ``True``, the DISTINCT is rendered unconditionally, and when + it is set to ``None``, DISTINCT is rendered if the innermost relationship + targets columns that do not comprise a full primary key. + The option defaults to False in 0.8 (e.g. off by default in all cases), + None in 0.9 (e.g. automatic by default). Thanks to Alexander Koval + for help with this. + + .. change:: :tags: bug, mysql :tickets: 2515 :versions: 0.9.0 |
