public function queryScalar()
    {
        return $this->queryInternal(static::FETCH_FIELD)->thenLazy(
            function($result) {
                if (is_resource($result) && get_resource_type($result) === 'stream') {
                    return stream_get_contents($result);
                }
                return $result;
            }
        );
    }