summaryrefslogtreecommitdiff
path: root/django/db/utils.py
AgeCommit message (Collapse)Author
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-03-17Fixed #34865 -- Released memory earlier than garbage collection on database ↵fowczrek
wrapping layers. Thank you Florian Apolloner, Jake Howard and Patryk Zawadzki for the clarifying comments and reviews.
2022-05-13Added backward compatibility test for ConnectionHandler.databases property.Nick Pope
The ConnectionHandler.databases property is no longer used within Django, but it is maintained for backward compatibility with 3rd party packages that have used this private API in the past.
2022-05-12Made closing in connection handlers more DRY.Nick Pope
2022-03-17Moved ensure_defaults() and prepare_test_settings() logic to ↵Florian Apolloner
ConnectionHandler.configure_settings().
2022-03-17Removed usage of django.db.utils.ConnectionHandler.databases.Florian Apolloner
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-12-01Fixed #30398 -- Added CONN_HEALTH_CHECKS database setting.Przemysław Suliga
The CONN_HEALTH_CHECKS setting can be used to enable database connection health checks for Django's persistent DB connections. Thanks Florian Apolloner for reviews.
2021-01-06Refs #25175 -- Removed postgresql_psycopg2 in django.db.utils.load_backend().Mariusz Felisiak
Follow up to 944469939b9eb93fda0924f78faba5c0ffae2dff.
2021-01-04Simplified django.db.utils.load_backend().William Schwartz
Previously load_backend() performed search by computing the (sole) entry of django.db.backends.__path__ manually from django.db.utils.__file__. Now django.db.backends.__path__ is used directly.
2020-12-08Fixed #32233 -- Cleaned-up duplicate connection functionality.Florian Apolloner
2020-11-16Fixed #32197 -- Improved error message when loading a database backend fails.Hasan Ramezani
2019-11-20Fixed #25388 -- Added an option to allow disabling of migrations during test ↵Jon Dufresne
database creation.
2019-06-20Fixed #30451 -- Added ASGI handler and coroutine-safety.Andrew Godwin
This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django.
2019-01-09Fixed #30071 -- Fixed error message when a 'default' database isn't provided.Benjy Weinberger
2018-04-19Ref #23919 -- Replaced some os.path usage with pathlib.Path.Tom
2017-04-25Refs #23919 -- Used "raise from" instead of __cause__ in reraising ↵Mariusz Felisiak
backend-specific database exceptions. Thanks Tim Graham for the review.
2017-02-28Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan
2017-01-24Tidied djang.db.utils.load_backend().Tim Graham
Removed an unneeded EnvironmentError catching and used "raise from exc" syntax.
2017-01-24Refs #23919 -- Removed __traceback__ setting needed for Python 2.Tim Graham
Partially reverted refs #25761 and refs #16245.
2017-01-22Refs #23919 -- Replaced six.reraise by raiseClaude Paroz
2017-01-20Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham
These functions do nothing on Python 3.
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz
Thanks Tim Graham for the review.
2015-12-03Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions.Raphaël Hertzog
When Django reraises an exception, it sets the __cause__ attribute even in Python 2, mimicking Python's 3 behavior for "raise Foo from Bar". However, Python 3 also ensures that all exceptions have a __traceback__ attribute and thus the "traceback2" Python 2 module (backport of Python 3's "traceback" module) relies on the fact that whenever you have a __cause__ attribute, the recorded exception also has a __traceback__ attribute. This is breaking testtools which is using traceback2 (see https://github.com/testing-cabal/testtools/issues/162). This commit fixes this inconsistency by ensuring that Django sets the __traceback__ attribute on any exception stored in a __cause__ attribute of a reraised exception.
2015-09-23Refs #24351 -- Removed support for the old allow_migrate() signature per ↵Tim Graham
deprecation timeline.
2015-08-07Fixed #25175 -- Renamed the postgresql_psycopg2 database backend to postgresql.Caio Ariede
2015-07-17Fixed db.utils.load_backend() on non-ASCII paths.Tim Graham
2015-07-15Filtered out 'base' from database backend choices error message.Tim Graham
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-06-15Fixed #24979 -- Removed usage of inspect.getargspec().Tim Graham
2015-06-15Fixed flake8 warnings on Python 3.Tim Graham
2015-05-17Fixed #23820 -- Supported per-database time zone.Aymeric Augustin
The primary use case is to interact with a third-party database (not primarily managed by Django) that doesn't support time zones and where datetimes are stored in local time when USE_TZ is True. Configuring a PostgreSQL database with the TIME_ZONE option while USE_TZ is False used to result in silent data corruption. Now this is an error.
2015-03-25Fixed #24394 -- Allowed running tests with empty default dictionary.Andrei Kulakov
2015-02-20Fixed #24351, #24346 -- Changed the signature of allow_migrate().Loic Bistuer
The new signature enables better support for routing RunPython and RunSQL operations, especially w.r.t. reusable and third-party apps. This commit also takes advantage of the deprecation cycle for the old signature to remove the backward incompatibility introduced in #22583; RunPython and RunSQL won't call allow_migrate() when when the router has the old signature. Thanks Aymeric Augustin and Tim Graham for helping shape up the patch. Refs 22583.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-17Removed support for old-style test database settings per deprecation timeline.Tim Graham
2015-01-17Removed fallback suport for allow_syncdb() in database routers per ↵Tim Graham
deprecation timeline.
2015-01-10Fixed #22583 -- Allowed RunPython and RunSQL to provide hints to the db router.Loic Bistuer
Thanks Markus Holtermann and Tim Graham for the review.
2014-12-29Fixed #21255 -- Closed connections after management command ranClaude Paroz
Thanks kabakov.as@gmail.com for the report, and Aymeric Augustin, Simon Charette for the reviews.
2014-12-01Restored the 'TEST_' prefix in the warning about deprecated test database ↵Shai Berger
settings
2014-07-03Fixed #21755 -- Added ForeignKey support to REQUIRED_FIELDS.Anubhav Joshi
This allows specifying ForeignKeys in REQUIRED_FIELDS when using a custom User model. Thanks cjerdonek and bmispelon for suggestion and timgraham for review.
2014-06-12Silenced deprecation warnings for refs #22811 and fixed build.Tim Graham
2014-06-12Fixed #22811 -- Allowed setting both the old and new TEST database settings.Tim Graham
An ImproperlyConfigured exception will be raised they mismatch.
2014-06-11Fixed #21430 -- Added a RuntimeWarning when unpickling Models and QuerySets ↵Anubhav Joshi
from a different Django version. Thanks FunkyBob for the suggestion, prasoon2211 for the initial patch, and akaariai, loic, and charettes for helping in shaping the patch.
2014-03-21Removed deprecated TRANSACTIONS_MANAGED setting.Aymeric Augustin
2014-03-09Fixed the last fix for database test settings to work with Python3.Shai Berger
2014-03-09Fixed test breakage following test-settings enhancementsShai Berger
2014-03-09Reorganized the database test settingsShai Berger
Change database test settings from "TEST_"-prefixed entries in the database settings dictionary to setting in a dictionary that is itself an entry "TEST" in the database settings. Refs #21775 Thanks Josh Smeaton for review.