sql-parser
sql-parser copied to clipboard
A validating SQL lexer and parser with a focus on MySQL dialect.
When using a single character as a table alias or name, the table.column names are not properly recognized For example, this SQL: ```sql SELECT x.asset_id FROM (SELECT evt.asset_id FROM evt)...
The extremely limited MySQL manual entry is here: https://dev.mysql.com/doc/refman/8.0/en/savepoint.html We currently don't understand these three commands: - [ ] `SAVEPOINT foo` - [ ] `ROLLBACK [WORK] TO [SAVEPOINT] foo` where...
Dear sqlparser developer: Hello Thank you very much and your team for developing PHP myadmin / sql-parser, an excellent PHP parser component with SQL grammar, which has helped me solve...
Hey this parser is very cool and searched forever until I found it :-) I just have a problem parsing my scheme definition when I have a CREATE TABLE query...
See https://dev.mysql.com/doc/refman/5.7/en/string-type-syntax.html and https://stackoverflow.com/questions/44212793/how-to-make-nvarchar-column-in-phpmyadmin
It seems to subqueries are poorly supported Some examples first: They are not parsed at all ```sql SELECT * FROM (SELECT * FROM b) a ``` results in ``` ......
```php $sql = 'CREATE TABLE tab1 (`col1` TIMESTAMP /*!40100 DEFAULT NULL */)'; $parser = new Parser($sql); $s3 = $parser->statements[0]->build(); // $s3 wrongly contains end-of-comment // CREATE TABLE tab1 ( //...
### Describe the bug A MariaDB window function used together with an alias results in bad linting errors in the SQL query editor. ### To Reproduce 1. Go to https://demo.phpmyadmin.net/master-config/index.php?route=/table/sql&db=opengis&table=world_borders&server=1...
Formatter doesn't handle [CASE expressions](https://dev.mysql.com/doc/refman/8.0/en/control-flow-functions.html#operator_case) and [CASE statements](https://dev.mysql.com/doc/refman/8.0/en/case.html). Related to #272. Examples: CASE expression: ```sql -- original SELECT CASE 1 WHEN 1 THEN 'one' WHEN 2 THEN 'two' ELSE 'more'...
The SQL Parser fails to parse the following query: ```sql update `table1` as e, (select * from table2) e2 set e.`id` = e2.id, where e.id=e2.id ``` It returns the output...