Adding methods to fetch the count of matching rows for a given query.