Yiisoft\Db\Query\Query class can be extended in each supported DBMS.
E.g. we can have Yiisoft\Db\Mssql\Query which extends Yiisoft\Db\Query\Query.
In this case ActiveQuery will not know about the extensions in Yiisoft\Db\Mssql\Query.
Suggestion
Connection of DBMS should return concrete Query instance to use it in ActiveQuery.
Yiisoft\Db\Query\Queryclass can be extended in each supported DBMS.E.g. we can have
Yiisoft\Db\Mssql\Querywhich extendsYiisoft\Db\Query\Query.In this case
ActiveQuerywill not know about the extensions inYiisoft\Db\Mssql\Query.Suggestion
Connectionof DBMS should return concreteQueryinstance to use it inActiveQuery.