Ported SQL call to get mimetype -> view function mapping