From 247e7407a05c8e57c67d41d4861ec006b52088e5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 18 Nov 2023 08:53:01 +0900 Subject: [PATCH] docs: change sample code to be more practical --- user_guide_src/source/database/events.rst | 4 +++- user_guide_src/source/database/events/001.php | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/database/events.rst b/user_guide_src/source/database/events.rst index 08fe73b09081..8cefcad22dbf 100644 --- a/user_guide_src/source/database/events.rst +++ b/user_guide_src/source/database/events.rst @@ -21,6 +21,8 @@ DBQuery This event is triggered whenever a new query has been run, whether successful or not. The only parameter is a :doc:`Query ` instance of the current query. You could use this to display all queries in STDOUT, or logging to a file, or even creating tools to do automatic query analysis to help you spot -potentially missing indexes, slow queries, etc. An example usage might be: +potentially missing indexes, slow queries, etc. + +An example usage might be: .. literalinclude:: events/001.php diff --git a/user_guide_src/source/database/events/001.php b/user_guide_src/source/database/events/001.php index 4461b715af19..ed2bb1fcec43 100644 --- a/user_guide_src/source/database/events/001.php +++ b/user_guide_src/source/database/events/001.php @@ -1,4 +1,18 @@