maximebf / traceable-pdo
Log SQL statements executed using a PDO instance
Installs: 26 833
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-06-04 03:26:59 UTC
README
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.*"
}
}