summaryrefslogtreecommitdiff
path: root/django/db/backends/sqlite3/operations.py
AgeCommit message (Collapse)Author
2026-02-12Improved error message in SQLite ↵Adam Johnson
`DatabaseOperations.check_expression_support()`.
2026-02-12Optimized SQLite `DatabaseOperations.check_expression_support()`.Adam Johnson
Avoided reconstructing the same tuples on every call by defining them as module-level constants.
2026-01-28Fixed #36233 -- Avoided quantizing integers stored in DecimalField on SQLite.Samriddha9619
Co-authored-by: Simon Charette <charette.s@gmail.com> Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2026-01-16Refs #36822 -- Hoisted bulk_batch_size() implementations to base backend.JaeHyuck Sa
2025-11-07Fixed #36420 -- Used actual SQLite limits in last_executed_query() quoting.myoungjinGo
2025-08-28Refs #27222 -- Implemented ↵Simon Charette
BaseDatabaseOperations.return_insert_columns()/fetch_returned_insert_rows().
2025-08-21Fixed #36430 -- Removed artificially low limit on single field bulk ↵Jacob Walls
operations on SQLite.
2025-05-14Fixed #36085 -- Added JSONField support for negative array indexing on SQLite.savanto
2025-05-08Fixed #36143 -- Made max_query_params respect SQLITE_LIMIT_VARIABLE_NUMBER.Sage Abdullah
Co-authored-by: Xavier Frankline <xf.xavierfrank@gmail.com>
2025-03-31Refs #28909 -- Simplified code using unpacking generalizations.Aarni Koskela
2025-01-29Fixed #36118 -- Accounted for multiple primary keys in bulk_update ↵Sarah Boyce
max_batch_size. Co-authored-by: Simon Charette <charette.s@gmail.com>
2024-03-14Refs #35295 -- Added BaseDatabaseOperations.bulk_insert_sql().Mariusz Felisiak
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2024-01-16Fixed #35111 -- Fixed compilation of DateField __in/__range rhs on SQLite ↵Simon Charette
and MySQL. Also removed tests that ensured that adapt_(date)timefield backend operations where able to deal with expressions when it's not the case for any other adapt methods.
2023-11-13Fixed #34967 -- Fixed queryset crash when grouping by constants on SQLite < ↵David Sanders
3.39. On SQLite < 3.39, this forces a GROUP BY clause with a HAVING clause when no grouping is specified. Co-authored-by: Simon Charette <charette.s@gmail.com>
2023-03-08Fixed #34370 -- Added integer fields validation as 64-bit on SQLite.nabil-rady
2022-11-04Removed obsolete references to pysqlite.Nick Pope
Obsolete since 1b06d5e6f6be8e567ce78c892c485af039830d7d.
2022-07-06Refs CVE-2022-34265 -- Properly escaped Extract() and Trunc() parameters.Simon Charette
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
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
2022-01-24Fixed #33460 -- Used VALUES clause for insert in bulk on SQLite.Keryn Knight
SQLite 3.7.11 introduced the ability to use multiple values directly. SQLite 3.8.8 made multiple values not subject to the SQLITE_LIMIT_COMPOUND_SELECT (500).
2022-01-19Fixed #31685 -- Added support for updating conflicts to QuerySet.bulk_create().sean_c_hsu
Thanks Florian Apolloner, Chris Jerdonek, Hannes Ljungberg, Nick Pope, and Mariusz Felisiak for reviews.
2021-04-20Refs #25287 -- Added support for multiplying and dividing DurationField by ↵Tobias Bengfort
scalar values on SQLite.
2021-04-07Fixed #32501 -- Added support for returning fields from INSERT statements on ↵girishsontakke
SQLite 3.35+.
2021-03-23Fixed #32483 -- Fixed QuerySet.values()/values_list() on JSONField key ↵Mariusz Felisiak
transforms with booleans on SQLite. Thanks Matthew Cornell for the report.
2021-01-14Refs #31369 -- Removed models.NullBooleanField per deprecation timeline.Mariusz Felisiak
2020-10-14Fixed #31640 -- Made Trunc() truncate datetimes to Date/TimeField in a ↵David-Wobrock
specific timezone.
2020-06-30Fixed #28925 -- Fixed durations-only expressions crash on SQLite and MySQL.Sergey Fedoseev
This removes also unused DatabaseOperations.date_interval_sql().
2020-04-21Fixed #31479 -- Added support to reset sequences on SQLite.Jon Dufresne
2020-04-17Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on ↵Jon Dufresne
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.
2020-03-25Fixed #31396 -- Added binary XOR operator to F expressions.Hannes Ljungberg
2020-02-18Fixed #31228 -- Reallowed aggregates to be used with multiple expressions ↵Taoup
and no DISTINCT on SQLite. Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111. Thanks Andy Terra for the report.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-01-03Fixed #31133 -- Fixed crash when subtracting against a subquery annotation.Simon Charette
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.
2019-10-15Fixed #30859 -- Fixed DatabaseFeatures.supports_aggregate_filter_clause on ↵Mariusz Felisiak
SQLite 3.30.1+.
2019-04-24Removed unnecessary assignments in various code.Jon Dufresne
2019-04-08Fixed #28373 -- Used connection timezone instead of UTC when making dates ↵can
timezone-aware on MySQL, SQLite, and Oracle. Thanks vtalpaert for the initial patch. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-01-09Fixed #28658 -- Added DISTINCT handling to the Aggregate class.Simon Charette
2018-12-26Refs #30054, #20483 -- Cached SQLite references graph retrieval on sql_flush().Simon Charette
2018-12-22Fixed #30054 -- Implemented cascaded flush on SQLite.Simon Charette
This is required to maintain foreign key integrity when using TransactionTestCase.available_apps. Refs #30033, #14204, #20483.
2018-08-03Fixed #28668 -- Allowed QuerySet.bulk_create() to ignore insert conflicts.Tom
2018-07-05Refs #28643 -- Added math database functions.Junyi Jiao
Thanks Nick Pope for much review.
2018-04-19Fixed #28574 -- Added QuerySet.explain().Tom
2018-01-04Refs #28459 -- Improved performance of duration expressions on SQLite.Sergey Fedoseev
2017-12-26Refs #28459 -- Improved performance of loading DecimalField on SQLite.Sergey Fedoseev
2017-12-21Refs #23941 -- Prevented incorrect rounding of DecimalField annotations on ↵Sergey Fedoseev
SQLite.
2017-12-19Fixed #28727 -- Fixed Cast crash on SQLite when casting a Python ↵Mariusz Felisiak
date/datetime to Date/DateTimeField.
2017-12-12Fixed #28915 -- Prevented SQLite from truncating trailing zeros in the ↵Sergey Fedoseev
fractional part of DecimalField. This reverts commit a146b65628e702a9a3ed5be21542ca45366fbb29 and adds a test for the regression.
2017-10-06Fixed #28665 -- Change some database exceptions to NotImplementedError per ↵Simon Charette
PEP 249.
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-08-10Refs #28459 -- Improved performance of loading DecimalField on SQLite.Sergey Fedoseev