Skip to content

Commit

Permalink
Merge branch 'master' into refactor_dml_query_builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Oct 27, 2023
2 parents 7c7fc03 + 245d3ee commit b8fa78a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Bug #233: Refactor `DMLQueryBuilder`, related with yiisoft/db#746 (@Tigrov)
- Enh #230: Improve column type #230 (@Tigrov)
- Bug #240: Remove `RECURSIVE` expression from CTE queries (@Tigrov)

## 1.1.0 July 24, 2023

Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.3|^5.6",
"yiisoft/aliases": "^2.0",
"yiisoft/cache": "^2.0",
"yiisoft/cache-file": "^2.0",
"yiisoft/cache-file": "^3.1",
"yiisoft/var-dumper": "^1.5"
},
"autoload": {
Expand Down
11 changes: 11 additions & 0 deletions src/DQLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Yiisoft\Db\Expression\ExpressionInterface;
use Yiisoft\Db\Oracle\Builder\InConditionBuilder;
use Yiisoft\Db\Oracle\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 @@ -60,6 +61,16 @@ public function selectExists(string $rawSql): string
return 'SELECT CASE WHEN EXISTS(' . $rawSql . ') THEN 1 ELSE 0 END FROM DUAL';
}

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);
}

protected function defaultExpressionBuilders(): array
{
return array_merge(
Expand Down

0 comments on commit b8fa78a

Please sign in to comment.