private function prepareStatement(string $sql): \Generator
    {
        $connection = yield from $this->pop();
        \assert($connection instanceof Link);

        try {
            $statement = yield $connection->prepare($sql);
            \assert($statement instanceof Statement);
        } catch (\Throwable $exception) {
            $this->push($connection);
            throw $exception;
        }

        return $this->createStatement($statement, function () use ($connection) {
            $this->push($connection);
        });
    }
private function prepareStatement(string $sql): \Generator
    {
        $connection = yield from $this->pop();
        \assert($connection instanceof Link);

        try {
            $statement = yield $connection->prepare($sql);
            \assert($statement instanceof Statement);
        } catch (\Throwable $exception) {
            $this->push($connection);
            throw $exception;
        }

        return $this->createStatement($statement, function () use ($connection) {
            $this->push($connection);
        });
    }
private function prepareStatement ( string $ sql ) : \ Generator { $ connection = yield from $ this -> pop ( ) ; \ assert ( $ connection instanceof Link ) ; try { $ statement = yield $ connection -> prepare ( $ sql ) ; \ assert ( $ statement instanceof Statement ) ; } catch ( \ Throwable $ exception ) { $ this -> push ( $ connection ) ; throw $ exception ; } return $ this -> createStatement ( $ statement , function ( ) use ( $ connection ) { $ this -> push ( $ connection ) ; } ) ; }
Prepares a new statement on an available connection.

@param string $sql

@return \Generator

@throws FailureException
Prepares a new statement on an available connection .