diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index e0427dfbd..449ceed9b 100644 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -891,4 +891,12 @@ class Builder extends BuilderAbstract { return clone($this); } + + public function execute() + { + $sth = $this->connection->con->prepare($this->toSQL()); + $sth->execute(); + + return $sth; + } } diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index b198cf0ce..8f37b6e04 100644 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -124,7 +124,7 @@ class Grammar extends GrammarAbstract $components = $this->selectComponents; break; case QueryType::RAW: - return $query->raw; + return [$query->raw]; break; default: throw new \InvalidArgumentException('Unknown query type.');