summaryrefslogtreecommitdiff
path: root/django/db/models/functions
AgeCommit message (Collapse)Author
2026-03-16Fixed #36906 -- Handled coalescing JSON-primitive strings and JSON values on ↵Kanin Kearpimy
Oracle.
2026-02-28Added DatabaseOperations.convert_trunc_expression() hook.Tim Graham
Needed on MongoDB.
2025-12-12Refs #36735 -- Supported shift parameter for UUID7 on PostgreSQL.Lily Acorn
2025-12-12Fixed #36735 -- Added UUID4 and UUID7 database functions.Lily Acorn
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2025-08-04Fixed #35972 -- Fixed lookup crashes after subquery annotations.Jacob Walls
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-05-27Removed unreachable check for None in TruncBase.convert_value().Tim Graham
2025-01-06Fixed #35718 -- Add JSONArray to django.db.models.functions.John Parton
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-12-16Refs #35718, Refs #32179 -- Moved JSONObject to django.db.models.functions.json.Sage Abdullah
2024-11-06Fixed #35778 -- Used JSON_OBJECT database function on PostgreSQL 16+ with ↵John Parton
server-side bindings.
2024-11-06Removed definition of JSONObject ArgJoiner class in as_native function.Sarah Boyce
2024-09-26Fixed #35734 -- Used JSONB_BUILD_OBJECT database function on PostgreSQL when ↵John Parton
using server-side bindings. Regression in 81ccf92f154c6d9eac3e30bac0aa67574d0ace15.
2024-09-11Fixed #35732 -- Wrapped ConcatPair expression in parentheses to ensure ↵Gastón Avila
operator precedence. When ConcatPair was updated to use || this lost the implicit wrapping from CONCAT(...). This broke the WHERE clauses when used in combination with PostgreSQL trigram similarity. Regression in 6364b6ee1071381eb3a23ba6b821fc0d6f0fce75. Co-authored-by: Emiliano Cuenca <106986074+emicuencac@users.noreply.github.com>
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2024-01-01Updated DatabaseFeatures.bare_select_suffix on Oracle 23c.Nick Pope
https://docs.oracle.com/en/database/oracle/oracle-database/23/nfcoa/application-development.html#GUID-4EB70EB9-4EE3-4FE2-99C4-86F7AAC60F12
2024-01-01Supported native aggregation over INTERVALs on Oracle 23c.Nick Pope
https://docs.oracle.com/en/database/oracle/oracle-database/23/nfcoa/application-development.html#GUID-CE5F8EED-934D-458D-B81C-6C8D617F31A2
2023-12-31Used JSON_OBJECT database function on PostgreSQL 16+.Nick Pope
2023-11-14Fixed #34955 -- Made Concat() use || operator on PostgreSQL.Simon Charette
This also avoids casting string based expressions in Concat() on PostgreSQL.
2023-08-02Removed unneeded escapes in regexes.Mariusz Felisiak
Special characters lose their special meaning inside sets of characters. "-" lose its special meaning if it's placed as the first or last character. Follow up to 7c6b66383da5f9a67142334cd2ed2d769739e8f1.
2023-07-30Fixed warnings per flake8 6.1.0.Mariusz Felisiak
2023-05-31Fixed #34606 -- Fixed Right() function with zero length on Oracle and SQLite.Kacper Wolkiewicz
2023-05-12Fixed #470 -- Added support for database defaults on fields.Ian Foote
Special thanks to Hannes Ljungberg for finding multiple implementation gaps. Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for reviews.
2023-05-11Fixed #34558 -- Fixed QuerySet.bulk_create() crash with Now() on Oracle.Mariusz Felisiak
2023-05-10Fixed #34554 -- Fixed Reverse(Value(…)) crash on Oracle.Mariusz Felisiak
2023-04-11Fixed #34480 -- Fixed crash of annotations with Chr().Jacob Walls
2023-01-17Refs #32365 -- Removed is_dst argument for various methods and functions.Mariusz Felisiak
Per deprecation timeline.
2023-01-09Refs #30240 -- Fixed argument name for MySQLSHA2Mixin.as_mysql() and ↵Marti Raudsepp
PostgreSQLSHAMixin.as_postgresql() methods.
2022-12-15Fixed #33308 -- Added support for psycopg version 3.Daniele Varrazzo
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>
2022-10-24Refs #34070 -- Fixed date format in Now() on SQLite.Mariusz Felisiak
Regression in 649b28eab6765cd6b2b40c779a18ecafc99b43d7.
2022-10-06Refs #30158 -- Removed alias argument for Expression.get_group_by_cols().Simon Charette
Recent refactors allowed GROUP BY aliasing allowed for aliasing to be entirely handled by the sql.Query.set_group_by and compiler layers.
2022-10-03Fixed #34070 -- Added subsecond support to Now() on SQLite and MySQL.Lily Foote
2022-07-06Refs CVE-2022-34265 -- Properly escaped Extract() and Trunc() parameters.Simon Charette
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-07-04Fixed CVE-2022-34265 -- Protected Trunc(kind)/Extract(lookup_name) against ↵Mariusz Felisiak
SQL injection. Thanks Takuto Yoshikai (Aeye Security Lab) for the report.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-09-29Fixed #33141 -- Renamed Expression.empty_aggregate_value to ↵David Wobrock
empty_result_set_value.
2021-09-16Fixed #32365 -- Made zoneinfo the default timezone implementation.Carlton Gibson
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick Pope, and Paul Ganssle for reviews.
2021-07-15Refs #32508 -- Raised Type/ValueError instead of using "assert" in ↵Daniyal
django.db.models. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-02Refs #26430 -- Re-introduced empty aggregation optimization.Simon Charette
The introduction of the Expression.empty_aggregate_value interface allows the compilation stage to enable the EmptyResultSet optimization if all the aggregates expressions implement it. This also removes unnecessary RegrCount/Count.convert_value() methods. Disabling the empty result set aggregation optimization when it wasn't appropriate prevented None returned for a Count aggregation value. Thanks Nick Pope for the review.
2021-06-22Refs #32858, Refs #32392 -- Restored using :: shortcut syntax in Cast() on ↵Mariusz Felisiak
PostgreSQL. This partly reverts commit fdfbc66331292def201c9344e3cd29fbcbcd076a unnecessary since b69b0c3fe871167a0ca01bb439508e335143801f.
2021-05-17Fixed #32750 -- Fixed crash of Extract() transform on OuterRef() expressions.Artur Beltsov
Thanks Simon Charette for the review.
2021-03-29Fixed #31487 -- Added precision argument to Round().Nick Pope
2021-03-24Removed trailing whitespaces in error messages.Mariusz Felisiak
2021-01-29Fixed #32392 -- Fixed ExclusionConstraint crash with Cast() in expressions.Tilman Koschnick
2020-12-02Fixed #32179 -- Added JSONObject database function.Artur Beltsov
2020-10-21Fixed #26390 -- Disabled grouping by Random().Étienne Beaulé
Thanks to Tzu-ping Chung for the tests.
2020-10-14Fixed #31640 -- Made Trunc() truncate datetimes to Date/TimeField in a ↵David-Wobrock
specific timezone.
2020-10-14Refs #31640 -- Made Extract raise ValueError when using tzinfo with ↵David-Wobrock
Date/TimeField.
2020-10-02Fixed #32060 -- Added Random database function.Nick Pope
2020-09-02Fixed #31948 -- Added tzinfo parameter to TruncDate() and TruncTime().Joe Jackson