在Google Appengine中创建自动递增列 [英] Creating Auto Incrementing column in Google Appengine

查看:155
本文介绍了在Google Appengine中创建自动递增列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



基本上我想给每一行一个唯一的唯一的行row_number,这样我就可以解决只能在选择查询中获得前1000个结果的问题。因此,我可以在状态和我的表中的所有状态之间添加一个计数器。

解决方案

您不需要跟踪行号,您可以使用游标。



对于Java请参阅:

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



对于Python,请参阅:

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


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.

解决方案

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

这篇关于在Google Appengine中创建自动递增列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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