script to export db to csv