Skip to content

Commit

Permalink
Add compileExists grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperl22 committed Jul 5, 2018
1 parent 8e1c1c2 commit 4e14cc7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Query/Grammars/DB2Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,21 @@ protected function compileOffset(Builder $query, $offset)
return '';
}

/**
* Compile an exists statement into SQL.
*
* @param \Illuminate\Database\Query\Builder $query
* @return string
*/
public function compileExists(Builder $query)
{
$existsQuery = clone $query;

$existsQuery->columns = [];

return $this->compileSelect($existsQuery->selectRaw('1')->limit(1));
}

/**
* Get the format for database stored dates.
*
Expand Down

0 comments on commit 4e14cc7

Please sign in to comment.