Created
April 17, 2025 12:47
-
-
Save rednafi/8c13b4a446fee7aeb5096413f451d3af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for { | |
// Build the paginated query | |
query := session.Query("SELECT id, name FROM users").PageSize(pageSize).PageState(pageState) | |
iter := query.Iter() | |
var id gocql.UUID | |
var name string | |
for iter.Scan(&id, &name) { | |
fmt.Printf("User: %s - %s\n", id, name) | |
} | |
// Get the next page state | |
pageState = iter.PageState() | |
if len(pageState) == 0 { | |
break // no more pages | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment