satellite/satellitedb: paginating on ordered invoice

87d0789691 replaces offset usage with cursors.

But to continue the interation from a specific cursor, we need to iterate over ordered records.

(at least this is what I understood based on the failing tests)

87d0789691

Change-Id: Ic4da3a7c5f03386dd4c373c05102f05871900a3a
This commit is contained in:
Márton Elek 2023-05-16 14:49:29 +02:00 committed by Storj Robot
parent 4bdbb25d83
commit f1b9f6b672

View File

@ -141,6 +141,7 @@ func (db *invoiceProjectRecords) ListUnapplied(ctx context.Context, cursor uuid.
stripecoinpayments_invoice_project_records stripecoinpayments_invoice_project_records
WHERE WHERE
id > ? AND period_start = ? AND period_end = ? AND state = ? id > ? AND period_start = ? AND period_end = ? AND state = ?
ORDER BY id
LIMIT ? LIMIT ?
`), cursor, start, end, invoiceProjectRecordStateUnapplied.Int(), limit+1))(func(rows tagsql.Rows) error { `), cursor, start, end, invoiceProjectRecordStateUnapplied.Int(), limit+1))(func(rows tagsql.Rows) error {
for rows.Next() { for rows.Next() {