Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CTE query expressions #278

Merged
merged 3 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 1.0.2 under development

- no changes in this release.
- Bug #278: Remove `RECURSIVE` expression from CTE queries (@Tigrov)

## 1.0.1 July 24, 2023

Expand Down
11 changes: 11 additions & 0 deletions src/DQLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Yiisoft\Db\Expression\ExpressionInterface;
use Yiisoft\Db\Mssql\Builder\InConditionBuilder;
use Yiisoft\Db\Mssql\Builder\LikeConditionBuilder;
use Yiisoft\Db\Query\Query;
use Yiisoft\Db\QueryBuilder\AbstractDQLQueryBuilder;
use Yiisoft\Db\QueryBuilder\Condition\InCondition;
use Yiisoft\Db\QueryBuilder\Condition\LikeCondition;
Expand Down Expand Up @@ -109,4 +110,14 @@ protected function extractAlias(string $table): array|bool

return parent::extractAlias($table);
}

public function buildWithQueries(array $withs, 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);
}
}
Loading