You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 7, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 7, 2026. It is now read-only.
I have the feeling the AST for a query like SELECT a.email, b.adaid FROM ada a LEFT JOIN ada b ON a.adaid=b.adaid is not correct.
$queryString = 'SELECT a.email, b.adaid FROM ada a LEFT JOIN ada b ON a.adaid=b.adaid';
// returns a Generator. will not parse anything if you don't iterate over it$commands = $parser->parse($queryString);
foreach ($commandsaslist($command)) {
// Parser does not throw exceptions. this allows to parse partially invalid code and not fail on first errorif ($commandinstanceof SelectCommand) {
$from = $command->getFrom();
var_dump(get_class($from));
}
}
only output:
SqlFtw\Sql\Dml\TableReference\OuterJoin
I am wondering why the ast does not contain a TableReferenceTable in addition to the Join.
Also: I don't think OuterJoin is correct in this case.
hi. in SQL syntax JOINs are considered binary operators (simillarly to e.g. + in expressions). in this case operator OUTER JOIN has a left operand a and right operand b. if you inspect the OuterJoin object, there is $joinSide property saying what side the outer join is (LEFT|RIGHT) and both sides $left and $right are TableReferenceTable. one for a and the other for b:
btw, there are three types of expression trees in SQL:
Activity
paranoiq commentedon Feb 18, 2023
hi. in SQL syntax JOINs are considered binary operators (simillarly to e.g.
+in expressions). in this case operatorOUTER JOINhas a left operandaand right operandb. if you inspect the OuterJoin object, there is $joinSide property saying what side the outer join is (LEFT|RIGHT) and both sides $left and $right are TableReferenceTable. one foraand the other forb:btw, there are three types of expression trees in SQL:
1 + foo(3),