I need to consistently iterate over entire space in my application. Currently I'm using batches (e.g. classic limit-offset approach), but it can't be done in one transaction and will be inconsistent (e.g. remove from subset of already read tuples will lead to lost tuple, because of changed offset).
Moreover, manual batching is not so user-friendly, I want something like following:
rows, err := conn.Query(ctx, "SELECT id, title, tags FROM video")
if err != nil {
panic(err)
}
var videos []Video
for rows.Next() {
var v Video
if err := rows.Scan(&v.ID, &v.Title, &v.Tags); err != nil {
panic(err)
}
videos = append(videos, v)
}
This is how I can perform SELECT entire table in go and postgresql, which will be internally buffered and still consistent.
Is there a way to achieve this in Tarantool?