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.
fix fatal error on mysql error 1103 / incorrect table by @staabm in https://github.com/staabm/phpstan-dba/pull/447
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.48...0.2.49
fix phpdoc parsing with whitespaces/contents after values by @staabm in https://github.com/staabm/phpstan-dba/pull/438
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.47...0.2.48
Your coding agent can read these notes before it upgrades. Set up the MCP server →
added mysqli::execute_query() support (php 8.2+ only) by @staabm in https://github.com/staabm/phpstan-dba/pull/430
mysqli::execute_query() support (php 8.2+ only) by @staabm in https://github.com/staabm/phpstan-dba/pull/430@psalm-taint-escape sql by @staabm in https://github.com/staabm/phpstan-dba/pull/437Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.46...0.2.47
extract PhpDocUtil by @staabm in https://github.com/staabm/phpstan-dba/pull/435
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.45...0.2.46
Strip query comments by @marmichalski in https://github.com/staabm/phpstan-dba/pull/431
@phpstandba-inference-placeholder on calls via variable by @staabm in https://github.com/staabm/phpstan-dba/pull/434Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.44...0.2.45
better error message on setup problems by @staabm in https://github.com/staabm/phpstan-dba/pull/427
@phpstandba-inference-placeholder on static method calls by @staabm in https://github.com/staabm/phpstan-dba/pull/432Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.43...0.2.44
cover intersection type inference in tests by @staabm in https://github.com/staabm/phpstan-dba/pull/414
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.42...0.2.43
implement @phpstandba-inference-placeholder annotation by @staabm in https://github.com/staabm/phpstan-dba/pull/413
@phpstandba-inference-placeholder annotation by @staabm in https://github.com/staabm/phpstan-dba/pull/413Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.41...0.2.42
added php 7.3 support by @staabm in https://github.com/staabm/phpstan-dba/pull/369
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.40...0.2.41
prevent race conditions while writing cache file by @staabm in https://github.com/staabm/phpstan-dba/pull/406
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.39...0.2.40
improve compatibility with phpstan@bleedingEdge by @staabm in https://github.com/staabm/phpstan-dba/pull/404
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.38...0.2.39
don't analyse maybe existing data when QueryPlanAnalyzer::TABLES_WITHOUT_DATA by @staabm in https://github.com/staabm/phpstan-dba/pull/402
Consider supporting the project, so we can make this tool even better even faster for everyone.
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.37...0.2.38
handle UnresolvableQueryException in *Extensions and while Query Plan Analysis by @staabm in https://github.com/staabm/phpstan-dba/pull/399
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.36...0.2.37
support debugMode() in query plan analysis by @staabm in https://github.com/staabm/phpstan-dba/pull/398
debugMode() in query plan analysis by @staabm in https://github.com/staabm/phpstan-dba/pull/398Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.35...0.2.36
Query Plan Analysis: Reduce default numberOfRowsNotRequiringIndex to 0 by @staabm in https://github.com/staabm/phpstan-dba/pull/388
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.34...0.2.35
Fix QueryPlanAnalyser with dynamic offset and limit params by @keulinho in https://github.com/staabm/phpstan-dba/pull/390
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.33...0.2.34
docs by @staabm in https://github.com/staabm/phpstan-dba/pull/383
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.32...0.2.33
Within your phpstan-dba-bootstrap.php file, you can optionally enable query plan analysis. When enabled, phpstan-dba will error when queries are not u
phpstan-dba-bootstrap.php file, you can optionally enable query plan analysis.
When enabled, phpstan-dba will error when queries are not using indices or queries are inefficient.
DEMOnull to PDO default types by @staabm in https://github.com/staabm/phpstan-dba/pull/381Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.31...0.2.32
pgsql fixes for syntax error detection in some cases by @staabm in https://github.com/staabm/phpstan-dba/pull/379
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.30...0.2.31
PdoQueryReflector was marked as deprecated and PdoMysqlQueryReflector should be used as a 1:1 replacement instead
PdoQueryReflector was marked as deprecated and PdoMysqlQueryReflector should be used as a 1:1 replacement instead
PdoQueryReflector in the near future thoughFull Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.29...0.2.30
Added php 7.4 support by @staabm in https://github.com/staabm/phpstan-dba/pull/367
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.28...0.2.29
Added support for JSON datatype by @marmichalski in https://github.com/staabm/phpstan-dba/pull/360
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.27...0.2.28
Move ext-mysqli to require-dev by @marmichalski in https://github.com/staabm/phpstan-dba/pull/352
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.26...0.2.27
This is the first release which supports pgsql databases (beta quality).
This is the first release which supports pgsql databases (beta quality).
Early adopters can find a preliminary description on how to enable pgsql-support.
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.25...0.2.26
support mysql read concurrency with NOWAIT and SKIP LOCKED by @staabm in https://github.com/staabm/phpstan-dba/pull/344
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.24...0.2.25
placeholder count is not correct when quotes involved by @staabm in https://github.com/staabm/phpstan-dba/pull/337
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.23...0.2.24
PDOStatement generic types got simplified, to no longer include the previous technically necessary BOTH type
PdoStatementObjectType by @staabm in https://github.com/staabm/phpstan-dba/pull/322PdoStatement.stub by @staabm in https://github.com/staabm/phpstan-dba/pull/324PdoStatementColumnCountDynamicReturnTypeExtension by @staabm in https://github.com/staabm/phpstan-dba/pull/325MysqliResultObjectType by @staabm in https://github.com/staabm/phpstan-dba/pull/327Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.22...0.2.23
PDO: support PDOStatement::setFetchMode() by @staabm in https://github.com/staabm/phpstan-dba/pull/258
PDOStatement::setFetchMode() by @staabm in https://github.com/staabm/phpstan-dba/pull/258
PDO::FETCH_OBJ by @staabm in https://github.com/staabm/phpstan-dba/pull/318Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.21...0.2.22
implement ReplayAndRecordingQueryReflector by @staabm in https://github.com/staabm/phpstan-dba/pull/311
ReplayAndRecordingQueryReflector by @staabm in https://github.com/staabm/phpstan-dba/pull/311Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.20...0.2.21
Stabilize error/result in cache by @xPaw in https://github.com/staabm/phpstan-dba/pull/306
fetchAll(PDO::FETCH_KEY_PAIR) has incorrect return type with an extra array by @staabm in https://github.com/staabm/phpstan-dba/pull/307Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.19...0.2.20
implement type inference for union-types in sql queries by @staabm in https://github.com/staabm/phpstan-dba/pull/290
example:
$queries = ['SELECT adaid FROM ada', 'SELECT email FROM ada'];
foreach ($queries as $query) {
$stmt = $pdo->prepare($query);
$result = $stmt->fetch(PDO::FETCH_ASSOC);
assertType('array{adaid: int<0, 4294967295>}|array{email: string}|false', $result);
}
PDO::FETCH_COLUMN in fetch() by @staabm in https://github.com/staabm/phpstan-dba/pull/302PDO::FETCH_COLUMN in fetchAll() by @staabm in https://github.com/staabm/phpstan-dba/pull/301PDO::FETCH_KEY_PAIR support by @staabm in https://github.com/staabm/phpstan-dba/pull/303PDO::FETCH_CLASS support on fetch*(), fetchObject() by @staabm in https://github.com/staabm/phpstan-dba/pull/304PDOStatement->fetch() may return false if there no is no data even in exception mode by @staabm in https://github.com/staabm/phpstan-dba/pull/281tests/ from releases by @staabm in https://github.com/staabm/phpstan-dba/pull/288PDO->query() test coverage by @staabm in https://github.com/staabm/phpstan-dba/pull/293Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.18...0.2.19
Introduce PDO based QueryReflector by @p4veI in https://github.com/staabm/phpstan-dba/pull/261
QueryReflector by @p4veI in https://github.com/staabm/phpstan-dba/pull/261
MysqliReflector, but it will provide our base for getting PGSQL supportSyntaxErrorInQueryMethodRule: allow abstract classes in "classMethods" by @voku in https://github.com/staabm/phpstan-dba/pull/234MysqliReflector by @staabm in https://github.com/staabm/phpstan-dba/pull/284--debug by @staabm in https://github.com/staabm/phpstan-dba/pull/285Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.17...0.2.18
Prototype support for bindValue/bindParam on PDOStatement by @xPaw in https://github.com/staabm/phpstan-dba/pull/265
RuntimeConfiguration->defaultFetchMode() option by @xPaw in https://github.com/staabm/phpstan-dba/pull/256implode() of constant values by @staabm in https://github.com/staabm/phpstan-dba/pull/239PdoStatementReflection->getStatementResultType() for re-use by @staabm in https://github.com/staabm/phpstan-dba/pull/257PdoStatementExecuteTypeSpecifyingExtension by @staabm in https://github.com/staabm/phpstan-dba/pull/259PdoStatementReflection by @staabm in https://github.com/staabm/phpstan-dba/pull/263PdoStatementReflection by @staabm in https://github.com/staabm/phpstan-dba/pull/264PDOStatement generic by @staabm in https://github.com/staabm/phpstan-dba/pull/268Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.16...0.2.17
Use fixed date in QuerySimulation by @staabm in https://github.com/staabm/phpstan-dba/pull/249
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.15...0.2.16
Doctrine Dbal: fetchOne() can return false by @staabm in https://github.com/staabm/phpstan-dba/pull/242
fetchOne() can return false by @staabm in https://github.com/staabm/phpstan-dba/pull/242Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.14...0.2.15
fixed RecordingQueryReflector by @staabm in https://github.com/staabm/phpstan-dba/pull/240
RecordingQueryReflector by @staabm in https://github.com/staabm/phpstan-dba/pull/240Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.13...0.2.14
ReflectionCache::load() is deprecated by @staabm in https://github.com/staabm/phpstan-dba/pull/235
stringifyTypes to RuntimeConfiguration option by @staabm in https://github.com/staabm/phpstan-dba/pull/227ReflectionCache::load() is deprecated by @staabm in https://github.com/staabm/phpstan-dba/pull/235Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.12...0.2.13
added Stringable object support by @staabm in https://github.com/staabm/phpstan-dba/pull/229
IntersectionType support by @staabm in https://github.com/staabm/phpstan-dba/pull/228Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.11...0.2.12
removed code duplication by @staabm in https://github.com/staabm/phpstan-dba/pull/219
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.10...0.2.11
Update README.md by @staabm in https://github.com/staabm/phpstan-dba/pull/218
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.9...0.2.10
Doctrine DBAL Type Inference for
Doctrine DBAL Type Inference for
Result->iterateKeyValueResult->fetchAllKeyValueConnection->iterateKeyValueConnection->fetchAllKeyValueSee progress on https://github.com/staabm/phpstan-dba/issues/197
fetchAllKeyValue & iterateKeyValue on Result by @staabm in https://github.com/staabm/phpstan-dba/pull/215fetchAllKeyValue & iterateKeyValue on Connection by @staabm in https://github.com/staabm/phpstan-dba/pull/216Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.8...0.2.9
Update README.md by @staabm in https://github.com/staabm/phpstan-dba/pull/211
iterateAllNumeric from Connection by @staabm in https://github.com/staabm/phpstan-dba/pull/212Result->* type inference by @staabm in https://github.com/staabm/phpstan-dba/pull/214Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.7...0.2.8
Doctrine DBAL Type Inference for
Doctrine DBAL Type Inference for
Connection->fetchOne()Connection->fetchFirstColumn()Connection->iterateColumn()Connection->fetchAllNumeric()Connection->fetchAllAssociative()Result->fetchFirstColumn()See progress on https://github.com/staabm/phpstan-dba/issues/197
Connection->fetchOne() by @staabm in https://github.com/staabm/phpstan-dba/pull/208Connection->fetchFirstColumn(), Result->fetchFirstColumn() by @staabm in https://github.com/staabm/phpstan-dba/pull/209Connection->iterateColumn() by @staabm in https://github.com/staabm/phpstan-dba/pull/210Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.6...0.2.7
doctrine-dbal: added executeQuery() and executeCacheQuery() type inference by @staabm in https://github.com/staabm/phpstan-dba/pull/191
executeQuery() and executeCacheQuery() type inference by @staabm in https://github.com/staabm/phpstan-dba/pull/191Doctrine\DBAL\Statement type inferrence by @staabm in https://github.com/staabm/phpstan-dba/pull/192fetchAssocitive() and fetchNumeric() on Connection by @staabm in https://github.com/staabm/phpstan-dba/pull/193iterateAssociative and iterateNumeric on Connection by @staabm in https://github.com/staabm/phpstan-dba/pull/194fetchAssociative() and fetchNumeric() both can return false by @staabm in https://github.com/staabm/phpstan-dba/pull/195Parameter object by @staabm in https://github.com/staabm/phpstan-dba/pull/182PlaceholderValidation by @staabm in https://github.com/staabm/phpstan-dba/pull/183Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.5...0.2.6
disable generic type check for stubbed generic classes by @staabm in https://github.com/staabm/phpstan-dba/pull/180
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.4...0.2.5
doctrine-dbal: cover all EntityManagerInterface query methods by @staabm in https://github.com/staabm/phpstan-dba/pull/173
EntityManagerInterface query methods by @staabm in https://github.com/staabm/phpstan-dba/pull/173OFFSET after LIMIT by @staabm in https://github.com/staabm/phpstan-dba/pull/178Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.3...0.2.4
when debugMode is enabled via RuntimeConfiguration phpstan-dba now reports which queries could not be analyzed, because of unknown types. this should
debugMode is enabled via RuntimeConfiguration phpstan-dba now reports which queries could not be analyzed, because of unknown types. this should help to get an overview which queries are covered by the tool.Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.2...0.2.3
Github Actions: remove --no-suggest by @staabm in https://github.com/staabm/phpstan-dba/pull/157
--no-suggest by @staabm in https://github.com/staabm/phpstan-dba/pull/157Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.1...0.2.2
RuntimeConfiguration: Allow opt-in for bool handling by @staabm in https://github.com/staabm/phpstan-dba/pull/148
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2...0.2.1
Support \Doctrine\DBAL\Connection->query() syntax error checking by @staabm in https://github.com/staabm/phpstan-dba/pull/66
\Doctrine\DBAL\Connection->query() syntax error checking by @staabm in https://github.com/staabm/phpstan-dba/pull/66Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.12...0.1.13
support named placeholders in LIMIT clause by @staabm in https://github.com/staabm/phpstan-dba/pull/101
MysqliQueryReflector to reduce numer of executed queries by @staabm in https://github.com/staabm/phpstan-dba/pull/103Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.11...0.1.12
fixed error with placeholders in LIMIT clause by @staabm in https://github.com/staabm/phpstan-dba/pull/99
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.10...0.1.11
reduce the risk of possible concurrency issues in ReflectionCache by @staabm in https://github.com/staabm/phpstan-dba/pull/97
ReflectionCache by @staabm in https://github.com/staabm/phpstan-dba/pull/97Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.9...0.1.10
more fine grained ReflectionCache change-detection by @staabm in https://github.com/staabm/phpstan-dba/pull/96
ReflectionCache change-detection by @staabm in https://github.com/staabm/phpstan-dba/pull/96Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.8...0.1.9
make RecordingQueryReflector work, without the need to pass --debug by @staabm in https://github.com/staabm/phpstan-dba/pull/95
RecordingQueryReflector work, without the need to pass --debug by @staabm in https://github.com/staabm/phpstan-dba/pull/95Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.7...0.1.8
prepared statements: don't error on unknown types by @staabm in https://github.com/staabm/phpstan-dba/pull/89
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.6...0.1.7
via RuntimeConfiguration you can enable a debugMode which leads to more information, in case of errors
RuntimeConfiguration you can enable a debugMode which leads to more information, in case of errorsSyntaxErrorInPreparedStatementMethodRule can now be used with PreparedStatement objects __construct():services:
-
class: staabm\PHPStanDba\Rules\SyntaxErrorInPreparedStatementMethodRule
tags: [phpstan.rules.rule]
arguments:
classMethods:
- 'staabm\PHPStanDba\Tests\Fixture\PreparedStatement::__construct'
RecordingQueryReflector to work phpstan and phpunit in tandem by @staabm in https://github.com/staabm/phpstan-dba/pull/82construct()-methods in SyntaxErrorInPreparedStatementMethodRule by @staabm in https://github.com/staabm/phpstan-dba/pull/88Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.5...0.1.6
see phpstan-dba in action on the DEMO-PR
see phpstan-dba in action on the DEMO-PR
SyntaxErrorInPreparedStatementMethodRule within your PHPStan configuration to detect syntax errors in prepared queries, by registering a service:services:
-
class: staabm\PHPStanDba\Rules\SyntaxErrorInPreparedStatementMethodRule
tags: [phpstan.rules.rule]
arguments:
classMethods:
- 'My\Connection::preparedQuery'
PdoStatementExecuteErrorMethodRule -> PdoStatementExecuteMethodRule by @staabm in https://github.com/staabm/phpstan-dba/pull/76RuntimeConfiguration use-statements by @staabm in https://github.com/staabm/phpstan-dba/pull/75RecordingQueryReflector for prepared statements by @staabm in https://github.com/staabm/phpstan-dba/pull/79SyntaxErrorInPreparedStatementMethodRule by @staabm in https://github.com/staabm/phpstan-dba/pull/78Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.4...0.1.5
see phpstan-dba in action on the DEMO-PR
see phpstan-dba in action on the DEMO-PR
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.3...0.1.4
see phpstan-dba in action on the DEMO-PR
see phpstan-dba in action on the DEMO-PR
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.1.2...0.1.3
One column per quarter.