开发者

Populating catalogs in Google App Engine

I'm new using Google App Engine and I want to pre-populate catalogs before to go production.

Catalogs like: - Role (role_key,role_description) - Country (county_key,description) - etc.

If I was using mySQl, oracle, etc. like my data store and not using GAE I would do something like:

  • insert into Role (role_key,role_description) values (1,'ADMIN');

  • insert into Role (role_key,role_description) values (2,'USER_VIEW');

  • insert into Country 开发者_JAVA百科(county_key,role_description) values ('MX','Mexico');

  • insert into Country (county_key,role_description) values ('USA','United states');

  • etc

And before to deploy my application I'd run this script into the data base.

But how can I do this (maybe not exactly the same, not same sintax, etc) with Google App Engine?

Thank you people.

Best regards,


The general solution for this is the bulkloader. You can use it to import data from a CSV file or other formatted data source.

For more ad-hoc data insertion, there's also remote_api. This will give you an interactive shell where you can manage datastore entities or make other API calls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜