NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
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.
mysqli: Add support for procedural mysqli_fetch_foo functions by @bpfoley in https://github.com/staabm/phpstan-dba/pull/821
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.5.3...0.5.4
mysqli_result->fetch_assoc() can return false or null by @staabm in https://github.com/staabm/phpstan-dba/pull/820
mysqli_result->fetch_assoc() can return false or null by @staabm in https://github.com/staabm/phpstan-dba/pull/820Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.5.2...0.5.3
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Utilize phpstan-src constant string inference when possible by @staabm in https://github.com/staabm/phpstan-dba/pull/819
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.5.1...0.5.2
Support mysqli_result->fetch_assoc() and mysqli_result->fetch_all() by @staabm in https://github.com/staabm/phpstan-dba/pull/815
mysqli_result->fetch_assoc() and mysqli_result->fetch_all() by @staabm in https://github.com/staabm/phpstan-dba/pull/815Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.5...0.5.1
Report ambiguous using column MySQL error by @hemberger in https://github.com/staabm/phpstan-dba/pull/808
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.13...0.4.14
Fix composer.json typo by @staabm in https://github.com/staabm/phpstan-dba/pull/806
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.12...0.4.13
doctrine/dbal is optional by @staabm in https://github.com/staabm/phpstan-dba/pull/805
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.11...0.4.12
Make the MySQL schema hash deterministic, and let it cover the column order by @ArtemGoutsoul in https://github.com/staabm/phpstan-dba/pull/803
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.10...0.4.11
Add PostgreSQL schema hashing by @oiahoon in https://github.com/staabm/phpstan-dba/pull/802
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.9...0.4.10
ReplayAndRecordingQueryReflector workflows should be considerably faster after the cache has been built. 🏎️
ReplayAndRecordingQueryReflector workflows should be considerably faster after the cache has been built. 🏎️
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.8...0.4.9
Use single global transaction per process by @staabm in https://github.com/staabm/phpstan-dba/pull/798
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.7...0.4.8
Add GroupConcatReturnTypeExtension inferring string|null for GROUP_CONCAT by @ArtemGoutsoul in https://github.com/staabm/phpstan-dba/pull/796
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.6...0.4.7
Fix Pgsql support with DbSchemaResultCacheMetaExtension by @staabm in https://github.com/staabm/phpstan-dba/pull/794
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.5...0.4.6
When running phpstan-dba against a MySQL backend, the PHPStan result cache will be automatically invalidated on database schema changes.
When running phpstan-dba against a MySQL backend, the PHPStan result cache will be automatically invalidated on database schema changes.
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.4...0.4.5
When running phpstan-dba against a MySQL backend, the PHPStan result cache will be automatically invalidated on database schema changes.
When running phpstan-dba against a MySQL backend, the PHPStan result cache will be automatically invalidated on database schema changes.
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.3...0.4.4
fix: support PDOStatement subclasses in PdoStatementExecuteMethodRule by @vaielab in https://github.com/staabm/phpstan-dba/pull/773
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.2...0.4.3
Add support for StaticCall by @xPaw in https://github.com/staabm/phpstan-dba/pull/766
StaticCall by @xPaw in https://github.com/staabm/phpstan-dba/pull/766Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4.1...0.4.2
Prevent endless loop in QuerySimulation by @staabm in https://github.com/staabm/phpstan-dba/pull/763
QuerySimulation by @staabm in https://github.com/staabm/phpstan-dba/pull/763Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.4...0.4.1
Prevent false-positives in placeholder validation by @staabm in https://github.com/staabm/phpstan-dba/pull/752
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.3.5...0.3.6
Fix type when using \PDO::FETCH_OBJ on iteration by @staabm in https://github.com/staabm/phpstan-dba/pull/751
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.3.4...0.3.5
Support spread operator in prepared statement parameter expressions by @staabm in https://github.com/staabm/phpstan-dba/pull/750
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.3.3...0.3.4
PreviousConnectingVisitor: Utilize WeakReference to assist garbage collector by @staabm in https://github.com/staabm/phpstan-dba/pull/730
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.3.2...0.3.3
🚀 Reduce the overhead in big projects by more than 50%
🚀 Reduce the overhead in big projects by more than 50%
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.3.1...0.3.2
doctrine-dbal might return list by @staabm in https://github.com/staabm/phpstan-dba/pull/720
list by @staabm in https://github.com/staabm/phpstan-dba/pull/720Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.3...0.3.1
Support # comments by @staabm in https://github.com/staabm/phpstan-dba/pull/696
# comments by @staabm in https://github.com/staabm/phpstan-dba/pull/696Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.84...0.2.85
Support iterable typed parameter by @staabm in https://github.com/staabm/phpstan-dba/pull/693
iterable typed parameter by @staabm in https://github.com/staabm/phpstan-dba/pull/693Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.83...0.2.84
Keep sqlftw/sqlftw a optional dependency by @staabm in https://github.com/staabm/phpstan-dba/pull/690
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.82...0.2.83
Fix PHPStan deprecations by @staabm in https://github.com/staabm/phpstan-dba/pull/683
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.81...0.2.82
Fix nikic/php-parser deprecation warnings by @staabm in https://github.com/staabm/phpstan-dba/pull/655
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.80...0.2.81
FetchAll actually returns list of results, not an array per se. by @patrickkusebauch in https://github.com/staabm/phpstan-dba/pull/638
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.79...0.2.80
Fix "$result contains generic type mysqli_result but class mysqli_result is not generic" by @staabm in https://github.com/staabm/phpstan-dba/pull/632
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.78...0.2.79
Fix false-positive parameter validation error when query string is not resolvable by @staabm in https://github.com/staabm/phpstan-dba/pull/630
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.77...0.2.78
Fix "Query expects 9223372036854775807-0 placeholders, but no values are given." by @staabm in https://github.com/staabm/phpstan-dba/pull/629
Named placeholders only need to be contained in one of the union queries by @staabm in https://github.com/staabm/phpstan-dba/pull/625
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.75...0.2.76
Make query in SchemaHashMysql independent from internal sorting by @staabm in https://github.com/staabm/phpstan-dba/pull/608
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.74...0.2.75
Support wrapping a RecordingReflector in LazyQueryReflector by @staabm in https://github.com/staabm/phpstan-dba/pull/607
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.73...0.2.74
add LazySchemaHasher by @bloep in https://github.com/staabm/phpstan-dba/pull/606
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.72...0.2.73
SQL AST: ifnull/nullif improvements by @hemberger in https://github.com/staabm/phpstan-dba/pull/592
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.71...0.2.72
Disable duplicate stub validation for now by @staabm in https://github.com/staabm/phpstan-dba/pull/595
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.70...0.2.71
SQL AST: parse expressions with no FROM clause by @hemberger in https://github.com/staabm/phpstan-dba/pull/590
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.69...0.2.70
DoctrineKeyValueStyeRule: allow int values in float columns by @hemberger in https://github.com/staabm/phpstan-dba/pull/581
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.68...0.2.69
DoctrineKeyValueStyleRule: properly handle unions by @hemberger in https://github.com/staabm/phpstan-dba/pull/575
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.67...0.2.68
MysqlTypeMapper: add support for FLOAT types by @hemberger in https://github.com/staabm/phpstan-dba/pull/572
RuntimeConfig->parameterTypeValidation('strict'|'lax') and use it in DoctrineKeyValueStyleRule by @hemberger in https://github.com/staabm/phpstan-dba/pull/563Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.66...0.2.67
DoctrineKeyValueStyleRule: improve table error message by @hemberger in https://github.com/staabm/phpstan-dba/pull/564
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.65...0.2.66
Create QueryReflection lazily to prevent eager creation of a database connection by @staabm in https://github.com/staabm/phpstan-dba/pull/554
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.64...0.2.65
enable phpstan/phpstan-deprecation-rules by @staabm in https://github.com/staabm/phpstan-dba/pull/544
phpstan/phpstan-deprecation-rules by @staabm in https://github.com/staabm/phpstan-dba/pull/544Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.63...0.2.64
Add DoctrineKeyValueStyleRule by @hemberger in https://github.com/staabm/phpstan-dba/pull/529
REPLACE() inference by @staabm in https://github.com/staabm/phpstan-dba/pull/539DBA_MODE constants by @staabm in https://github.com/staabm/phpstan-dba/pull/540Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.62...0.2.63
Prefer inference-placeholder over taint-escape sql by @staabm in https://github.com/staabm/phpstan-dba/pull/536
inference-placeholder over taint-escape sql by @staabm in https://github.com/staabm/phpstan-dba/pull/536Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.61...0.2.62
support sqlftw/sqlftw 0.1.7 by @staabm in https://github.com/staabm/phpstan-dba/pull/533
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.60...0.2.61
Enable query-alias-test for pdo-mysql by @staabm in https://github.com/staabm/phpstan-dba/pull/520
sum() inference by @staabm in https://github.com/staabm/phpstan-dba/pull/524count(*) in tests by @staabm in https://github.com/staabm/phpstan-dba/pull/525ifnull(max(...)) in tests by @staabm in https://github.com/staabm/phpstan-dba/pull/526Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.59...0.2.60
coalesce() unions only types until the first non-nullable by @staabm in https://github.com/staabm/phpstan-dba/pull/519
coalesce() unions only types until the first non-nullable by @staabm in https://github.com/staabm/phpstan-dba/pull/519avg(nullable) can return null. avg(non-nullable) can't return null. by @staabm in https://github.com/staabm/phpstan-dba/pull/518Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.58...0.2.59
Fix wrong deprecated annotation by @mitelg in https://github.com/staabm/phpstan-dba/pull/512
With this release phpstan-dba added new type narrowing capabilities based on SQL Query AST. For now this feature needs to be enabled explicitly within your phpstan-dba configuration file:
See examples
$config = new RuntimeConfiguration();
$config->utilizeSqlAst(true);
Requirements:
sqlftw/sqlftw need to be installed additionally via composerFull Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.57...0.2.58
Allow PHP 7.2 by @TomasVotruba in https://github.com/staabm/phpstan-dba/pull/511
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.56...0.2.57
Write-queries are analyzed by default and no longer executed and rollback'ed. the new logic also works for tables and databases which do not support t
Write-queries are analyzed by default and no longer executed and rollback'ed. the new logic also works for tables and databases which do not support transactions.
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.55...0.2.56
Support for delete, insert, update, replace by @jakubvojacek, @staabm in https://github.com/staabm/phpstan-dba/pull/483
Enable it via RuntimeConfiguration:
$config = new RuntimeConfiguration();
$config->analyzeWriteQueries(true);
requires transaction support in db schema and db driver
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.54...0.2.55
Detect syntax errors in Dibi\Connection::* by @jakubvojacek in https://github.com/staabm/phpstan-dba/pull/463
Dibi\Connection::* by @jakubvojacek in https://github.com/staabm/phpstan-dba/pull/463Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.53...0.2.54
fix ReplayAndRecordingQueryReflector to report consistent results with RecordingReflector
ReplayAndRecordingQueryReflector to report consistent results with RecordingReflectorFull Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.52...0.2.53
work arround PHPStorm integration issues which lead to useless cache-files. phpstan-dba should be run across the whole project
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.51...0.2.52
prevent Query error: Incorrect table name '' (1103). by @staabm in https://github.com/staabm/phpstan-dba/pull/456
Query error: Incorrect table name '' (1103). by @staabm in https://github.com/staabm/phpstan-dba/pull/456AssignOp operators by @staabm in https://github.com/staabm/phpstan-dba/pull/450Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.50...0.2.51
fixed regression by @staabm in https://github.com/staabm/phpstan-dba/pull/453
Full Changelog: https://github.com/staabm/phpstan-dba/compare/0.2.49...0.2.50
One column per quarter.