Skip to content

Commit

Permalink
Execute Query without ->from()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Sep 27, 2023
1 parent 8a066f3 commit 5c3f26c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/DQLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ public function selectExists(string $rawSql): string
return 'SELECT CASE WHEN EXISTS(' . $rawSql . ') THEN 1 ELSE 0 END FROM DUAL';
}

public function buildFrom(array|null $tables, array &$params): string
{
if (empty($tables)) {
return 'FROM DUAL';
}

return parent::buildFrom($tables, $params);
}

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

0 comments on commit 5c3f26c

Please sign in to comment.