Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

antonmarin/traceable-pdo

Repository files navigation

traceable-pdo

Adds trace to your sql statement

Build Status Latest Stable Version License

Code Climate Test Coverage Total Downloads

Usage

When you use traceablePDO\PDO your statement looks like SELECT 1 /* eJxT0NdSKM7PTVUoKUpMTlUoLinKzEtX0NIHAF05B60= */ so to get trace you should just enter in your terminal php -r 'echo gzuncompress(base64_decode("eJxT0NdSKM7PTVUoKUpMTlUoLinKzEtX0NIHAF05B60="));'

Examples

Yii2

config/main.php

...
    'db' => [
        'class' => yii\db\Connection::class,
        'dsn' => 'mysql:host=localhost;dbname=stay2',
        'username' => 'root',
        'password' => 'pass',
        'charset' => 'utf8',
        'pdoClass' => antonmarin\TraceablePDO\PDO::class, // this line adds traces
    ],
...

About

Adds trace to sql statement. Know the source of your queries!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages