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

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

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

        return $instance;
    }
744225
private function prepare($sql, array $params)
    {
        $statement = $this->connection->prepare($sql);
        foreach ($params as $key => $value) {
            $statement->bindValue($key, $value);
        }

        return $statement;
    }
343621
public static function getSqlWithParams(string $sql, array $params = []): string
    {
        if (! empty($params)) {
            $indexed = ($params === array_values($params));
            foreach ($params as $k => $v) {
                if (is_string($v)) {
                    $v = "'${v}'";
                }
                if (is_array($v)) {
                    $v = "'" . implode("','", $v) . "'";
                }
                if ($indexed) {
                    $sql = preg_replace('/\?/', $v, $sql, 1);
                } else {
                    $sql = str_replace(":${k}", $v, $sql);
                }
            }
        }

        return str_replace(PHP_EOL, '', $sql);
    }
417998
private function addSelect($sql, array $params = [])
    {
        $this->values = [];

        $this->select = [
            'sql'    => $sql,
            'params' => $params,
        ];

        return $this;
    }
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);
	}
268341
private function prepare(string $sql, array $params = []): \PDOStatement
    {
        return $this->pdo()->connectionProcess(function (Pdo $pdo) use ($sql, $params) {
            $stmt = $pdo->prepare($sql);

            if ($params) {
                $k = 1;

                foreach ($params as $key => $value) {
                    $stmt->bindValue(is_int($key) ? $k++ : $key, $value);
                }
            }

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

            $stmt->execute();

            $pdo->checkError();

            return $stmt;
        });
    }
962578
public function havingRaw(string $sql, string ...$params)
    {
        $instance = $this->havingStrategyInstance();

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

        return $instance;
    }
192150
public function andOrderBy($sql, $params=array())
    {
        $binder = new Binder();
        $this->_order[] = $binder->magicBind($sql, (array) $params);

        return $this;
    }
1080740
public function bind($sql, array $params=array())
    {
        return $this->_bindInto('\?', $sql, $params, function($binder, $param) use ($sql) {
            return $binder->sqlValue($param);
        });
    }
1287492
public function setSql($sql, array $params = [])
    {
        $this->sql = (string) $sql;

        $this->setSqlParameters($params);
    }
1047332
protected function fire(string $sql, array $params = [])
    {
        foreach ($this->listeners as $listener) {
            call_user_func_array($listener, [$sql, $params, $this]);
        }

        return $this;
    }
1268805
public function fetchOne($sql, $params = array()) {
    $result = $this->db()->fetchAssoc($sql, $params);

    if (!empty($result)) {
      $this->setRecord($result);

      return $this;
    }

    return FALSE;
  }
368018
public function getRow($sql, $params = array())
    {
        $stmt = $this->execute($sql, $params);
        return $stmt->fetch($this->fetchMode);
    }
555583
protected function fetch( $sql, $params = null ) {
		$stmt = $this->dbh->prepare( $sql );
		$this->bind( $stmt, $params );
		$stmt->execute();
		return $stmt->fetch();
	}
420754
public function sqlFetch(string $sql, array $params = []): ?array
    {
        return $this->prepare($sql, $params)->fetch(\PDO::FETCH_ASSOC);
    }
835395
public function selectRaw(string $sql, string ...$params)
    {
        $this->addSelect($sql, $params);

        return $this;
    }
169969
public function whereExistsRaw(string $sql, string ...$params)
    {
        $this->wConditions = null;

        $this->exists = [
            'sql'    => $sql,
            'negate' => false,
            'params' => $params,
        ];

        return $this;
    }