PHPackages                             sagrmore/indexpilot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sagrmore/indexpilot

ActiveLibrary[Database &amp; ORM](/categories/database)

sagrmore/indexpilot
===================

Framework-independent SQL index analysis and query optimization toolkit with first-class Laravel integration

v1.0.0(1mo ago)70MITPHPPHP ^8.1CI passing

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/sagrmore/indexpilot)[ Packagist](https://packagist.org/packages/sagrmore/indexpilot)[ Docs](https://github.com/sagrmore/indexpilot)[ GitHub Sponsors](https://github.com/sponsors/sagrmore)[ RSS](/packages/sagrmore-indexpilot/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

IndexPilot
==========

[](#indexpilot)

Framework-independent SQL index analysis and query optimization toolkit with first-class Laravel integration.

[![CI](https://github.com/sagrmore/indexpilot/actions/workflows/ci.yml/badge.svg)](https://github.com/sagrmore/indexpilot/actions/workflows/ci.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/4150ac0b8d1e5449e1bfd11ba30f2a8947f3b8e1716d00ed9ae5728382cb1c16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736167726d6f72652f696e64657870696c6f742e737667)](https://packagist.org/packages/sagrmore/indexpilot)[![Total Downloads](https://camo.githubusercontent.com/ac1563500a425694c48e2c5419abdd6bdf946f2ecbe55e2c6bd96f5a05151415/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736167726d6f72652f696e64657870696c6f742e737667)](https://packagist.org/packages/sagrmore/indexpilot)[![License](https://camo.githubusercontent.com/12b752d5eed1fcfaafa1a1584b8714da85094bed36247b9f3be6659d51a0d802/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736167726d6f72652f696e64657870696c6f742e737667)](https://packagist.org/packages/sagrmore/indexpilot)[![PHP Version](https://camo.githubusercontent.com/391edd09532e6bf42bafb7dda3388f04e632ca7c51718abc1fc0d988c41372c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736167726d6f72652f696e64657870696c6f742e737667)](https://packagist.org/packages/sagrmore/indexpilot)

IndexPilot analyzes SQL workloads, applies explainable recommendation rules, and renders reports (JSON, Markdown, HTML, SARIF, console) for local development and CI.

**User documentation:** start with the [Enterprise User Guide](docs/user-guide.md) — install, DB connection, Eloquent vs plain SQL, reports, CI, and production posture.

Requirements
------------

[](#requirements)

ComponentVersionPHP8.1, 8.2, 8.3, 8.4Laravel (optional)10.x, 11.x, 12.x, 13.x### Database engines

[](#database-engines)

EngineStatusMySQL 8+**Production** (reference driver)MariaDB 10.5+**Production** (first-class driver)PostgreSQL 13+**Production**SQLite 3.35+**Production** (embedded / local)SQL Server 2019+**Production** (`pdo_sqlsrv`)See [`docs/engineering/DATABASE_SUPPORT_MATRIX.md`](docs/engineering/DATABASE_SUPPORT_MATRIX.md) and [`docs/certification/`](docs/certification/).

Installation
------------

[](#installation)

```
composer require sagrmore/indexpilot
```

Laravel auto-discovers the service provider and `IndexPilot` facade.

Publish config (optional):

```
php artisan vendor:publish --tag=indexpilot-config
```

Standalone CLI (Composer bin):

```
vendor/bin/indexpilot version
vendor/bin/indexpilot doctor
```

Quick Start
-----------

[](#quick-start)

### PHP API

[](#php-api)

```
use IndexPilot\Laravel\Facades\IndexPilot;

$result = IndexPilot::analyze('SELECT id FROM users WHERE email = ?', ['a@example.com']);
echo $result->getScore();

$report = IndexPilot::builder()
    ->queries(['SELECT * FROM orders WHERE status = ?'])
    ->toReport('markdown');
```

### Artisan

[](#artisan)

```
php artisan indexpilot:analyze "SELECT * FROM users WHERE email = ?" --format=json
php artisan indexpilot:report --file=workload.sql --format=sarif --output=storage/app/indexpilot.sarif
php artisan indexpilot:doctor
php artisan indexpilot:rules
```

### Standalone CLI

[](#standalone-cli)

```
vendor/bin/indexpilot analyze --file=queries.sql --format=sarif --fail-on-findings
vendor/bin/indexpilot report --stdin --format=html --output=report.html
```

Configuration
-------------

[](#configuration)

VariableDefaultDescription`INDEXPILOT_ENABLED``true`Master package switch`INDEXPILOT_CONNECTION``null`Database connection for analysis`INDEXPILOT_COLLECTOR_ENABLED``false`Enable Laravel query listener`INDEXPILOT_MIN_CONFIDENCE``0.5`Minimum recommendation confidence`INDEXPILOT_REDACT_BINDINGS``true`Redact sensitive binding valuesFull schema: [`config/indexpilot.php`](config/indexpilot.php).
**Operators:** see the [Enterprise User Guide](docs/user-guide.md) for end-to-end usage.

Documentation
-------------

[](#documentation)

GuidePath**Enterprise User Guide**[`docs/user-guide.md`](docs/user-guide.md)Laravel integration[`docs/laravel-integration.md`](docs/laravel-integration.md)CLI design[`docs/engineering/cli-design.md`](docs/engineering/cli-design.md)Reporting[`docs/engineering/reporting-engine.md`](docs/engineering/reporting-engine.md)Release readiness[`docs/engineering/release-readiness-review.md`](docs/engineering/release-readiness-review.md)Database support matrix[`docs/engineering/DATABASE_SUPPORT_MATRIX.md`](docs/engineering/DATABASE_SUPPORT_MATRIX.md)MySQL certification[`docs/certification/mysql.md`](docs/certification/mysql.md)MariaDB certification[`docs/certification/mariadb.md`](docs/certification/mariadb.md)PostgreSQL certification[`docs/certification/postgresql.md`](docs/certification/postgresql.md)SQLite certification[`docs/certification/sqlite.md`](docs/certification/sqlite.md)SQL Server certification[`docs/certification/sqlserver.md`](docs/certification/sqlserver.md)Troubleshooting[`docs/troubleshooting.md`](docs/troubleshooting.md)Upgrade notes[`docs/UPGRADE.md`](docs/UPGRADE.md)Architecture / ADRs[`docs/`](docs/) · [`docs/adr/`](docs/adr/)Architecture
------------

[](#architecture)

Hexagonal layout: framework-agnostic core + thin Laravel/CLI adapters. Architecture status: **FROZEN** (see [`docs/engineering/PROJECT_STATE.md`](docs/engineering/PROJECT_STATE.md)).

Testing
-------

[](#testing)

```
composer test              # Unit + Feature + Contract + Integration + Architecture + Regression
composer test:unit
composer test:feature
composer test:architecture
composer test:regression   # Golden recommendation suite
composer test:benchmark    # Opt-in: INDEXPILOT_RUN_BENCHMARKS=true
composer quality           # Local maintainer gate (includes Pint)
composer quality:ci        # CI-oriented gate without format rewrites
```

CI matrix: PHP 8.1–8.4 × Laravel 10–13, plus **mandatory** database integration gates:

JobService / notesMySQL 8 Integration`mysql:8.0`MariaDB 10.11 Integration`mariadb:10.11`PostgreSQL 16 Integration`postgres:16`SQLite Integration`pdo_sqlite` (`:memory:` / DSN)SQL Server 2022 Integration`mcr.microsoft.com/mssql/server:2022-CU25-ubuntu-22.04` + `pdo_sqlsrv`Live DB tests require:

EngineVariablesMySQL`INDEXPILOT_TEST_MYSQL_DSN`, `INDEXPILOT_TEST_MYSQL_USER`, `INDEXPILOT_TEST_MYSQL_PASSWORD`MariaDB`INDEXPILOT_TEST_MARIADB_DSN`, `INDEXPILOT_TEST_MARIADB_USER`, `INDEXPILOT_TEST_MARIADB_PASSWORD`PostgreSQL`INDEXPILOT_TEST_PGSQL_DSN`, `INDEXPILOT_TEST_PGSQL_USER`, `INDEXPILOT_TEST_PGSQL_PASSWORD`SQLite`INDEXPILOT_TEST_SQLITE_DSN` (optional; default `sqlite::memory:`)SQL Server`INDEXPILOT_TEST_SQLSRV_DSN`, `INDEXPILOT_TEST_SQLSRV_USER`, `INDEXPILOT_TEST_SQLSRV_PASSWORD`, `INDEXPILOT_TEST_SQLSRV_DATABASE`Known limitations (v1.0.0)
--------------------------

[](#known-limitations-v100)

- `IndexPilot::extend()` is not implemented yet
- Standalone CLI `--engine` is a connection hint without opening a live PDO driver by itself
- PHP CLI config files are executed via `require` and must be trusted (prefer JSON in CI)

Contributing
------------

[](#contributing)

Please read [`CONTRIBUTING.md`](CONTRIBUTING.md) before submitting a pull request.

Security
--------

[](#security)

If you discover a security vulnerability, please review our [`SECURITY.md`](SECURITY.md) policy.

License
-------

[](#license)

The MIT License (MIT). See [`LICENSE`](LICENSE) for details.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9723bd44c5aa5a526e908de274ddb49cdf87c8a9f5441a5c5370463c34ea48ba?d=identicon)[sagrmore](/maintainers/sagrmore)

---

Top Contributors

[![sagrmore](https://avatars.githubusercontent.com/u/13677079?v=4)](https://github.com/sagrmore "sagrmore (38 commits)")

---

Tags

clilaraveldatabaseperformancemysqlsqlitepostgresqlmariadbsqlserverindexoptimizationexplainsarifquery-analysis

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sagrmore-indexpilot/health.svg)

```
[![Health](https://phpackages.com/badges/sagrmore-indexpilot/health.svg)](https://phpackages.com/packages/sagrmore-indexpilot)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.9k624.3M7.6k](/packages/doctrine-dbal)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.8k40.0k](/packages/matomo-matomo)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.2k47.7M734](/packages/spatie-laravel-medialibrary)[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[cycle/database

DBAL, schema introspection, migration and pagination

71853.9k80](/packages/cycle-database)[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

2517.5k](/packages/perplorm-perpl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
