public function count($q = '*', $db = null)
    {
        if ($this->emulateExecution) {
            return new LazyPromise(function() { return resolve(0); });
        }

        return $this->queryScalar("COUNT($q)", $db);
    }