Add compileExists grammar

This commit is contained in:
Maxime Rault 2018-07-05 08:32:49 +02:00
parent ad191bbbe0
commit a1aad3bb54

View File

@ -179,6 +179,21 @@ class DB2Grammar extends Grammar
return ''; 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. * Get the format for database stored dates.
* *