NewYour coding agent can read the release notes before it upgrades.Set up the MCP server β
Packagist, #2795 most downloaded on Packagist
PHPStan based SQL static analysis and type inference for the database access layer
Latest stable
0.5.4
Last release 16 days ago
06 Nov 2026
Ships unpredictably
gaps range from 9 days to 10 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
127 releases Β· first in 2022
Drag across the ruler to compare, or tap a release to open it.
Initial prepared statement support π₯³
PDOStatement->columnCount() by @staabm in https://github.com/staabm/phpstan-dba/pull/42false from return types, when error mode is exception by @staabm in https://github.com/staabm/phpstan-dba/pull/49ParametersAcceptorSelector by @staabm in https://github.com/staabm/phpstan-dba/pull/48QueryReflection->resolvePreparedQuerystring() by @staabm in https://github.com/staabm/phpstan-dba/pull/54MysqliQueryDynamicReturnTypeExtension by @staabm in https://github.com/staabm/phpstan-dba/pull/55PdoStatementFetchDynamicReturnTypeExtension by @staabm in https://github.com/staabm/phpstan-dba/pull/57PdoStatementReflection by @staabm in https://github.com/staabm/phpstan-dba/pull/59PdoStatementExecuteErrorMethodRule by @staabm in https://github.com/staabm/phpstan-dba/pull/58Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.1...0.1.2
Your coding agent can read these notes before it upgrades. Set up the MCP server β
refactoring: separated mysqli-escape tests by @staabm in https://github.com/staabm/phpstan-dba/pull/39
PDOStatement->fetchAll() by @staabm in https://github.com/staabm/phpstan-dba/pull/40PDOStatement::fetch() by @staabm in https://github.com/staabm/phpstan-dba/pull/41Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1...0.1.1
phpstan-dba learned to re-analyse only such code which depends on the database schema. that way not all code needs to be re-analyzed and you get faste
phpstan-dba learned to re-analyse only such code which depends on the database schema. that way not all code needs to be re-analyzed and you get faster runs after database changes.
If you build custom rules or extensions on top of phpstan-dba database schema reflection APIs, you might need to add DbSchemaResultCacheMetaExtension::trackSchemaDependency($scope); - like I did for phpstan-dba itself.
Before this release the whole result-cache was invalidated on every database schema change.
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.14...0.5
fixing phpstan deprecation errors by @bnowak in https://github.com/staabm/phpstan-dba/pull/755
ReflectionProvider->hasClass() checks by @staabm in https://github.com/staabm/phpstan-dba/pull/758Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.3.6...0.4
This release required some fundamental time consuming internal changes and cleanups. please consider supporting my freetime open source work with your
This release required some fundamental time consuming internal changes and cleanups. please consider supporting my freetime open source work with your sponsoring π
instanceof *Type checks by @staabm in https://github.com/staabm/phpstan-dba/pull/692Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.85...0.3
doctrine dbal: cover deprecated api by @staabm in https://github.com/staabm/phpstan-dba/pull/117
Doctrine\DBAL\Connection::execute*() methods by @staabm in https://github.com/staabm/phpstan-dba/pull/116countPlaceholders() and extractNamedPlaceholders() into QueryReflection by @staabm in https://github.com/staabm/phpstan-dba/pull/118SyntaxErrorInQueryMethodRule by @staabm in https://github.com/staabm/phpstan-dba/pull/119PDOStatement->execute() analysis by @staabm in https://github.com/staabm/phpstan-dba/pull/138SyntaxErrorInPreparedStatementMethodRule by @staabm in https://github.com/staabm/phpstan-dba/pull/140Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.13...0.2
This intial release provides following features:
This intial release provides following features:
PDOStatement and mysqli_result
mysqli_query, mysqli->query, PDO->query and PDO->preparePDO->prepare knows the array shape of the returned results and therefore can return a generic PDOStatementmysqli->query knows the array shape of the returned results and therefore can return a generic mysqli_resultSyntaxErrorInQueryMethodRule can inspect sql queries and detect syntax errors - SyntaxErrorInQueryFunctionRule can do the same for functions
mysqli_query, mysqli->query, PDO->query and PDO->preparemysqli_real_escape_string and mysqli->real_escape_string dynamic return type extensionspdo->quote dynamic return type extensionsee the unit-testsuite to get a feeling about the current featureset.
Its really early days... and this libs has a few rough edges.
One column per quarter.