mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Refs #14091 -- Fixed connection.queries on SQLite.
This commit is contained in:
parent
fc8a6a9b00
commit
4f6a7663bc
6 changed files with 60 additions and 51 deletions
|
@ -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
|
||||
^^^^
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue