Skip to content

Commit 83d0bdb

Browse files
committed
add docs for SqlTraceTrait
1 parent b4d7829 commit 83d0bdb

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

docs/en/index.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,20 @@ Helper Functions
316316

317317
* ``sql()`` Dumps out the SQL from an ORM query.
318318
* ``sqld()`` Dumps out the SQL from an ORM query, and exits.
319+
320+
Tracing query execution
321+
=======================
322+
323+
Sometimes you need to know where specific queries are being executed in your app.
324+
To get this kind of information you can add the ``SqlTraceTrait`` to your Table class like so::
325+
326+
use DebugKit\Model\Table\SqlTraceTrait;
327+
328+
class CategoriesTable extends Table
329+
{
330+
use SqlTraceTrait;
331+
}
332+
333+
This will add the following information to the SQL log::
334+
335+
/* APP/Controller/CategoriesController.php (line 20) *)

0 commit comments

Comments
 (0)