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
When adding an alias to ->join() the table breaks with an error:
PicoDb\SQLException: SQL Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'phone.contact_id' in 'on clause'
See the image. ->join() is missing the AS statement that the ->left() method has.
recommendation:
Given that any fix will be a breaking change, and that ->join is functionally the same as ->left,
I would just make join a wrapper for left.
I'd also change the interface to be nicer to use and let you specify the alias without the local table param.
like so:
NTH
Would also be nice to auto prepend the alias name to the columns when provided as the common situation for needing an alias is that columns with the same name are replacing each other. So you introduce an alias, and then as soon as you do this you now have to manually write out every single column and specify an alias for each column.
Would be great if this was taken care of.
The text was updated successfully, but these errors were encountered:
b-hayes
changed the title
Table->join method is not using alias.
BUG: Table->join method is not using alias.
Apr 5, 2022
When adding an alias to ->join() the table breaks with an error:
See the image. ->join() is missing the
AS
statement that the ->left() method has.recommendation:
Given that any fix will be a breaking change, and that
->join
is functionally the same as->left
,I would just make join a wrapper for left.
I'd also change the interface to be nicer to use and let you specify the alias without the local table param.
like so:
and then you can use it like this:
NTH
Would also be nice to auto prepend the alias name to the columns when provided as the common situation for needing an alias is that columns with the same name are replacing each other. So you introduce an alias, and then as soon as you do this you now have to manually write out every single column and specify an alias for each column.
Would be great if this was taken care of.
The text was updated successfully, but these errors were encountered: