views:

221

answers:

1

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  A: 

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

Peter Farmer
wonderful! thanks!
demos