Do you use pgbabger or pg_stat_statements ? And sometimes it can be difficult to understand which code generates the request? yii2-query-tag will help!
Before:
SELECT * FROM page WHERE 1=1After:
SELECT /* ExampleTest:11 UnitHelper:28 Step:218 */ * FROM page WHERE 1=1- Production ready/safe/tested
- Saves team time
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist pastuhov/yii2-query-tag
or add
"require-dev": {
"pastuhov/yii2-query-tag": "~1.1.0"
...
to the require section of your composer.json file.
Change your app config:
'components' => [
'db' => [
'class' => \yii\db\Connection::class,
'commandClass' => \pastuhov\querytag\Command::class, // <-- add this lineExtend query tag command class:
namespace app\components;
class Command extends \pastuhov\querytag\Command
{
public $customTag = 'master';
public $enabledTags = [
self::TAG_TYPE_CUSTOM,
self::TAG_TYPE_TRACE,
];
}./vendor/bin/codecept runIf you discover any security related issues, please email pastukhov_k@sima-land.ru instead of using the issue tracker.

