mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Refs #14091 -- Fixed connection.queries on SQLite.
This commit is contained in:
@@ -23,8 +23,6 @@ the following::
|
||||
|
||||
``connection.queries`` includes all SQL statements -- INSERTs, UPDATES,
|
||||
SELECTs, etc. Each time your app hits the database, the query will be recorded.
|
||||
Note that the SQL recorded here may be :ref:`incorrectly quoted under SQLite
|
||||
<sqlite-connection-queries>`.
|
||||
|
||||
If you are using :doc:`multiple databases</topics/db/multi-db>`, you can use the
|
||||
same interface on each member of the ``connections`` dictionary::
|
||||
|
||||
@@ -704,16 +704,6 @@ can use the "pyformat" parameter style, where placeholders in the query
|
||||
are given as ``'%(name)s'`` and the parameters are passed as a dictionary
|
||||
rather than a list. SQLite does not support this.
|
||||
|
||||
.. _sqlite-connection-queries:
|
||||
|
||||
Parameters not quoted in ``connection.queries``
|
||||
-----------------------------------------------
|
||||
|
||||
``sqlite3`` does not provide a way to retrieve the SQL after quoting and
|
||||
substituting the parameters. Instead, the SQL in ``connection.queries`` is
|
||||
rebuilt with a simple string interpolation. It may be incorrect. Make sure
|
||||
you add quotes where necessary before copying a query into an SQLite shell.
|
||||
|
||||
.. _oracle-notes:
|
||||
|
||||
Oracle notes
|
||||
|
||||
@@ -510,6 +510,8 @@ Models
|
||||
|
||||
* Added support for referencing annotations in ``QuerySet.distinct()``.
|
||||
|
||||
* ``connection.queries`` shows queries with substituted parameters on SQLite.
|
||||
|
||||
CSRF
|
||||
^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user