【问题标题】:How can I connect to Heroku Postgres from a Google Spreadsheet如何从 Google 电子表格连接到 Heroku Postgres
【发布时间】:2013-01-03 17:22:57
【问题描述】:

我想使用 Google 电子表格来显示我的数据库分析

我希望能够使用 Google Apps 脚本对我的 Heroku Postgres 数据库进行摘要查询,然后在 Google 电子表格中显示和绘制图表。

Heroku 提供了多种连接 Heroku Postgres 的方法: https://devcenter.heroku.com/articles/heroku-postgresql

同样,Google Apps 脚本提供对许多不同外部服务的访问 https://developers.google.com/apps-script/defaultservices

我以前从未尝试过,所以对最简单的东西很感兴趣。

JDBC 似乎可行,但还有其他选择吗?

据我所知,两者之间唯一的重叠是 JDBC,我没有使用过它,但感觉有点像用于在系统之间获取的重量级第三种协议。

JDBC 是获取数据的最佳方式还是我缺少一些更简单的方法?

【问题讨论】:

标签: postgresql jdbc heroku google-apps-script google-sheets


【解决方案1】:
  1. 从 dataclips.heroku.com 设置一个数据剪辑,并将所需数据描述为 SQL 查询。
  2. 将 .csv 附加到生成的 URL
  3. 在 google 电子表格的 importData 函数中使用该 URL,如下所示:

    =importData("https://dataclips.heroku.com/[your-dataclip].csv")

【讨论】:

  • 我没有,因为我不使用JVM,但是heroku postgres数据库只是普通的postgres数据库,所以使用JDBC应该没有问题(但你必须启用SSL)
  • 这是只读的,还是更新电子表格也会更新 Heroku 的数据库?
【解决方案2】:

QueryClips 正是您所需要的。这是它的主要用例。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-20
    • 2021-01-25
    • 2015-07-27
    • 2018-05-19
    • 1970-01-01
    • 1970-01-01
    • 2016-02-11
    • 2017-10-07
    相关资源
    最近更新 更多