如何清理开发数据存储?

huangapple go评论76阅读模式
英文:

How to cleanup the development datastore?

问题

在Google App Engine Go SDK中,有时我们可以使用一堆测试数据填充本地数据存储。使用Web界面每次删除20条记录来删除数千条记录非常繁琐。是否有一个命令可以清除本地数据存储?

英文:

In Google App Engine Go SDK sometimes we can fill the local datastore with a bunch of test data. It's tiring to delete thousands of records 20 at a time using the web interface. Is there a command the erases the local datastore?

答案1

得分: 3

在启动时,只需提供--clear_datastore命令行参数:

goapp serve --clear-datastore

文档链接:Go开发服务器:使用Datastore

请注意,文档内容是从Python部分复制过来的,你需要按照上述方式使用(如果尝试执行goapp serve --clear_datastore=yes会出错)。

英文:

Simply provide the --clear_datastore command line parameter when starting:

goapp serve --clear-datastore

Documented at: The Go Development Server: Using the Datastore.

> To clear the local datastore for an application, use the --clear_datastore=yes option when you start the web server:

Note that the documentation was "copied" from the Python section, you need to use it as presented above (you get an error if you try to execute goapp serve --clear_datastore=yes).

答案2

得分: 1

我不了解Go语言,但在Java中,你可以简单地删除WEB-INF/appengine-generated文件夹中的local_db.bin文件。下次运行应用程序时,会创建一个空文件。

英文:

I don't know about Go, but in Java you can simply delete local_db.bin from WEB-INF/appengine-generated folder. An empty file will be created next time you run the app.

huangapple
  • 本文由 发表于 2015年11月2日 01:37:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/33465099.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定