Nisarg Jhaveri a écrit :
Hello,
I am a student from India. I have been using phpMyAdmin for many years now. It helped me a lot when I was trying to learn PHP, Databases, etc. Thank you. :)
I also have been involved with development of phpMyAdmin for some time and now I intend to participate in GSOC 2015 with phpMyAdmin.
The parser rewrite/replace project interests me, and I would like some more details and clarifications about it.
I tried searching for some project that already does what we want to do, I found a project, https://code.google.com/p/php-sql-parser/.
This seems like a fairly good parser, with New BSD Licence, which I think is compatible with licence of PMA.
Some problems with the project IMO,
- Probably, not active. (Last commit in September 2014, with last release
in April 2014) 2. Probably does more things than we need (So, maybe bloated for us) 3. Does not provide SQL formatting, which is part of current parser in PMA. So, we may have to extend the new parser or use something else.
If we think that this parser is a really good parser, we should use it and find solutions to the problems above.
Solution for 1,3: We can always adopt the project and develop/maintain it further. (Because we need it :P) Solution for 2: Use it more and provide more features in PMA ;)
If the team does not like or want to use the external project. I am ready and excited about writing a new parser/analyzer.
Also, if someone can list some more examples where we need to parse SQL queries, it would be helpful to understand the project more. I am already checking the code-base, but there are chances that I might miss the need of it sometimes.
I would also like some more information about the feature requests listed on Idea page, but I will ask this on feature tracker.
Any other suggestions?
Regards, Nisarg Jhaveri નિસર્ગ ઝવેરી
Hi Nisarg, thanks for your interest. It would be better to start from an existing parser, but I haven't studied the library you suggest. It can be part of your proposal though.
About formatting, PMA_SQP_format() is only used in 'query_only' mode. The formatting you can see comes from CodeMirror.
To see examples, I replied to you in one of the feature tickets, but in general, this should give you a good start:
git grep PMA_SQP_parse git grep PMA_SQP_analyze