From e8386fb41c04fd473806ecd4faea2ec4ce38eb38 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sun, 26 Oct 2025 17:59:23 +0300 Subject: [PATCH 1/2] Adapt to refactor "WITH" in Yii DB --- src/DQLQueryBuilder.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/DQLQueryBuilder.php b/src/DQLQueryBuilder.php index e1cd532..6c44f9f 100644 --- a/src/DQLQueryBuilder.php +++ b/src/DQLQueryBuilder.php @@ -14,6 +14,7 @@ use Yiisoft\Db\Oracle\Builder\LongestBuilder; use Yiisoft\Db\Oracle\Builder\ShortestBuilder; use Yiisoft\Db\Query\Query; +use Yiisoft\Db\Query\WithQuery; use Yiisoft\Db\QueryBuilder\AbstractDQLQueryBuilder; use Yiisoft\Db\QueryBuilder\Condition\In; use Yiisoft\Db\QueryBuilder\Condition\Like; @@ -77,14 +78,18 @@ public function buildFrom(array|null $tables, array &$params): string return parent::buildFrom($tables, $params); } - public function buildWithQueries(array $withs, array &$params): string + public function buildWithQueries(array $withQueries, array &$params): string { - /** @psalm-var array{query:string|Query, alias:ExpressionInterface|string, recursive:bool}[] $withs */ - foreach ($withs as &$with) { - $with['recursive'] = false; - } - - return parent::buildWithQueries($withs, $params); + $withQueries = array_map( + static fn(WithQuery $withQuery) => new WithQuery( + $withQuery->query, + $withQuery->alias, + false + ), + $withQueries, + ); + + return parent::buildWithQueries($withQueries, $params); } protected function defaultExpressionBuilders(): array From 39bb59eac91117f63f45585ca81bfa418fae577c Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Mon, 27 Oct 2025 10:13:13 +0300 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4661433..00e587c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ - Enh #360: Refactor `DMLQueryBuilder::upsert()` method (@Tigrov) - Chg #365: Update expression namespaces according to changes in `yiisoft/db` package (@Tigrov) - Enh #359: Update `DMLQueryBuilder::update()` method to adapt changes in `yiisoft/db` (@rustamwin) +- Enh #373: Adapt to `DQLQueryBuilderInterface::buildWithQueries()` signature changes in `yiisoft/db` package (@vjik) ## 1.3.0 March 21, 2024