phpstan-dba
                                
                                
                                
                                    phpstan-dba copied to clipboard
                            
                            
                            
                        PHPStan based SQL static analysis and type inference for the database access layer
it seems when column names contain upper keys we do not detect it properly
Related problems - [x] https://github.com/staabm/phpstan-dba/issues/106#issuecomment-1014785550 - [x] https://github.com/staabm/phpstan-dba/issues/122 - [ ] https://github.com/staabm/phpstan-dba/blob/cac63a658c777715037f6e9a987df3a96b847328/src/QueryReflection/QuerySimulation.php#L87-L92 - [ ] make test of https://github.com/staabm/phpstan-dba/pull/153 pass, without non-SELECT optout workaround - [ ] https://github.com/staabm/phpstan-dba/pull/172 - [x]...
Todo - [x] Connection->fetchAssociative - [x] Connection->fetchNumeric - [x] Connection->fetchOne - [x] Connection->fetchAllNumeric - [x] Connection->fetchAllAssociative - [x] Connection->fetchAllKeyValue - [ ] Connection->fetchAllAssociativeIndexed - [x] Connection->fetchFirstColumn - [x] Connection->iterateNumeric -...
https://github.com/phpstan/phpstan/issues/2608
instead of ``` SELECT `adp`.*, `ada`.`spracheid` FROM `adp` INNER JOIN `ada` ON ada.adaid = adp.adaid WHERE (adpid = NULL) LIMIT 1 ``` we should simulate ``` SELECT `adp`.*, `ada`.`spracheid` FROM...
create a PHPStan-Rule which errors on `bindValue`/.. calls, when parameters are passed to `execute` __Originally posted by @staabm in https://github.com/staabm/phpstan-dba/pull/265#discussion_r803570186__ Example by xPaw ```php $st = Container::Database()->prepare( 'SELECT * FROM...
should error, as a sql error occurs when `ids` is an empty-array. ```php // should error function inIDs(array $ids) { $pdo->query('SELECT email FROM ada WHERE adaid IN('. implode(',', $ids) .')',...
refs https://github.com/staabm/phpstan-dba/issues/276
```php $queries = [ 'SELECT 1' ]; foreach( $queries as $test ) { $test = $pdo->prepare( $test ); // reusing variable $test->execute(); } ``` However this doesn't crash: ```php $test...