class PostgresSchema {

    public static void count(final QueryStatement statement, final CollectionName collection, final IObject criteria)
            throws QueryBuildException {
        try {
            Writer body = statement.getBodyWriter();

            body.write("SELECT COUNT(*) FROM ");
            body.write(collection.toString());

            if (criteria == null) {
                return;
            }
            SearchClauses.writeSearchWhere(statement, criteria);
        } catch (Exception e) {
            throw new QueryBuildException("Failed to build count query", e);
        }
    }

    private  PostgresSchema();

}