mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Refs #27222 -- Refreshed GeneratedFields values on save() initiated update.
This required implementing UPDATE RETURNING machinery that heavily borrows from the INSERT one.
This commit is contained in:
committed by
Mariusz Felisiak
parent
c48904a225
commit
55a0073b3b
@@ -331,6 +331,12 @@ Models
|
||||
value from the non-null input values. This is supported on SQLite, MySQL,
|
||||
Oracle, and PostgreSQL 16+.
|
||||
|
||||
* :class:`~django.db.models.GeneratedField`\s are now refreshed from the
|
||||
database after :meth:`~django.db.models.Model.save` on backends that support
|
||||
the ``RETURNING`` clause (SQLite, PostgreSQL, and Oracle). On backends that
|
||||
don't support it (MySQL and MariaDB), the fields are marked as deferred to
|
||||
trigger a refresh on subsequent accesses.
|
||||
|
||||
Pagination
|
||||
~~~~~~~~~~
|
||||
|
||||
@@ -420,6 +426,9 @@ backends.
|
||||
``returning_params`` to be provided just like
|
||||
``fetch_returned_insert_columns()`` did.
|
||||
|
||||
* If the database supports ``UPDATE … RETURNING`` statements, backends can set
|
||||
``DatabaseFeatures.can_return_rows_from_update=True``.
|
||||
|
||||
Dropped support for MariaDB 10.5
|
||||
--------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user