public function exists($db = null)
    {
        if ($this->emulateExecution) {
            return reject(false);
        }
        $command = $this->createCommand($db);
        $params = $command->params;
        $command->setSql($command->db->getQueryBuilder()->selectExists($command->getSql()));
        $command->bindValues($params);
        return $command->queryScalar()
            ->thenLazy(function($count = 0) {
                return $count > 0 ? true : reject(new Error("Does not exist"));
            });
    }