Skip to content

Migrate from retrieveQuery to asQuery - object type returned from asQuery not accepted where object type returned from retrieveQuery is accepted. #226

Description

@davidAtInleague

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 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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions