summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2024-03-14Fixed #28541 -- Fixed migrations crash when changing primary key on SQLite.Ben Cail
2024-03-14Fixed #35295 -- Used INSERT with multiple rows on Oracle 23c.Mariusz Felisiak
2024-03-14Refs #35295 -- Added BaseDatabaseOperations.bulk_insert_sql().Mariusz Felisiak
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2024-03-13Refs #32673, Refs #35295 -- Avoided wrapping rhs direct values in lookups.Mariusz Felisiak
2024-03-11Optimized DatabaseOperations.bulk_insert_sql() a bit on Oracle.Mariusz Felisiak
2024-03-11Fixed #35285 -- Optimized ForeignObject._check_unique_target().Adam Johnson
2024-03-09Fixed #35270 -- Optimized model's Options._property_names.Adam Johnson
co-authored-by: Nick Pope <nick@nickpope.me.uk>
2024-03-08Fixed #35044 -- Avoided clearing reverse relations and private fields when ↵Giannis Terzopoulos
accessing deferred fields. Regression in a7b5ad8b19a08d7d57302ece74f6e26d2887fd9f for reverse relations and possibly in 123b1d3fcf79f091573c40be6da7113a6ef35b62 for private fields.
2024-03-08Optimized Model.refresh_from_db(fields=...) by using a set.Giannis Terzopoulos
2024-03-08Fixed #35223 -- Made Model.full_clean() ignore fields with db_default when ↵Ben Cail
validating empty values. Thanks Brian Ibbotson for the report. Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
2024-03-08Refs #30397 -- Optimized interpolation of index and constraint names a bit more.Nick Pope
2024-03-07Fixed typo in django/db/models/expressions.py.Mariusz Felisiak
2024-03-07Refs #30397 -- Optimized interpolation of index and constraint names a bit.Adam Johnson
2024-03-06Fixed #35021 -- Fixed capturing queries when using client-side parameters ↵Michail Chatzis
binding with psycopg 3+.
2024-03-04Fixed #35266 -- Deferred formatting in RelatedField._check_clashes().Adam Johnson
2024-03-01Refs #33497 -- Added connection pool support for PostgreSQL.Sarah Boyce
Co-authored-by: Florian Apolloner <florian@apolloner.eu> Co-authored-by: Ran Benita <ran@unusedvar.com>
2024-03-01Refs #35234 -- Deprecated CheckConstraint.check in favor of .condition.Simon Charette
Once the deprecation period ends CheckConstraint.check() can become the documented method that performs system checks for BaseConstraint subclasses.
2024-02-29Refs #35234 -- Moved constraint system checks to Check/UniqueConstraint methods.Simon Charette
2024-02-26Refs #34200 -- Removed unnecessary check in DatabaseWrapper.ensure_role() on ↵Florian Apolloner
PostgreSQL. ensure_role() is only called in init_connection_state() where a new connection is established.
2024-02-26Fixed #35246 -- Made Field.unique a cached property.Adam Johnson
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-02-26Fixed #35241 -- Cached model's full parent list.Adam Johnson
co-authored-by: Keryn Knight <keryn@kerynknight.com> co-authored-by: Natalia <124304+nessita@users.noreply.github.com> co-authored-by: David Smith <smithdc@gmail.com> co-authored-by: Paolo Melchiorre <paolo@melchiorre.org>
2024-02-23Simplified using DATABASES["OPTIONS"].Florian Apolloner
DATABASES["OPTIONS"] are always configured.
2024-02-20Fixed #35238 -- Fixed database serialization crash when base managers use ↵AlexCLeduc
prefetch_related(). Regression in 139135627650ed6aaaf4c755b82c3bd43f2b8f51 following deprecation in eedbf930287cb72e9afab1f7208c24b1146b0c4ec.
2024-02-20Fixed #35236 -- Used Field.attname/column attributes instead of ↵Adam Johnson
get_attname()/get_attname_column().
2024-02-19Refs #28011 -- Removed ForeignObjectRel.is_hidden().Adam Johnson
2024-02-19Refs #34060 -- Fixed JSONField __exact lookup for primitivies on Oracle 21c+.Albert Defler
Regression in c991602ce5798385261381025c06698d7fd30dc5. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-02-19Fixed #35232 -- Cached model's Options.verbose_name_raw.Adam Johnson
2024-02-19Fixed #35230 -- Added cached ForeignObjectRel.accessor_name.Adam Johnson
2024-02-16Fixed #24018 -- Allowed setting pragma options on SQLite.Aaron Linville
2024-02-16Fixed #29725 -- Removed unnecessary join in QuerySet.count() and exists() on ↵ontowhee
a many to many relation. Co-Authored-By: Shiwei Chen <april.chen.0615@gmail.com>
2024-02-16Refs #34060 -- Fixed crash when filtering against literal JSON with psycopg2.Simon Charette
2024-02-15Fixed #34060 -- Fixed migrations crash when adding check constraints with ↵Albert Defler
JSONField __exact lookup on Oracle.
2024-02-15Fixed #33037 -- Fixed Trunc() with offset timezones on MySQL, SQLite, Oracle.Shafiya Adzhani
2024-02-09Refs #34534 -- Reduced constraint operations with Meta.constraints when ↵Ben Cail
optimizing migrations.
2024-02-08Fixed #35073 -- Avoided unnecessary calling of callables used by ↵bcail
SET/SET_DEFAULT in Collector.collect().
2024-02-07Fixed #35099 -- Prevented mutating queryset when combining with & and | ↵Hisham Mahmood
operators. Thanks Alan for the report. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-02-04Fixed #35149 -- Fixed crashes of db_default with unresolvable output field.Simon Charette
Field.db_default accepts either literal Python values or compilables (as_sql) and wrap the former ones in Value internally. While 1e38f11 added support for automatic resolving of output fields for types such as str, int, float, and other unambigous ones it's cannot do so for all types such as dict or even contrib.postgres and contrib.gis primitives. When a literal, non-compilable, value is provided it likely make the most sense to bind its output field to the field its attached to avoid forcing the user to provide an explicit `Value(output_field)`. Thanks David Sanders for the report.
2024-02-04Refs #35149 -- Made equivalent db_default alterations noops.Simon Charette
This allows for an easier transition of preserving the literal nature of non-compilable db_default.
2024-02-03Fixed #35162 -- Fixed crash when adding fields with db_default on MySQL.Simon Charette
MySQL doesn't allow literal DEFAULT values to be used for BLOB, TEXT, GEOMETRY or JSON columns and requires expression to be used instead. Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
2024-01-30Fixed #29280 -- Made the transactions behavior configurable on SQLite.Anže Pečar
2024-01-29Fixed #35135 -- Made FilteredRelation raise ValueError on querysets as rhs.Nicolas Delaby
Regression in 59f475470494ce5b8cbff816b1e5dafcbd10a3a3.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2024-01-23Refs #33517 -- Prevented __second lookup from returning fractional seconds ↵Hisham Mahmood
on Oracle.
2024-01-22Fixed #35130 -- Doc'd django.db.close_old_connections().Salvo Polizzi
This also adds close_db_connections() to the django.db.__all__.
2024-01-19Fixed #35127 -- Made Model.full_clean() ignore GeneratedFields.Mariusz Felisiak
Thanks Claude Paroz for the report. Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2024-01-17Fixed #31700 -- Made makemigrations command display meaningful symbols for ↵Amir Karimi
each operation.
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.
2024-01-15Fixed #28344 -- Allowed customizing queryset in ↵Aivars Kalvans
Model.refresh_from_db()/arefresh_from_db(). The from_queryset parameter can be used to: - use a custom Manager - lock the row until the end of transaction - select additional related objects
2024-01-15Refs #35102 -- Optimized replace_expressions()/relabelling aliases by adding ↵Mariusz Felisiak
early return. This avoids costly hashing. Thanks Anthony Shaw for the report. Co-Authored-By: Simon Charette <charette.s@gmail.com>
2024-01-15Refs #35102 -- Optimized Expression.identity used for equality and hashing.Simon Charette
inspect.signature() is quite slow and produces the same object for each instance of the same class as they share their __init__ method which makes it a prime candidate for caching. Thanks Anthony Shaw for the report.