Nakal
A MySQL backup tool for Google Sheets, written in Node.js.
Why
At Exun Clan, my school's CS club, we usually build an app and take it down after a month or two. However, we need the data somewhere easily accessible by people who don't know SQL for much longer than that. We already use Google Sheets for a lot of internal tracking so this felt like the natural thing to do.
How
Read the code here.
I'd never written a CLI with Node.js before but I'd heard good things about yargs so I decided to use it. It was easy enough to setup and didn't get in the way, 10/10. I used the google-spreadsheet package to edit spreadsheets.
I started by writing a function to fetch tables and their contents from the database and another function to put those into a Google Sheet. The user needs to make the Google Sheet, share it with the client email and give me the sheetId and the functions populate that sheet with data.
Usage
Check out the README.