diff --git a/Database/ActiveQuery.php b/Database/ActiveQuery.php index 2737a05c..fb8ce1ea 100644 --- a/Database/ActiveQuery.php +++ b/Database/ActiveQuery.php @@ -155,6 +155,17 @@ class ActiveQuery extends Component implements ISqlBuilder return $newModel; } + + /** + * @return string + * @throws Exception + */ + public function toSql(): string + { + return $this->builder->get(); + } + + /** * @return array|Collection */