I need to create a CSV for all products in the database

The idea is a user can click on a link and download a csv of all the products in the database in CSV format.

Any ideas on how i would go about this?