3 ms·
> We're a Google Drive shop. No way to connect Sheets to DB2. FWIW, Google has an API that can be used to get data into and out of things like Sheets. The docu
by thaumaturgy 9y ago
> We're a Google Drive shop. No way to connect Sheets to DB2.
FWIW, Google has an API that can be used to get data into and out of things like Sheets. The documentation for it is abysmal and there are only a few libraries out there, most of which aren't complete. But, I've done it, and have some rough (but easy-to-understand) code that can "import" Sheets into MySQL. Going the other way should be a matter of tweaking the Google account permissions and calling a couple of different functions.
It's in PHP, but it's not gross PHP, so you can probably translate it into whatever you're familiar with.
- IanCal 9y agoI use pydrive. If you're doing something reasonable once a week it'll easily be fine. I had problems trying to push a few hundred thousand things in a short time, but otherwise I highly recommend this as a first step for sharing data.
- falcor84 9y agoThere's another really cool way that I've started using lately - doPost[0]. You can set up a js (appscript) function with that name and then publish it for anonymous use (such that the long endpoint url is the secret key). You can for example set up a cron job to post some json to that endpoint and have the js validate it and update a sheet accordingly (or even create a new one). [0] https://developers.google.com/apps-script/guides/web https://developers.google.com/apps-script/guides/web
- chrsstrm 9y agoHere's a freebie that I wrote in like 15 minutes and use in multiple prod situations. Treat any Google Sheet like a JSON data source. https://gist.github.com/chrsstrm/3fb0ce6820acecf62c5490d220d4ec5f https://gist.github.com/chrsstrm/3fb0ce6820acecf62c5490d220d... Yes, the App Script API is kind of limited, but also extremely powerful for simple services or to glue services together.