英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论