from Hacker News

Show HN: Query Google Sheet data using PostgreSQL clients

by houqp on 5/31/22, 4:24 AM with 22 comments

  • by mritchie712 on 5/31/22, 10:36 AM

    You can query a Sheet with Clickhouse out of the box. Obviously doesn't

        with sheet as (
        select \* 
        from 
        url('https://docs.google.com/spreadsheets/d/1XGCy0tYU5YcEouO09_ErZIyqjA-VJ4pidLZmMmJkEdk/gviz/tq?tqx=out:csv&sheet=Sheet1&range=A:C', CSVWithNames)
        )
    
        select \* from sheet
    
    
    
    https://luabase.notion.site/Query-a-Google-Sheet-905da4e981b...
  • by whatrocks on 5/31/22, 12:55 PM

    I use roapi to power my “book list” on my static site. I have it running on an always-on Replit repl. Try it here:

    https://charlieharrington.com/library/

    Click the “I’m feeling lazy” button if you just want to see some example queries.

    I also wrote a tutorial, as well, if you’d like to try out roapi yourself:

    https://charlieharrington.com/sql-powered-reading-list/

  • by hbarka on 5/31/22, 6:05 AM

    I spent years using Excel but I mostly use Google Sheets now. The cloud integration just feels much more effortless compared to Microsoft’s Office products ported to cloud. I’ve seen departments using GS as a system of record for quickly setting up master data like budgets and forecasts. I wish it had database connectivity the way Excel has ODBC.
  • by nathanwallace on 5/31/22, 10:45 AM

    Steampipe [1] is an open source Postgres Foreign Data Wrapper with 73 plugins [2] including Google Sheets support [3]. A lot of our users use it to connect custom metadata with other systems - e.g. join ownership info in Google Sheets with tags on AWS resources. Notes: I'm a lead on the project, it's focused on read only.

    1 - https://steampipe.io 2 - https://hub.steampipe.io/plugins 3 - https://hub.steampipe.io/plugins/turbot/googlesheets

  • by hoistbypetard on 5/31/22, 6:16 AM

    Last time I tried to do the moral equivalent of this (not using SQL, just some custom python), I ran afoul of the rate limits really quickly.

    Does this client do something smart to mitigate that, have the limits been relaxed, or is it still a problem?

  • by kristiandupont on 5/31/22, 7:22 AM

    I have thought about using google sheets as the database for projects many times.

    The great thing about it is that you get a very versatile admin UI for free. The downsides however are rate limits and the fact that I can't think of any way to build in some sort of safety that would prevent people from accidentally deleting a bunch of data with a mouse click. I would love to hear if anyone has real life experience with the approach.

  • by Normal_gaussian on 5/31/22, 7:18 AM

    This is cool; from reading the descriptions I presume this doesn't support writing - is there any intention to do so?
  • by jdonaldson on 5/31/22, 4:21 PM

    Using this with materialized views could be very useful!