summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
AgeCommit message (Collapse)Author
2017-12-26[2.0.x] Fixed #28944 -- Fixed crash when chaining values()/values_list() ↵Ran Benita
after QuerySet.select_for_update(of=()). Backport of c21f158295d92e35caf96436bfdbbff554fc5569 from master
2017-11-21[2.0.x] Fixed #28817 -- Made QuerySet.iterator() use server-side cursors ↵Dražen Odobašić
after values() and values_list(). Backport of d97f026a7ab5212192426e45121f7a52751a2044 from master
2017-11-12[2.0.x] Fixed #28781 -- Added QuerySet.values()/values_list() support for ↵Mariusz Felisiak
union(), difference(), and intersection(). Thanks Tim Graham for the review. Backport of 2d3cc94284674638c334670903d49565039d77ae from master
2017-10-28[2.0.x] Refs #28010 -- Allowed reverse related fields in SELECT FOR UPDATE ↵Ran Benita
.. OF. Thanks Adam Chidlow for polishing the patch. Backport of 03049fb8d96ccd1f1ed0285486103542de42faba from master
2017-10-06[2.0.x] Refs #24254 -- Removed unnecessary SQL AS clause in ↵Mariusz Felisiak
SQLCompiler.as_sql(). Incorrect on Oracle. Backport of 11ade8eefd32f5bc7ee6379b77824f02ca61c20b from master
2017-09-22Fixed #27332 -- Added FilteredRelation API for conditional join (ON clause) ↵Nicolas Delaby
support. Thanks Anssi Kääriäinen for contributing to the patch.
2017-09-18Fixed #26608 -- Added support for window expressions (OVER clause).Mads Jensen
Thanks Josh Smeaton, Mariusz Felisiak, Sergey Fedoseev, Simon Charettes, Adam Chainz/Johnson and Tim Graham for comments and reviews and Jamie Cockburn for initial patch.
2017-09-15Removed unnecessary check in SQLCompiler.get_related_selections().Tim Graham
2017-09-07Removed unneeded __init__() methods.Sergey Fedoseev
2017-09-02Moved select_sql in SQLCompiler.get_extra_select() to improve performance.Mariusz Felisiak
2017-08-23Refs #28459 -- Improved performance of SQLCompiler.apply_converters().Sergey Fedoseev
2017-08-08Refs #28459 -- Improved performance of sql.compiler.cursor_iter().Sergey Fedoseev
2017-08-07Refs #28459 -- Improved performance of SQLCompiler.results_iter().Sergey Fedoseev
2017-08-01Fixed #28454 -- Simplifed use of Query.setup_joins() by returning a named tuple.Matthew Wilkes
2017-08-01Refs #28370 -- Moved db converters deprecation warning to improve performance.Sergey Fedoseev
2017-07-31Refs #20880 -- Removed non-cloning logic from Query.clone().Anssi Kääriäinen
2017-07-20Fixed #28370 -- Deprecated the context arg of Field.from_db_value() and ↵Tim Graham
Expression.convert_value(). Unused since a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
2017-07-15Fixed #28399 -- Fixed QuerySet.count() for union(), difference(), and ↵Florian Apolloner
intersection() queries.
2017-07-10Fixed #28378 -- Fixed union() and difference() when combining with a ↵Mariusz Felisiak
queryset raising EmptyResultSet. Thanks Jon Dufresne for the report. Thanks Tim Graham and Simon Charette for the reviews.
2017-06-29Fixed #28010 -- Added FOR UPDATE OF support to QuerySet.select_for_update().Ran Benita
2017-06-29Removed obsolete Query.tables attribute.Anssi Kääriäinen
Obsolete since Query.alias_map became an OrderedDict (refs #26522).
2017-06-13Fixed #28293 -- Fixed union(), intersection(), and difference() when ↵Mariusz Felisiak
combining with an EmptyQuerySet. Thanks Jon Dufresne for the report and Tim Graham for the review.
2017-06-01Fixed #27639 -- Added chunk_size parameter to QuerySet.iterator().François Freitag
2017-05-27Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne
iter(dict) is equivalent to iter(dict.keys()).
2017-05-11Fixed #24254 -- Fixed queries using the __in lookup with querysets using ↵Simon Charette
distinct() and order_by(). Thanks Tim for the review.
2017-05-11Fixed #28107 -- Disabled grouping of selected primary keys for unmanaged models.Simon Charette
The grouping caused an issue with database views as PostgreSQL's query planer isn't smart enough to introspect primary keys through views. Django doesn't support database views but documents that unmanaged models should be used to query them. Thanks powderflask for the detailed report and investigation.
2017-04-10Fixed #26788 -- Fixed QuerySet.update() crash when updating a geometry to ↵Sergey Fedoseev
another one.
2017-04-10Used NotSupportedError instead of DatabaseError in SQLCompiler.as_sql().Mariusz Felisiak
2017-04-07Fixed #23147 -- Disabled a limit/offset on a query with select_for_update on ↵Mariusz Felisiak
Oracle. Thanks Shai Berger and Tim Graham for the reviews.
2017-03-29Fixed #25414 -- Fixed QuerySet.annotate() with pk in values() on MySQL.Mariusz Felisiak
Thanks Tim Graham and Simon Charette for the reviews.
2017-02-28Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-25Removed unused variables that are overwritten.Mads Jensen
2017-01-21Refs #23919 -- Removed misc references to Python 2.Tim Graham
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-14Fixed #27718 -- Added QuerySet.union(), intersection(), difference().Florian Apolloner
Thanks Mariusz Felisiak for review and Oracle assistance. Thanks Tim Graham for review and writing docs.
2017-01-14Refs #16614 -- Prevented database errors from being masked by cursor close.François Freitag
When an error occurred during the cursor.execute statement, the cursor is closed. This operation did not fail with client-side cursors. Now, with server-side cursors, the close operation might fail (example below). The original error should be raised, not the one raised by cursor.close(), this is only clean-up code. For example, one can attempt to create a named cursor for an invalid query. psycopg will raise an error about the invalid query and the server-side cursor will not be created on PostgreSQL. When the code attempts to cursor.close(), it asks psycopg to close a cursor that was not created. pyscopg raises a new error: psycopg2.OperationalError: cursor "_django_curs_140365867840512_20" does not exist.
2017-01-11Refs #16614 -- Made QuerySet.iterator() use server-side cursors on PostgreSQL.François Freitag
Thanks to Josh Smeaton for the idea of implementing server-side cursors in PostgreSQL from the iterator method, and Anssi Kääriäinen and Kevin Turner for their previous work. Also Simon Charette and Tim Graham for review.
2016-12-29Removed unused enumerate.Florian Apolloner
2016-12-14Fixed #27594 -- Fixed select_related() with reverse self-referential ↵Daniel Hillier
OneToOneField. Fixed definition of `klass_info['from_parent']` so that two models aren't considered from a parent class if the model classes are the same.
2016-10-28Fixed #20939 -- Simplified query generation by converting QuerySet to Query.Tim Graham
Thanks Anssi Kääriäinen for the initial patch and Anssi, Simon Charette, and Josh Smeaton for review.
2016-10-13Removed unused branch in SQLUpdateCompiler.as_sql().Tim Graham
Unknown if it was ever needed.
2016-10-13Removed unused EmptyResultSets in SQLCompilers.Tim Graham
Unused since ed1bcf05158acf4bf4e0189d477b6c762bd0133e.
2016-10-04Fixed #27193 -- Preserved ordering in select_for_update subqueries.François Freitag
2016-09-27Removed unused branch in SQLCompiler.as_subquery_condition().Tim Graham
Unused since dcdc579d162b750ee3449e34efd772703592faca.
2016-09-09Fixed #27062 -- Eased implementing select_for_update() on MSSQL.Mikhail Denisenko
2016-08-08Fixed #26500 -- Added SKIP LOCKED support to select_for_update().Simon Charette
Thanks Tim for the review.
2016-08-08Moved EmpytResultSet to django.core.exceptions.Johannes Dollinger
This removes the need for some inner imports.
2016-08-08Fixed #26517 -- Fixed ExpressionWrapper with empty queryset.Johannes Dollinger