diff --git a/module/bi/model.php b/module/bi/model.php index 24aa78c213..fab647bc8d 100644 --- a/module/bi/model.php +++ b/module/bi/model.php @@ -874,6 +874,23 @@ class biModel extends model return $parser->statement; } + /** + * Parse sql. + * + * @param string $sql + * @access public + * @return array + */ + public function parseSql(string $sql): array + { + $this->app->loadClass('sqlparser', true); + $parser = new sqlparser($sql); + $parser->setDAO($this->dao); + $parser->parseStatement(); + + return $parser->matchColumnsWithTable(); + } + /** * Validate sql. *