From 83d0bdb299c50f3c069a19b31e2c390c1cbe4b5d Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Sun, 17 Sep 2023 11:20:06 +0200 Subject: [PATCH 1/2] add docs for SqlTraceTrait --- docs/en/index.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/en/index.rst b/docs/en/index.rst index 225670655..a91fb6207 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -316,3 +316,20 @@ Helper Functions * ``sql()`` Dumps out the SQL from an ORM query. * ``sqld()`` Dumps out the SQL from an ORM query, and exits. + +Tracing query execution +======================= + +Sometimes you need to know where specific queries are being executed in your app. +To get this kind of information you can add the ``SqlTraceTrait`` to your Table class like so:: + + use DebugKit\Model\Table\SqlTraceTrait; + + class CategoriesTable extends Table + { + use SqlTraceTrait; + } + +This will add the following information to the SQL log:: + + /* APP/Controller/CategoriesController.php (line 20) *) From a823997887bef31e927c6087a41be5a59294e83a Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Sun, 17 Sep 2023 11:22:49 +0200 Subject: [PATCH 2/2] adjust composer require docs --- docs/en/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/index.rst b/docs/en/index.rst index a91fb6207..8578c7f5d 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -20,7 +20,7 @@ you've removed it and want to re-install it, you can do so by running the following from your application's ROOT directory (where composer.json file is located):: - php composer.phar require --dev cakephp/debug_kit "~4.0" + php composer.phar require --dev cakephp/debug_kit "~5.0" Then, you need to enable the plugin by executing the following line::