yiisoft / yiisoft/active-record

ActiveQuery can not be built in DQLQueryBuilder

Open
#548 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
119
Forks
38
Avg merge
1h 11m
Merged PRs (30d)
1

Description

Description

The error occurs then trying to use ActiveQuer in a subquery.

$q = Order::query()->select(new Expression('1'));
Item::query()->where(new Exists($q))->all();

Yiisoft\Db\Exception\NotSupportedException: Expression of class Yiisoft\ActiveRecord\ActiveQuery can not be built in Yiisoft\Db\Pgsql\DQLQueryBuilder in \vendor\yiisoft\db\src\QueryBuilder\AbstractDQLQueryBuilder.php:483

Package version

No response

PHP version

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the provided ActiveQuery subquery example and inspect vendor/yiisoft/db/src/QueryBuilder/AbstractDQLQueryBuilder.php at line 483, along with the ActiveQuery, Exists, and DQLQueryBuilder classes named in the report. Done means the query builds successfully without the NotSupportedException.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.