@param string   $sql
@param string[] ...$params

@return $this
970842
public function groupByRaw(string $sql, string ...$params)
    {
        $instance = $this->groupByStrategyInstance();

        $instance->groupByStrategy()->groupByRaw($sql, ...$params);

        return $instance;
    }
167015
public function order(string $sql, array $params = []) : self
    {
        $this->qiterator = null;
        $name = null;
        if (!count($params)) {
            $name = preg_replace('(\s+(ASC|DESC)\s*$)i', '', $sql);
            try {
                $name = $this->getColumn(trim($name))['name'];
            } catch (\Exception $e) {
                $name = null;
            }
        }
        $this->order = [ $sql, $params, $name ];
        return $this;
    }
1273079
public function execute($sql, $params = null)
    {
        $stmt = $this->_pdo->prepare($sql);

        if (is_array($params)) {
            foreach ($params as $token => $value) {
                $stmt->bindValue($token, $value);
            }
        }

        try {
            $stmt->execute();
        } catch (PDOException $exception) {
            $this->_database->error('execute', $exception);
        }

        return $stmt;
    }
960872
private function selectQuery($sql, array $params = array())
    {
        $stmt = $this->getConnection()->prepare($sql);
        $stmt->execute($params);

        return $stmt->fetchAll(PDO::FETCH_ASSOC);
    }
617002
public function orHavingRaw(string $sql, string ...$params)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->orHavingRaw($sql, ...$params);

        return $instance;
    }
577075
public function createSqlCommand($sql,$params=array())
	{
		$command=$this->_connection->createCommand($sql);
		$this->bindValues($command,$params);
		return $command;
	}
427781
public function query($sql, $param = null)
    {
        $this->__init_database();
        // direct wrapper for fetch
        $stmt = $this->db->prepare($sql);

        for ($i = 0, $c = count($param); $i < $c; $i++) {
            $stmt->bindParam($param[$i][0], $param[$i][1]);
        }

        $this->last_sql = $sql;
        if (!$stmt->execute()) return $this;

        $this->result = $stmt->fetchAll(MySQL::FETCH_OBJ);

        return $this;
    }
184437
public function orderByRaw(string $sql, string ...$params)
    {
        $instance = $this->orderByStrategyInstance();

        $instance->orderByStrategy()->orderByRaw($sql, ...$params);

        return $instance;
    }
1277492
public function execute($sql, array $params=array())
	{
		if ($params) {
			$stmt = $this->prepare($sql);
			if (!$stmt) { return false; }

			$flag = $stmt->execute($params);
			if (!$flag) { return false; }
		} else {
			$stmt = $this->query($sql);
			if (!$stmt) { return false; }
		}

		return $stmt->rowCount();
	}
153939
public function whereRaw(string $sql, string ...$params)
    {
        $this->wConditions()->raw($sql, ...$params);

        return $this;
    }
368018
public function getRow($sql, $params = array())
    {
        $stmt = $this->execute($sql, $params);
        return $stmt->fetch($this->fetchMode);
    }
810069
public function query($sql=null, array $params=[]) {
		if($sql === null) {
			$sql = $this->buildSQL();
			$params = $this->getParameters();
		}

		$this->replaceArrayParams($sql, $params);

		return $this->query = $this->db->query($sql, $params);
	}
1171730
public function run($sql, array $params = array())
    {
        $sth = $this->pdo->prepare($sql);

        foreach ($params as $key => $value) {
            $key = is_numeric($key) ? $key + 1 : ":$key";
            $sth->bindValue($key, $value);
        }

        $sth->execute($params);
        $this->executed[] = $sql;
        return $sth;
    }
1219677
public function addHaving(string $logic, $sql, array $params = [])
    {
        $this->hConditions()->addCondition($logic, $sql, $params);

        return $this;
    }
117115
public function orWhereRaw(string $sql, string ...$params)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->orWhereRaw($sql, ...$params);

        return $instance;
    }
740643
public function column(string $sql, array $params = [])
    {
        $prepared = $this->prepare($sql, $params);
        $this->execute($prepared);
        $result = $prepared['statement']->fetchColumn();
        $prepared['statement']->closeCursor();
        return $result;
    }
143445
public function sql(string $sql, array $params = []) {
        $r = $this->model->db->query($sql, $params);
        if (!is_array($r) || 0 === count($r)) {
            return [];
        }
        return $this->model->setup($r);
    }