Can I make Google Drive Spreadsheets act like a MySQL database?

后端 未结 3 841
情话喂你
情话喂你 2020-12-24 08:07

Can I use a Google Drive spreadsheet as if it were (similar to) a MySQL database?

I\'m thinking of using it as a player database for an HTML/JavaScript web game. Th

相关标签:
3条回答
  • 2020-12-24 08:14

    Answers saying you need an extra server or oauth are incorrect. Just publish an appscript (anonymous public) service using your permissions. For all operations always pass the username and password thus you validate users on every call. Call the service from client js using ajax. Store it in scriptdb [update: scriptDb is deprecated now]. If you use spreadsheet for storage it will get slow with many rows.

    In any case it will be slow if you use appscript.

    0 讨论(0)
  • 2020-12-24 08:17

    This is the right way to do it. Another post explaining the same idea. Essentially, we publish the spreadsheet and query it using a "select"-like syntax. For instance: this query which reads something like:

    https://spreadsheets.google.com/tq?tqx=out:html&tq=select+B,C,I&key=phNtm3LmDZEObQ2itmSqHIA
    

    This is for querying data (reading). For inserting, you can use google forms (create a form, see its html and submit using a http post request). I have not explored update yet.

    And yes, this has to be done server side.

    0 讨论(0)
  • 2020-12-24 08:35

    Without a server-side service that implements another authentication layer for client libraries and use Google auth to talk to Drive, this is not possible.

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