<feed xmlns='http://www.w3.org/2005/Atom'>
<title>django.git/tests/bulk_create, branch fix-31295</title>
<subtitle>django
</subtitle>
<id>http://cgit.adnoto.dev/django.git/atom?h=fix-31295</id>
<link rel='self' href='http://cgit.adnoto.dev/django.git/atom?h=fix-31295'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/'/>
<updated>2025-11-06T16:58:01Z</updated>
<entry>
<title>Fixed #36702 -- Made bulk_create() return pk values set by an expression.</title>
<updated>2025-11-06T16:58:01Z</updated>
<author>
<name>us77ipis</name>
<email>75014848+us77ipis@users.noreply.github.com</email>
</author>
<published>2025-11-06T16:58:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=6d4d99b3cef4a6d931de02f89a493fb345dc438e'/>
<id>urn:sha1:6d4d99b3cef4a6d931de02f89a493fb345dc438e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed IntegrityError in bulk_create.tests.BulkCreateTransactionTests due to duplicate primary keys.</title>
<updated>2025-10-24T14:33:40Z</updated>
<author>
<name>Natalia</name>
<email>124304+nessita@users.noreply.github.com</email>
</author>
<published>2025-10-24T12:50:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=6fcbbe0b855d8701a4da1b65772ccf326f996b9e'/>
<id>urn:sha1:6fcbbe0b855d8701a4da1b65772ccf326f996b9e</id>
<content type='text'>
Some tests in BulkCreateTransactionTests were inserting Country objects
with hardcoded primary keys, which could conflict with existing rows
(if the sequence value wasn't bumped by another test).

Updated the tests to dynamically select an unused primary key instead.

Thanks to Simon Charette for the exhaustive and enlightening review.
</content>
</entry>
<entry>
<title>Fixed failing bulk_create test raising IntegrityError when run in reverse.</title>
<updated>2025-08-21T15:25:57Z</updated>
<author>
<name>Natalia</name>
<email>124304+nessita@users.noreply.github.com</email>
</author>
<published>2025-08-21T12:43:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=d6a8e5f5e1129d78e6ad40c66c6282ab55be8b61'/>
<id>urn:sha1:d6a8e5f5e1129d78e6ad40c66c6282ab55be8b61</id>
<content type='text'>
When running the `bulk_create` tests with Postgres settings and
`--reverse`, the following IntegrityError was raised in
bulk_create.tests.BulkCreateTransactionTests.test_objs_with_and_without_pk:

django.db.utils.IntegrityError: duplicate key value violates unique
constraint "bulk_create_country_pkey"
DETAIL:  Key (id)=(1) already exists.

This branch fixes this by ensuring the ID is unique since DB sequences
are not resetted between tests.
</content>
</entry>
<entry>
<title>Avoided usage of DEBUG setting override in bulk_create tests.</title>
<updated>2025-08-15T08:45:02Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2025-07-02T16:18:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=cd0966cd4e37da8e6153cbf57c194dce29caaddc'/>
<id>urn:sha1:cd0966cd4e37da8e6153cbf57c194dce29caaddc</id>
<content type='text'>
Asserting an upper bound for the number of executed queries can be achieved by
using CaptureQueriesContext instead of enabling the whole DEBUG machinery.
</content>
</entry>
<entry>
<title>Fixed #36490 -- Avoided unnecessary transaction in bulk_create.</title>
<updated>2025-08-15T08:45:02Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2025-07-02T05:47:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=e1671278e88265e64811657b8b939b5d786295cb'/>
<id>urn:sha1:e1671278e88265e64811657b8b939b5d786295cb</id>
<content type='text'>
When dealing with an heterogeneous set of object with regards to primary key
assignment that fits in a single batch there's no need to wrap the single
INSERT statement in a transaction.
</content>
</entry>
<entry>
<title>Refs #36143 -- Tested bulk_batch_size limit for bulk_update and bulk_create.</title>
<updated>2025-05-08T10:37:11Z</updated>
<author>
<name>Sage Abdullah</name>
<email>me@laymonage.com</email>
</author>
<published>2025-05-08T07:10:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=38660a612cd924199df83b93807604cadf6d5125'/>
<id>urn:sha1:38660a612cd924199df83b93807604cadf6d5125</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refs #36088, Refs #36260 - Added supports_expression_defaults checks in bulk_create() tests.</title>
<updated>2025-04-05T16:47:53Z</updated>
<author>
<name>Tim Graham</name>
<email>timograham@gmail.com</email>
</author>
<published>2025-04-05T16:47:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=02e7a162a03801fce34c78d5d75fef0aaf997ab5'/>
<id>urn:sha1:02e7a162a03801fce34c78d5d75fef0aaf997ab5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed #36260 -- Made bulk_create() work with DB-generated primary keys.</title>
<updated>2025-03-26T08:55:09Z</updated>
<author>
<name>Dmitry Shachnev</name>
<email>mitya57@gmail.com</email>
</author>
<published>2025-03-16T17:50:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=77b4ecbd53635b94d3685d16af9e8b2f96cf952c'/>
<id>urn:sha1:77b4ecbd53635b94d3685d16af9e8b2f96cf952c</id>
<content type='text'>
Co-authored-by: Simon Charette &lt;charette.s@gmail.com&gt;
</content>
</entry>
<entry>
<title>Fixed #36088 -- Avoided unnecessary DEFAULT usage on bulk_create().</title>
<updated>2025-02-01T17:43:10Z</updated>
<author>
<name>Simon Charette</name>
<email>charette.s@gmail.com</email>
</author>
<published>2024-12-09T23:38:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=4608d34b346c28d5d227363c881d3279378f40b3'/>
<id>urn:sha1:4608d34b346c28d5d227363c881d3279378f40b3</id>
<content type='text'>
When all values of a field with a db_default are DatabaseDefault, which
is the case most of the time, there is no point in specifying explicit
DEFAULT for all INSERT VALUES as that's what the database will do anyway
if not specified.

In the case of PostgreSQL doing so can even be harmful as it prevents
the usage of the UNNEST strategy and in the case of Oracle, which
doesn't support the usage of the DEFAULT keyword, it unnecessarily
requires providing literal db defaults.

Thanks Lily Foote for the review.
</content>
</entry>
<entry>
<title>Fixed #34698 -- Made QuerySet.bulk_create() retrieve primary keys when updating conflicts.</title>
<updated>2023-07-10T11:17:28Z</updated>
<author>
<name>Thomas Chaumeny</name>
<email>thomas.chaumeny.ext@gitguardian.com</email>
</author>
<published>2023-07-07T11:08:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=89c7454dbdae3e0df6d96aa6132205d05e4a9b3d'/>
<id>urn:sha1:89c7454dbdae3e0df6d96aa6132205d05e4a9b3d</id>
<content type='text'>
</content>
</entry>
</feed>
