Creating Auto Incrementing column in Google Appengine

青春壹個敷衍的年華 提交于 2019-12-13 17:17:55

问题


What is the easiest and most efficient way to create an auto-increment counter for every data row in google appengine?

basically I want to give every row a unique row_number so that I can overcome the issue of only being able to get the first 1000 results in a select query. I can thus add a counter lies between condition and mine all the entires in the table.


回答1:


You don't need to keep track of row numbers, you can use cursors instead.

For Java see:

http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Query_Cursors

For Python see:

http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Query_Cursors



来源:https://stackoverflow.com/questions/2894808/creating-auto-incrementing-column-in-google-appengine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!