- Use a SQL client such as TablePlus to query the data you need
- Export that data as JSON, replacing the placeholder in
sql-dump-data.json
- [optional] change the resulting filename on line 21 (default is the current date as an ISO string)
- Update the reduce function on line 4 to fit your needs a. [optional] filter out any data you don't want in the final result (this can sometimes be easier than creating an uber-specific SQL query) b. format/transform the data to contain all of the properties and values you need (object keys will become the spreadsheet headers; each item in the resulting array will become a row in the spreadsheet)
- Run
node index.js
to create your CSV - Upload the CSV file to a spreadsheet
cd example
node index.js