src/Db/Command.php
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;
            }
        );
    }
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;
            }
        );
    }
Executes the SQL statement and returns the value of the first column in the first row of data.
This method is best used when only a single value is needed for a query.
@return LazyPromiseInterface the value of the first column in the first row of the query result.
False is returned if there is no value.