ascetic-soft/rowcast-profiler

SQL query profiler for Rowcast via ConnectionInterface decoration

Maintainers

Package info

github.com/ascetic-soft/RowcastProfiler

pkg:composer/ascetic-soft/rowcast-profiler

Statistics

Installs: 1

Dependents: 1

Suggesters: 1

Stars: 0

Open Issues: 0

1.0.0 2026-04-26 05:51 UTC

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