summaryrefslogtreecommitdiff
path: root/django/db/backends/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-011-1/+0
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Fixed #34233 -- Dropped support for Python 3.8 and 3.9.Mariusz Felisiak2023-01-181-1/+1
|
* Fixed #31090 -- Logged transaction management queries.Ilya Bass2022-11-211-0/+29
| | | | | Thanks to Petter Strandmark for the original idea and Mariusz Felisiak for advice during the DjangoConUS 2022 Sprint!
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-39/+68
|
* Fixed #33279 -- Fixed handling time zones with "-" sign in names.Can Sarigol2021-11-121-0/+13
| | | | | | Thanks yakimka for the report. Regression in fde9b7d35e4e185903cc14aa587ca870037941b1.
* Fixed #28401 -- Allowed hashlib.md5() calls to work with FIPS kernels.Ade Lee2021-10-121-2/+2
| | | | | | | | | | | | | | | | | | | md5 is not an approved algorithm in FIPS mode, and trying to instantiate a hashlib.md5() will fail when the system is running in FIPS mode. md5 is allowed when in a non-security context. There is a plan to add a keyword parameter (usedforsecurity) to hashlib.md5() to annotate whether or not the instance is being used in a security context. In the case where it is not, the instantiation of md5 will be allowed. See https://bugs.python.org/issue9216 for more details. Some downstream python versions already support this parameter. To support these versions, a new encapsulation of md5() has been added. This encapsulation will pass through the usedforsecurity parameter in the case where the parameter is supported, and strip it if it is not. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #30934 -- Included database alias in django.db.backends log messages.Nick Pope2021-07-021-2/+3
| | | | | | This is useful when working with database routing as you want to know where each query is being executed. Co-authored-by: David Winterbottom <david.winterbottom@gmail.com>
* Fixed a/an typos in "SQL" usage.Adam Johnson2020-05-061-2/+2
|
* Simplified imports from django.db and django.contrib.gis.db.Nick Pope2020-02-041-1/+1
|
* Refs #28373 -- Stopped setting tzinfo in typecast_timestamp().Sergey Fedoseev2019-12-111-4/+1
| | | | | Unnecessary since cef3f2d3c64055c9fc1757fd61dba24b557a2add. When USE_TZ=True, conn_tznames is always passed to methods that use typecast_timestamp(). Therefore, it can return naive datetimes.
* Used time.monotonic() instead of time.time() where applicable.Przemysław Suliga2019-05-081-3/+3
| | | | | | | | | | | | | | | | | | time.monotonic() available from Python 3.3: - Nicely communicates a narrow intent of "get a local system monotonic clock time" instead of possible "get a not necessarily accurate Unix time stamp because it needs to be communicated to outside of this process/machine" when time.time() is used. - Its result isn't affected by the system clock updates. There are two classes of time.time() uses changed to time.monotonic() by this change: - measuring time taken to run some code. - setting and checking a "close_at" threshold for for persistent db connections (django/db/backends/base/base.py).
* Readded comment about the default params of cursor.execute().Daniel Hahler2019-05-071-0/+1
| | | | It was removed in in 728548e483a5a3486939b0c8e62520296587482e.
* Refs #30148 -- Moved logging queries in CursorDebugWrapper to debug_sql() ↵kingbuzzman2019-04-291-21/+20
| | | | contextmanager.
* Removed unused 'tz' variable in typecast_timestamp().Srinivas Reddy Thatiparthy2018-11-091-7/+3
|
* Added django.db.backends.utils.names_digest() to remove redundant code.Jon Dufresne2018-10-021-1/+12
|
* Refs #27795 -- Removed force_bytes() usage in db/backends/utils.py.Jon Dufresne2018-09-251-2/+1
|
* Removed unused code in django.db.backends.utils.format_number().Tim Graham2018-07-021-11/+7
|
* Simplified SQLite's Decimal adapter.Sergey Fedoseev2018-07-021-6/+0
|
* Used Decimal.scaleb() in backends.utils.format_number() and ↵Mariusz Felisiak2017-12-301-1/+1
| | | | DecimalField.widget_attrs() to improve performance.
* Fixed #28792 -- Fixed index name truncation of namespaced tables.Simon Charette2017-11-141-10/+24
| | | | | | Refs #27458, #27843. Thanks Tim and Mariusz for the review.
* Refs #28595 -- Added a hook to add execute wrappers for database queries.Shai Berger2017-09-211-1/+14
| | | | Thanks Adam Johnson, Carl Meyer, Anssi Kääriäinen, Mariusz Felisiak, Michael Manfre, and Tim Graham for discussion and review.
* Fixed #23546 -- Added kwargs support for CursorWrapper.callproc() on Oracle.Mariusz Felisiak2017-08-121-3/+14
| | | | Thanks Shai Berger, Tim Graham and Aymeric Augustin for reviews and Renbi Yu for the initial patch.
* Replaced typecast_decimal() with decimal.Decimal().Sergey Fedoseev2017-08-111-6/+0
|
* Refs #4518 -- Removed handling of empty strings in typecast_decimal().Sergey Fedoseev2017-08-091-1/+1
| | | | It's unclear if the original change was needed, but it seems unneeded now. Reverted 6fc10f50b0c9b877fffcad4893056cb91fa66b4f.
* Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan2017-02-281-4/+3
|
* Refs #27843 -- Fixed 'invalid escape sequence' warning in truncate_name().Tim Graham2017-02-271-1/+1
|
* Refs #23919 -- Used yield from.Vytis Banaitis2017-02-231-2/+1
|
* Fixed #27843 -- Fixed truncate_name() when the name contains a username.Mariusz Felisiak2017-02-171-4/+11
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-2/+2
|
* Fixed spelling mistakes in code and comments.james mike dupont2017-01-191-3/+3
|
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-1/+1
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Fixed #27458 -- Fixed invalid sequence/index names when using "USER"."TABLE" ↵Andrew Nester2016-12-301-0/+10
| | | | db_table on Oracle.
* Fixed #26498 -- Fixed TimeField microseconds round-tripping on MySQL and SQLite.Lukasz Wiecek2016-04-181-1/+1
| | | | Thanks adamchainz for the report and review.
* Fixed E128 flake8 warnings in django/.Tim Graham2016-04-081-4/+8
|
* Passed logging message parameters as arguments instead of interpolating them.Ville Skyttä2015-12-261-2/+2
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-1/+0
|
* Fixed #23941 -- Removed implicit decimal formatting from expressions.Josh Smeaton2014-12-121-3/+12
|
* Fixed #22879 -- Intercept errors coming from cursor.__next__()Mikhail Denisenko2014-10-271-1/+3
|
* Fixed #3711, #6734, #12581 -- Bounded connection.queries.Aymeric Augustin2014-06-071-2/+2
| | | | | | | Prevented unlimited memory consumption when running background tasks with DEBUG=True. Thanks Rob, Alex, Baptiste, and others.
* Prevented a crash in the cursor wrappers on Oracle.Aymeric Augustin2014-04-241-2/+6
| | | | | | Fixed #22483 (again). Forwardport of 5cd6429620 from stable/1.7.x
* Corrected many style guide violations that the newest version of flake8 catchesAlex Gaynor2014-03-301-1/+1
|
* Removed legacy transaction management per the deprecation timeline.Aymeric Augustin2014-03-211-3/+0
|
* Fixed all E261 warningscoagulant2013-11-021-5/+5
|
* Fixed #21134 -- Prevented queries in broken transactions.Aymeric Augustin2013-09-301-15/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 63ddb271a44df389b2c302e421fc17b7f0529755 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Sep 29 22:51:00 2013 +0200 Clarified interactions between atomic and exceptions. commit 2899ec299228217c876ba3aa4024e523a41c8504 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Sep 22 22:45:32 2013 +0200 Fixed TransactionManagementError in tests. Previous commit introduced an additional check to prevent running queries in transactions that will be rolled back, which triggered a few failures in the tests. In practice using transaction.atomic instead of the low-level savepoint APIs was enough to fix the problems. commit 4a639b059ea80aeb78f7f160a7d4b9f609b9c238 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Tue Sep 24 22:24:17 2013 +0200 Allowed nesting constraint_checks_disabled inside atomic. Since MySQL handles transactions loosely, this isn't a problem. commit 2a4ab1cb6e83391ff7e25d08479e230ca564bfef Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sat Sep 21 18:43:12 2013 +0200 Prevented running queries in transactions that will be rolled back. This avoids a counter-intuitive behavior in an edge case on databases with non-atomic transaction semantics. It prevents using savepoint_rollback() inside an atomic block without calling set_rollback(False) first, which is backwards-incompatible in tests. Refs #21134. commit 8e3db393853c7ac64a445b66e57f3620a3fde7b0 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Sep 22 22:14:17 2013 +0200 Replaced manual savepoints by atomic blocks. This ensures the rollback flag is handled consistently in internal APIs.
* Fixed #17671 - Cursors are now context managers.Michael Manfre2013-09-251-0/+8
|
* Fixed #21109 -- made db cursor error wrapping fasterAnssi Kääriäinen2013-09-171-6/+10
|
* Fixed #17627 -- Renamed util.py files to utils.pyTim Graham2013-09-161-0/+167
Thanks PaulM for the suggestion and Luke Granger-Brown and Wiktor Kołodziej for the initial patch.