Return a count of rows this Query would return.
483214
def count(self):
        ""
        return self.rpc_model.search_count(
            self.domain, context=self.context
        )
1326229
def _produce_return(self, cursor):
        
        rowcount = cursor.rowcount

        # Check the row count?
        if self._rowcount is not None and self._rowcount != rowcount:
            raise ManipulationCheckError(
                "Count was {}, expected {}.".format(rowcount, self._rowcount))

        return rowcount
68293
def rowCount(self, qindex=QModelIndex()):
        """"""
        if self.total_rows <= self.rows_loaded:
            return self.total_rows
        else:
            return self.rows_loaded
85192
public function count()
    {
        $myQuery = clone $this->query;

        if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) {
            $row_count = $this->connection->getQueryGrammar()->wrap('row_count');
            $myQuery->select($this->connection->raw("'1' as {$row_count}"));
        }
        return $this->connection->table($this->connection->raw('(' . $myQuery->toSql() . ') count_row_table'))
                        ->setBindings($myQuery->getBindings())->count();
    }
1053155
def get_relation_count_query(self, query, parent):
        
        query.select(QueryExpression("COUNT(*)"))

        key = self.wrap(self.get_qualified_parent_key_name())

        return query.where(self.get_has_compare_key(), "=", QueryExpression(key))
869366
def count(self):
        
        # Save the existing rows and start parameters to see how many results were actually expected
        _rows = self._solr_params.get('rows', None)
        _start = self._solr_params.get('start', 0)
        if not self._solr_cache:
            # Get the count for everything
            self.set_params(rows=0)
            self._exec_query()
        number = self._solr_cache.get('num_found', -1)

        # If start value is bigger or equal than solr results' count, should return 0
        # If there are 10 results, but if start value is specified as 30, should return 0.
        if _start >= number:
            return 0
        else:
            # If 'start' is specified, then this many results from the start will not be accessible.
            number -= _start
            # If 'rows' is NOT specified, then all results are accessible
            # (minus the ones skipped with 'start')
            if _rows is None:
                return number
            # If 'rows' is specified, then this many results at most will be accessible. If we have
            # more than this many results found, then we can say that this many results are
            # accessible. If there are less results found than rows, then we can't give more
            # than found results.
            return number if number < _rows else _rows
55050
public function countRows()
    {
        $countRows = 0;

        if (!is_null($this->resourceHandle)) {
            $countRows = $this->resourceHandle->rowCount();
        }

        return $countRows;
    }
47429
def count_rows_distinct(self, table, cols='*'):
        """"""
        return self.fetch('SELECT COUNT(DISTINCT {0}) FROM {1}'.format(join_cols(cols), wrap(table)))
1239547
public function rowCount()
    {

        $query = $this->run(false, false);

        if ($query instanceof PDOStatement) {
            return $query->rowCount();
        } elseif ($query instanceof mysqli_stmt) {
            $query = $query->get_result();

            return $query->num_rows;
        } else {
            return false;
        }
    }
440333
def count(self) -> "CountQuery":
        
        return CountQuery(
            db=self._db,
            model=self.model,
            q_objects=self._q_objects,
            annotations=self._annotations,
            custom_filters=self._custom_filters,
        )
618589
def count(cls, filter=None, **kwargs):
        """"""
        from mongoframes.queries import Condition, Group, to_refs

        if isinstance(filter, (Condition, Group)):
            filter = filter.to_dict()

        return cls.get_collection().count(to_refs(filter), **kwargs)
1019508
def count(self, query):
        
        body = {
            "query": {
                "bool": {
                    "must": [{
                        "query_string": {
                            "query": query,
                        }
                    }]
                }
            }
        }

        body['query']['bool']['must'].append(self._get_timestamp_filer())

        return self._es.count(index=self._index, body=body).get('count')
1147411
def rowCount(self, parent=QModelIndex()):
        

        if not parent.isValid():
            parent_node = self.__root_node
        else:
            parent_node = parent.internalPointer()
        return parent_node.children_count()
523846
def get_rows( self, key ):
        """"""
        if key not in self.roots:
            self.get_root( key )
        if key == 'location':
            return self.location_rows 
        else:
            return self.rows
938416
def sparql_count(self, query, flush=None):
        
        return self.count_statements(query, language='sparql', type='tuples',
            flush=flush)
754299
def count_rows(self, table_name):
        """"""
        self.table_must_exist(table_name)
        query = "SELECT COUNT (*) FROM `%s`" % table_name.lower()
        self.own_cursor.execute(query)
        return int(self.own_cursor.fetchone()[0])
1044746
public function count()
    {
        if ($this->_rowCount === null) {
            $rowCount = $this->_query->count();
            $this->setRowCount($rowCount);
        }

        return $this->_rowCount;
    }