maximebf/traceable-pdo

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-03-12 02:11:41 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.*"
    }
}