ascetic-soft / rowcast-profiler
SQL query profiler for Rowcast via ConnectionInterface decoration
1.0.0
2026-04-26 05:51 UTC
Requires
- php: >=8.4
- ext-pdo: *
- ascetic-soft/rowcast: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-04-26 05:54:04 UTC
README
Lightweight SQL profiler for Rowcast: wraps AsceticSoft\Rowcast\ConnectionInterface to record timings, parameters (sanitized), errors, and simple aggregates.
Install
composer require ascetic-soft/rowcast-profiler
Usage
use AsceticSoft\Rowcast\Connection; use AsceticSoft\RowcastProfiler\ConnectionProfiler; use AsceticSoft\RowcastProfiler\InMemoryQueryProfileStore; use AsceticSoft\RowcastProfiler\DefaultParameterSanitizer; use AsceticSoft\RowcastProfiler\RowcastProfiler; $inner = Connection::create('sqlite::memory:'); $store = new InMemoryQueryProfileStore(); $sanitizer = new DefaultParameterSanitizer(); $profiler = new RowcastProfiler($store, $sanitizer, slowQueryThresholdMs: 50.0, maxQueries: 500); $connection = new ConnectionProfiler($inner, $profiler); $connection->fetchOne('SELECT 1'); foreach ($store->getProfiles() as $profile) { echo $profile->sql, ' ', $profile->durationMs, "ms\n"; }
Symfony: enable rowcast.profiler in RowcastBundle (see bundle docs).
Packagist / versioning
The root composer.json may include a "version": "1.0.0" field so path repositories and CI resolve a stable ^1.0 constraint. Remove that field when tagging releases on GitHub/Packagist (tags define the version).
License
MIT