public function all($db = null)
    {
        if ($this->emulateExecution) {
            return new LazyPromise(function() { return resolve([]); });
        }
        return $this->createCommand($db)->queryAll()->thenLazy(
            function($results) {
                return $this->populate($results);
            }
        );
    }