src/Leevel/Database/Select.php
protected function runNativeSql(string $nativeType, string $data, array $bindParams = [])
    {
        $sqlType = $this->connect->normalizeSqlType($data);

        if ('procedure' === $sqlType) {
            $sqlType = 'select';
        }

        if ($sqlType !== $nativeType) {
            $e = sprintf('The SQL type `%s` must be consistent with the provided `%s`.', $sqlType, $nativeType);

            throw new InvalidArgumentException($e);
        }

        $args = [$data, $bindParams];

        // 只返回 SQL，不做任何实际操作
        if (true === $this->onlyMakeSql) {
            return $args;
        }

        $type = 'select' === $nativeType ? 'query' : 'execute';

        return $this->connect->{$type}(...$args);
    }
protected function runNativeSql(string $nativeType, string $data, array $bindParams = [])
    {
        $sqlType = $this->connect->normalizeSqlType($data);

        if ('procedure' === $sqlType) {
            $sqlType = 'select';
        }

        if ($sqlType !== $nativeType) {
            $e = sprintf('The SQL type `%s` must be consistent with the provided `%s`.', $sqlType, $nativeType);

            throw new InvalidArgumentException($e);
        }

        $args = [$data, $bindParams];

        // 只返回 SQL，不做任何实际操作
        if (true === $this->onlyMakeSql) {
            return $args;
        }

        $type = 'select' === $nativeType ? 'query' : 'execute';

        return $this->connect->{$type}(...$args);
    }
原生 sql 执行方法.

@param string $nativeType
@param string $data
@param array  $bindParams

@return mixed