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
Right now, the name of the table of is prepended to any filter defined by @searchBy, e.g. users.active. However, with custom queries I have a case where I would like to query a field on a different table of the query. I think the easiest would be to use the rename directive (e.g. @rename( attribute: "related_table.name" )) and within the query enhancer check if the attribute contains a dot?
The text was updated successfully, but these errors were encountered:
Right now, the name of the table of is prepended to any filter defined by @searchby, e.g. users.active.
Yep (but only for Eloquent), it is required to avoid "Integrity constraint violation: 1052 Column 'xxx' in where clause is ambiguous" error when query has joins.
I think the easiest would be to use the rename directive (e.g. @rename( attribute: "related_table.name" )) and within the query enhancer check if the attribute contains a dot?
To be honest, I'm not sure. I always prefer explicit form ({ relation { name }}) and never used @rename :) Maybe overriding/implementation of the BuilderFieldResolver will be easy?
Right now, the name of the table of is prepended to any filter defined by
@searchBy
, e.g.users.active
. However, with custom queries I have a case where I would like to query a field on a different table of the query. I think the easiest would be to use the rename directive (e.g.@rename( attribute: "related_table.name" )
) and within the query enhancer check if the attribute contains a dot?The text was updated successfully, but these errors were encountered: