#phpstandba crossed the 200 stars 🌟
it may also be helpful for you, in case you don‘t use fully fledged orm. It covers your database access layer with #phpstan type inference based on the database schema
https://github.com/staabm/phpstan-dba
---
the idea behind phpstandba in a few slides
Just published the slides of my @phpugffm talk
"#phpstandba - check your sql queries like a boss"
RT @markusstaab
check your sql queries like a boss. resultset type inference included.
next level static analysis - using the #phpstandba extension for @phpstan
Supports @doctrineproject DBAL, PDO, mysqli with MySQL/MariaDB and @PostgreSQL.
https://github.com/staabm/phpstan-dba
plz RT
RT @markusstaab
I started preparing slides for my presentation about #phpstandba, which will be the topic of my
“Check sql queries like a boss – next level static analysis”
I started preparing slides for my presentation about #phpstandba, which will be the topic of my
“Check sql queries like a boss – next level static analysis”
RT @markusstaab
check your sql queries like a boss. resultset type inference included.
next level static analysis - using the #phpstandba extension for @phpstan
Supports @doctrineproject DBAL, PDO, mysqli with MySQL/MariaDB and @PostgreSQL.
https://github.com/staabm/phpstan-dba
plz RT
Seems I will have my very first podcast with @sddevclub on may the 2nd.
We will talk about #static #analysis in #php .. most likely about @phpstan and/or one of my custom extensions like #phpstandba (in german).
I think it will be a lot of fun 🤩
#static #analysis #php #phpstandba
RT @markusstaab
Detect slow queries before they hit your production database using #phpstandba extension for @phpstan
https://staabm.github.io/2022/08/16/phpstan-dba-query-plan-analysis.html
#phpstandba #php #staticanalysis
#phpstandba learnt to narrow result types when #sql joins are used.
it narrows e.g. integer ranges and also takes nullability into account.
feedback welcome
#phpstandba #sql #php #staticanalysis
RT @markusstaab
check your sql queries like a boss. resultset type inference included.
next level static analysis - using the #phpstandba extension for @phpstan
Supports @doctrineproject DBAL, PDO, mysqli with MySQL/MariaDB and @PostgreSQL.
https://github.com/staabm/phpstan-dba
plz RT
Just implemented a stateful object aware #phpstan extension for the sql query builder from @REDAXO CMS.
Combined it with #phpstandba and the latest SQL AST type inference work and you get the really cool phpstan type inference results.
not super clean, but powerfull :)
just released the next #phpstandba release.
opt-in sql ast based type inference is getting serious.
we support all control flow functions. also a lot of often used ones. based on #sqlftw
overview: https://github.com/staabm/phpstan-dba/blob/main/tests/default/data/sql-ast-narrowing.php
//cc @paranoiq
released:
---
RT @markusstaab
#phpstandba with opt-in sql ast support to narrow types of mysql functions used in SELECT-part of the query was just released.
Give it a try, but read the releasenotes regarding requirements first.
Feedback welcome 🤗
https://github.com/staabm/phpstan-dba/releases
https://twitter.com/markusstaab/status/1626337715649236992
#phpstandba with opt-in sql ast support to narrow types of mysql functions used in SELECT-part of the query was just released.
Give it a try, but read the releasenotes regarding requirements first.
Feedback welcome 🤗
pushed a new #phpstandba release.
@votrubaT contributed php 7.2 compat (now we have the same php-src version range then the upstream @phpstan)
hemberger (github handle) added support for placeholder validation in write queries.
more is already in the pipeline :-)
Today #phpstandba learnt type inference on mysql CONCAT() and CONCAT_WS().
Watch out for all the nuances of string and null types.
I love it already :-)
doing slow progress on the sql query ast based type narrowing in #phpstandba
implemented count(), coalesce(), ifnull() and sql-ast <-> phpstan type-mappings for now.
Spent some time for a very rough first #phpstandba prototype which adds sql ast inference capabilities.
at the moment it only support result type narrowing for expressions based on the count() mysql function.
the latest #phpstandba release supports analyzing write queries even on non transactional databases and tables, since these queries are no longer executed in a writable manner.
#phpstandba learnt to analyze write-queries. its a new opt-in feature which need to be activated via the RuntimeConfiguration within your bootstrap file
it requires transaction support in your database (e.g. InnoDB) and your used driver
feedback welcome