-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use proper sql parser #123
Comments
Might be worth looking at the PDO function that parses parameters, to see how it works. It seems to use pdo_parse_params(), which is a bit more complicated than using the BINDCHR regex by itself (used later as It supports escaped question marks ( |
Would be great if you could provide failling testcases if you have special cases in mind |
I don't have any real examples, but how about?
|
these basic examples are now covered by #145 still on the long run we might better use a sql parser. lets see whether people report problems with their queries when running phpstan-dba on real projects |
on twitter the SQLFTW/sqlftw project was suggested as a proper parser |
Related problems
phpstan-dba/src/QueryReflection/QuerySimulation.php
Lines 87 to 92 in cac63a6
count()
Should be inferred as a0|positive-int
#248IN()
and empty-array #292IS NULL
#297min()
,max()
,avg()
inference #309https://github.com/phpmyadmin/sql-parser
https://github.com/greenlion/PHP-SQL-Parser
The text was updated successfully, but these errors were encountered: