When you want to pull every row one time on a table that is changing, Query.all() can sometimes give you unexpected behavior, I'm pretty sure this is related to the table changing and then all() getting the next tranche of results using LIMIT X OFFSET Y but the underlying table structure having changed.
To get around this it might be worth modifying all() or adding something like an every() that will sort by primary key ascending or descending and then keep track of what primary key was the last and then use that to get the next set of rows
To test this, you could add a bunch of rows, then you could have a thread that would change the db while the test is running through all the rows and make sure you see each row one time.
When you want to pull every row one time on a table that is changing, Query.all() can sometimes give you unexpected behavior, I'm pretty sure this is related to the table changing and then all() getting the next tranche of results using
LIMIT X OFFSET Y
but the underlying table structure having changed.To get around this it might be worth modifying all() or adding something like an every() that will sort by primary key ascending or descending and then keep track of what primary key was the last and then use that to get the next set of rows
To test this, you could add a bunch of rows, then you could have a thread that would change the db while the test is running through all the rows and make sure you see each row one time.