Add support for count queries.