Fixed #32501 -- Added support for returning fields from INSERT statements on SQLite 3.35+.

This commit is contained in:
girishsontakke 2021-04-06 21:50:31 +05:30 committed by Mariusz Felisiak
parent 3f2920ae1d
commit 98abc0c90e
4 changed files with 34 additions and 1 deletions

View file

@ -2171,7 +2171,8 @@ This has a number of caveats though:
* It does not work with child models in a multi-table inheritance scenario.
* If the model's primary key is an :class:`~django.db.models.AutoField`, the
primary key attribute can only be retrieved on certain databases (currently
PostgreSQL and MariaDB 10.5+). On other databases, it will not be set.
PostgreSQL, MariaDB 10.5+, and SQLite 3.35+). On other databases, it will not
be set.
* It does not work with many-to-many relationships.
* It casts ``objs`` to a list, which fully evaluates ``objs`` if it's a
generator. The cast allows inspecting all objects so that any objects with a
@ -2210,6 +2211,10 @@ normally supports it).
.. _MySQL documentation: https://dev.mysql.com/doc/refman/en/sql-mode.html#ignore-strict-comparison
.. _MariaDB documentation: https://mariadb.com/kb/en/ignore/
.. versionchanged:: 4.0
Support for the fetching primary key attributes on SQLite 3.35+ was added.
``bulk_update()``
~~~~~~~~~~~~~~~~~

View file

@ -230,6 +230,9 @@ Models
:class:`Round() <django.db.models.functions.Round>` database function allows
specifying the number of decimal places after rounding.
* :meth:`.QuerySet.bulk_create` now sets the primary key on objects when using
SQLite 3.35+.
Requests and Responses
~~~~~~~~~~~~~~~~~~~~~~