Skip to content

Commit ec136ce

Browse files
committed
Fixed #13101 -- Added multi-db info about debugging queries. Thanks to David Fischer for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent ccf5bb1 commit ec136ce

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/faq/models.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,17 @@ of dictionaries in order of query execution. Each dictionary has the following::
2525
``connection.queries`` includes all SQL statements -- INSERTs, UPDATES,
2626
SELECTs, etc. Each time your app hits the database, the query will be recorded.
2727
Note that the raw SQL logged in ``connection.queries`` may not include
28-
parameter quoting. Parameter quoting is performed by the database-specific
28+
parameter quoting. Parameter quoting is performed by the database-specific
2929
backend, and not all backends provide a way to retrieve the SQL after quoting.
3030

31+
.. versionadded:: 1.2
32+
33+
If you are using :ref:`multiple databases<topics-db-multi-db>`, you can use the
34+
same interface on each member of the ``connections`` dictionary::
35+
36+
>>> from django.db import connections
37+
>>> connections['my_db_alias'].queries
38+
3139
Can I use Django with a pre-existing database?
3240
----------------------------------------------
3341

0 commit comments

Comments
 (0)