我可以让Google云端硬盘电子表格像MySQL数据库吗? [英] Can I make Google Drive Spreadsheets act like a MySQL database?

查看:606
本文介绍了我可以让Google云端硬盘电子表格像MySQL数据库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用Google云端硬盘电子表格,如同(类似于)MySQL数据库一样吗?

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

我正在考虑将其用作HTML / JavaScript网络游戏的播放器数据库。玩家的用户名,密码和分数等等将被保存在数据库中。这将是非常有趣的,如果它实际上可以工作,但它当然要安全和私人,所以没有玩家(或任何人在互联网上的)可以访问它,除了电子表格的所有者,这将是我的例子。

I'm thinking of using it as a player database for an HTML/JavaScript web game. The player's username, password, and score among other things would be saved in the database. It would be really interesting if it could actually work, however it of course has to be secure and private so that no player (or anyone on the internet for that matter) can access it except the owner of the spreadsheet which would be me for example.

我知道Google Apps脚本允许用户访问自己的电子表格并对其进行读/写,但是我可以允许其他用户

I know that Google Apps Script allows a user to access their own spreadsheet and read/write to it, but is there a way that I could allow other users to "save their score" to MY spreadsheet WITHOUT giving them permission to view/edit the spreadsheet directly?

此外,我假设PHP / Python /某些其他服务器端语言必须使用以隐藏我的帐户信息,我也假设需要打开和关闭与我的电子表格的连接。

Also, i'm assuming PHP/Python/some other server-side language would have to be used in order to hide my account info which I also assume would be needed to open and close the connection with my spreadsheet.

无论如何,我只是想知道这是否可行?从字面上将Google云端硬盘电子表格转换为数据库,玩家可以更新其分数,但不能直接访问。

Anyways, I'm just wondering if this is feasible.. literally turning a Google Drive spreadsheet into a database that players can update their score to but not have direct access to it.

这可能是愚蠢的想法,欢迎您的意见!

This may be a stupid idea, so your opinions are welcome!

提前感谢!

推荐答案

回答说你需要一个额外的服务器或oauth不正确。
只需使用您的权限发布appscript(匿名公共)服务。对于所有操作,始终传递用户名和密码,因此您在每次呼叫时验证用户。使用ajax从客户端js调用服务。
将它存储在scriptdb [update:scriptDb现在已弃用]。

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.

在任何情况下,如果您使用appscript,它会很慢。

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

这篇关于我可以让Google云端硬盘电子表格像MySQL数据库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆