/** * Compile a select query into SQL. * * @param \Database\Query\Builder * @return string */ public function compileSelect(Builder $query) { $sql = parent::compileSelect($query); if ($query->unions) { $sql = '(' . $sql . ') ' . $this->compileUnions($query); } return $sql; }
/** * Get the SQL representation of the query. * * @return string */ public function toSql() { return $this->grammar->compileSelect($this); }