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
The following example demonstrates a pattern of using Quick to build some (arbitrarily complicated and reusable) where clause, and then using that clause to drive a QB whereIn.
The result of retrieveQuery has been (and remains) fine here, but using the result of asQuery throws an exception.
getInstance("QueryBuilder@qb")
.from("some_other_table")
// ok
.whereIn("ID", getInstance("User").someFilterScope().retrieveQuery().reselect("ID") )
// fails with:
// Invalid call of the function [compileSelect],
// first Argument [query] is of invalid type,
// Cannot cast Object type [Component quick.models.QuickBuilder] to a value of type [QueryBuilder]
.whereIn("ID", getInstance("User").someFilterScope().asQuery().reselect("ID") )
.get()
The text was updated successfully, but these errors were encountered:
Ah. I see why. You are passing a QuickBuilder instance into a QueryBuilder instance. It would work if they were both QuickBuilder instances.
I’m not sure how possible it will be to support passing in a QuickBuilder to a QueryBuilder. This seems like a place where retrieveQuery is probably the right option, but I’ll keep this issue open in case inspiration strikes.
quick 6.2.1
The following example demonstrates a pattern of using Quick to build some (arbitrarily complicated and reusable) where clause, and then using that clause to drive a QB
whereIn
.The result of
retrieveQuery
has been (and remains) fine here, but using the result ofasQuery
throws an exception.The text was updated successfully, but these errors were encountered: