maximebf/traceable-pdo

This package is abandoned and no longer maintained. No replacement package was suggested.

Log SQL statements executed using a PDO instance

1.0 2013-08-17 02:16 UTC

This package is not auto-updated.

Last update: 2024-06-04 03:26:59 UTC


README

Build Status

Wrapper around PDO to provide information about executed statements.

$pdo = new TraceablePDO(new PDO($dsn));

$result = $pdo->query('select * from mytable');

$tracedStmt = $pdo->getLastTracedStatements();
printf("The last query took %sms to execute", $tracedStmt->getDuration());

Also provides a ProxyTraceablePDO for custom PDO sublasses. Wrap your custom PDO object inside it and property access and method calls will be forwarded.

Install using composer:

{
    "require": {
        "maximebf/traceable-pdo": "1.*"
    }
}