Closed Zheness closed 9 months ago
Is there any reason why it was not implemented?
I do not think there is any, are you willing to submit a patch for this?
I may have time to look into it later though.
Hi, I can try to submit a PR today.
How would you like me to do it ?
Union.php
file to UnionAll.php
?Union
constructor?There is only one line to edit in the file, but I don't know how you prefer the code to be maintained. Thanks !
I think it makes sense to have a boolean. Because we can have either UNION DISTINCT
which is like UNION
or UNION ALL
.
Looking at SELECT
we have a boolean for this:
https://github.com/thecodingmachine/magic-query/blob/5107ebf5c944e62692182feab3359f1cc1fc3423/src/SQLParser/Query/Select.php#L58
So let's do the same with UNION ALL
:
A simple boolean argument in the Union constructor?
Don't forget to add tests too.
(published in v1.5.2)
Hello,
When trying a query with
UNION ALL
likeSELECT a FROM users UNION ALL SELECT a FROM users
it doesn't work with magic query.If we look at the file
StatementFactory.php
, we see that onlyUNION
is supported.Is there any reason why it was not implemented?
Thanks !