summaryrefslogtreecommitdiff
path: root/django/db/backends/base/operations.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #16055 -- Fixed crash when filtering against char/text GenericRelation ↵David Wobrock2023-04-181-0/+7
| | | | relation on PostgreSQL.
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-011-0/+1
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Fixed #33308 -- Added support for psycopg version 3.Daniele Varrazzo2022-12-151-0/+3
| | | | | | | Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews. Co-authored-by: Florian Apolloner <florian@apolloner.eu> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Refs #33308 -- Used get_db_prep_value() to adapt JSONFields.Simon Charette2022-11-151-0/+4
|
* Refs CVE-2022-34265 -- Properly escaped Extract() and Trunc() parameters.Simon Charette2022-07-061-12/+9
| | | | Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed CVE-2022-34265 -- Protected Trunc(kind)/Extract(lookup_name) against ↵Mariusz Felisiak2022-07-041-0/+3
| | | | | | SQL injection. Thanks Takuto Yoshikai (Aeye Security Lab) for the report.
* Expanded QuerySet.explain() error message if a backend supports no formats.Tim Graham2022-04-141-0/+4
|
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-8/+13
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-82/+119
|
* Fixed #31685 -- Added support for updating conflicts to QuerySet.bulk_create().sean_c_hsu2022-01-191-2/+2
| | | | | Thanks Florian Apolloner, Chris Jerdonek, Hannes Ljungberg, Nick Pope, and Mariusz Felisiak for reviews.
* Fixed #33340 -- Fixed unquoted column names in queries used by DatabaseCache.Arsa2021-12-091-1/+2
|
* Fixed #33229 -- Fixed ↵SwastikTripathi2021-11-191-0/+8
| | | | BaseDatabaseOperations.adapt_datetimefield_value()/adapt_timefield_value() crash with expressions.
* Fixed #33214 -- Added ↵Manaia Junior2021-10-221-0/+6
| | | | BaseDatabaseOperations.format_for_duration_arithmetic() stub method.
* Fixed #32573 -- Fixed bounds in __iso_year lookup optimization.Florian Demmer2021-03-231-6/+22
|
* Fixed #31640 -- Made Trunc() truncate datetimes to Date/TimeField in a ↵David-Wobrock2020-10-141-6/+12
| | | | specific timezone.
* Fixed #32060 -- Added Random database function.Nick Pope2020-10-021-4/+0
|
* Fixed #31956 -- Fixed crash of ordering by JSONField with a custom decoder ↵Mariusz Felisiak2020-08-281-7/+0
| | | | | | | on PostgreSQL. Thanks Marc Debureaux for the report. Thanks Simon Charette, Nick Pope, and Adam Johnson for reviews.
* Fixed #28925 -- Fixed durations-only expressions crash on SQLite and MySQL.Sergey Fedoseev2020-06-301-6/+0
| | | | This removes also unused DatabaseOperations.date_interval_sql().
* Fixed #30375 -- Added FOR NO KEY UPDATE support to ↵Manuel Weitzman2020-05-211-2/+3
| | | | QuerySet.select_for_update() on PostgreSQL.
* Fixed #12990, Refs #27694 -- Added JSONField model field.sage2020-05-081-0/+7
| | | | | | | | | | | Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael Michel for mentoring this Google Summer of Code 2019 project and everyone else who helped with the patch. Special thanks to Mads Jensen, Nick Pope, and Simon Charette for extensive reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed a/an typos in "SQL" usage.Adam Johnson2020-05-061-1/+1
|
* Fixed #31477 -- Removed "using" argument from ↵Jon Dufresne2020-04-201-2/+5
| | | | DatabaseOperations.execute_sql_flush().
* Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on ↵Jon Dufresne2020-04-171-3/+5
| | | | | | | | | | | | PostgreSQL. The sql_flush() positional argument sequences is replaced by the boolean keyword-only argument reset_sequences. This ensures that the old function signature can't be used by mistake when upgrading Django. When the new argument is True, the sequences of the truncated tables will reset. Using a single boolean value, rather than a list, allows making a binary yes/no choice as to whether to reset all sequences rather than a working on a completely different set.
* Fixed #31183 -- Added a feature flag for "<db> only supports UNBOUNDED ↵Tim Graham2020-01-201-1/+10
| | | | together with PRECEDING and FOLLOWING".
* Fixed #31133 -- Fixed crash when subtracting against a subquery annotation.Simon Charette2020-01-031-1/+1
| | | | | | | | | The subtract_temporals() database operation was not handling expressions returning SQL params in mixed database types. Regression in 35431298226165986ad07e91f9d3aca721ff38ec. Thanks Reupen Shah for the report.
* Fixed #30987 -- Added models.PositiveBigIntegerField.Caio Ariede2019-11-191-0/+1
|
* Fixed #29444 -- Allowed returning multiple fields from INSERT statements on ↵Johannes Hoppe2019-09-241-1/+1
| | | | Oracle.
* Refs #29444 -- Allowed returning multiple fields from INSERT statements on ↵Johannes Hoppe2019-09-091-9/+7
| | | | | | | PostgreSQL. Thanks Florian Apolloner, Tim Graham, Simon Charette, Nick Pope, and Mariusz Felisiak for reviews.
* Fixed #25367 -- Allowed boolean expressions in QuerySet.filter() and exclude().Matthew Schinckel2019-08-291-0/+7
| | | | | | | | | | | This allows using expressions that have an output_field that is a BooleanField to be used directly in a queryset filters, or in the When() clauses of a Case() expression. Thanks Josh Smeaton, Tim Graham, Simon Charette, Mariusz Felisiak, and Adam Johnson for reviews. Co-Authored-By: NyanKiyoshi <hello@vanille.bid>
* Fixed #29979, Refs #17337 -- Extracted AutoField field logic into a mixin ↵Nick Pope2019-08-201-0/+3
| | | | | | | | | | | and refactored AutoFields. This reduces duplication by allowing AutoField, BigAutoField and SmallAutoField to inherit from IntegerField, BigIntegerField and SmallIntegerField respectively. Doing so also allows for enabling the max_length warning check and minimum/maximum value validation for auto fields, as well as providing a mixin that can be used for other possible future auto field types such as a theoretical UUIDAutoField.
* Refs #29444 -- Added support for fetching a returned non-integer insert ↵Johannes Hoppe2019-07-081-1/+1
| | | | | | | values on Oracle. This is currently not actively used, since the ORM will ask the SQL compiler to only return auto fields.
* Fixed typos in docs, comments, and exception messages.Ville Skyttä2019-04-181-1/+1
|
* Fixed #30242 -- Removed extra space before LIMIT/OFFSET SQL.Hang Park2019-03-091-4/+4
|
* Refs #27753 -- Favored force/smart_str() over force/smart_text().Aymeric Augustin2019-02-061-2/+2
|
* Fixed #29934 -- Added sqlparse as a require dependency.Tim Graham2018-11-091-11/+6
|
* Fixed #28668 -- Allowed QuerySet.bulk_create() to ignore insert conflicts.Tom2018-08-031-0/+6
|
* Fixed #28574 -- Added QuerySet.explain().Tom2018-04-191-0/+18
|
* Fixed #24747 -- Allowed transforms in QuerySet.order_by() and distinct(*fields).Matthew Wilkes2018-02-101-2/+2
|
* Refs #28459 -- Improved performance of loading DurationField on SQLite and ↵Sergey Fedoseev2017-12-271-4/+1
| | | | MySQL.
* Clarified error message for when sqlplarse isn't installed.Nick2017-11-031-1/+1
|
* Fixed #28665 -- Change some database exceptions to NotImplementedError per ↵Simon Charette2017-10-061-1/+1
| | | | PEP 249.
* Refs #28670 -- Moved LIMIT/OFFSET SQL to DatabaseOperations.limit_offset_sql().Mariusz Felisiak2017-10-041-0/+16
| | | Thanks Tim Graham for the review.
* Corrected typos in BaseDatabaseOperations exception messages.Mads Jensen2017-09-301-2/+5
|
* Used NotSupportedError for some unsupported database opreations per PEP 249.Mads Jensen2017-09-291-2/+2
|
* Fixed #26608 -- Added support for window expressions (OVER clause).Mads Jensen2017-09-181-1/+39
| | | | | 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.
* Fixed #28371 -- Fixed Cast() with CharField if the max_length argument isn't ↵Mariusz Felisiak2017-07-271-0/+2
| | | | | provided. Thanks Tim Graham for the review.
* Allowed database backends to specify data types for Cast().Mariusz Felisiak2017-07-261-0/+4
| | | A small refactor ahead of refs #28371.
* Fixed #28370 -- Deprecated the context arg of Field.from_db_value() and ↵Tim Graham2017-07-201-1/+1
| | | | | | Expression.convert_value(). Unused since a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
* Fixed #14204 -- Enforced SQLite foreign key constraints.Claude Paroz2017-07-111-0/+8
| | | | | Thanks Tim Graham for contributing to the patch and Simon Charette for advice and review.
* Fixed #28010 -- Added FOR UPDATE OF support to QuerySet.select_for_update().Ran Benita2017-06-291-7/+6
|