How to connect Google Sheets to Database

前端 未结 8 1689
[愿得一人]
[愿得一人] 2020-12-23 02:31

I\'m trying to auto-populate some raw data on a sheet in my google sheets file with a query.

It doesn\'t look like sheets has any built in functionality to do so lik

相关标签:
8条回答
  • 2020-12-23 03:14

    You have couple options:

    1. Build your own connector / addon

    You can build your own connector using Google app script (https://developers.google.com/apps-script/guides/sheets). I'd recommend this tutorial for addon development https://youtu.be/6jcc3xm7aRU.

    To connect to your database, you can either use the JDBC services (https://developers.google.com/apps-script/guides/jdbc) like @abielita suggested, or use a separate database connectors, like psycopg2 or node-postgres if Apps Script JDBC service does not support your database. Run it on some server, front it with REST API and fetch the data from Google sheet.

    2. Use addon

    There are many addons in the market that are trying to solve this exact problem. You can find them by searching "connect database to google sheets" on G Suite Marketplace (https://gsuite.google.com/marketplace).

    0 讨论(0)
  • 2020-12-23 03:20

    If you don't want to roll your own solution, check out SeekWell. It allows you to connect to databases and write SQL queries directly in Sheets.

    A few other features:

    • Quickly view all tables and columns in a database and get summary stats on a column with one click
    • Query from the sidebar, a large pop-out window, or from within a cell Results can be sent to a specific cell, scratch sheet or directly to a pivot table
    • Your query history is saved and viewable if you need to re-execute an older query
    • You can save a set of queries on a “Run Sheet” to update multiple reports at once

    Disclaimer: I made this.

    0 讨论(0)
提交回复
热议问题